full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_34_23.ps1 | sample_34_23.ps1 | ##------------------------------------------------------------------
## <copyright file="StandaloneObservabilityHelper.psm1" company="Microsoft">
## Copyright (C) Microsoft. All rights reserved.
## </copyright>
##------------------------------------------------------------------
Import-Module "$PSScriptRoot... |
combined_dataset/train/non-malicious/sample_67_98.ps1 | sample_67_98.ps1 | #
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ... |
combined_dataset/train/non-malicious/Get-Parameter_2.ps1 | Get-Parameter_2.ps1 | param($Cmdlet) foreach ($paramset in (Get-Command $Cmdlet).ParameterSets) {
$Output = @()
foreach ($param in $paramset.Parameters) {
$process = "" | Select-Object Name, ParameterSet, Aliases, IsMandatory, CommonParameter
$process.Name = $param.Name
if ( $paramset.name -eq "__AllParameterSets" ) { $process.... |
combined_dataset/train/non-malicious/sample_45_15.ps1 | sample_45_15.ps1 | #
# Module manifest for module 'OCI.PSModules.Devops'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Devops.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/2359.ps1 | 2359.ps1 | param (
[Parameter(Mandatory, ValueFromPipelineByPropertyname)]
[ValidateNotNullOrEmpty()]
[string]$FirstName,
[Parameter(Mandatory, ValueFromPipelineByPropertyname)]
[ValidateNotNullOrEmpty()]
[string]$LastName,
[Parameter(Mandatory, ValueFromPipelineByPropertyname)]
[ValidateNotNullOrEmpty()]
[string]$Mi... |
combined_dataset/train/non-malicious/4351.ps1 | 4351.ps1 | function Publish-PSArtifactUtility {
[CmdletBinding(PositionalBinding = $false)]
Param
(
[Parameter(Mandatory = $true, ParameterSetName = 'PublishModule')]
[ValidateNotNullOrEmpty()]
[PSModuleInfo]
$PSModuleInfo,
[Parameter(Mandatory = $true, ParameterSetName = 'Publ... |
combined_dataset/train/non-malicious/97.ps1 | 97.ps1 |
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true, HelpMessage="AdminUser@myenvironment.onmicrosoft.com")]
$AdminUser,
[Parameter(Mandatory=$false, HelpMessage="MySecAdminGroup")]
[string]$SecAdminGroup,
[Parameter(Mandatory=$false, HelpMessage="c:\mylist.txt")]
$SecurityGroupList
)
... |
combined_dataset/train/non-malicious/sample_38_33.ps1 | sample_38_33.ps1 | $url = $args[0]
Write-Host "Downloading Microsoft Edge Dev"
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\microsoft-edge-dev.msi"
$wc.Downloadfile($url, $msiInstaller)
Write-Host "Installing Microsoft Edge Dev"
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -... |
combined_dataset/train/non-malicious/sample_17_82.ps1 | sample_17_82.ps1 | param( [string]$DataPath, [switch]$AcceptEula )
$version = "Evt-Collect (20240604)"
# by Gianni Bragante - gbrag@microsoft.com
Function EvtLogDetails {
param(
[string] $LogName
)
Write-Log ("Collecting the details for the " + $LogName + " log")
$cmd = "wevtutil gl """ + $logname + """ >>""" + $g... |
combined_dataset/train/non-malicious/981.ps1 | 981.ps1 |
$SubscriptionId = ''
$primaryResourceGroupName = "myPrimaryResourceGroup-$(Get-Random)"
$secondaryResourceGroupName = "mySecondaryResourceGroup-$(Get-Random)"
$primaryLocation = "westus2"
$secondaryLocation = "eastus"
$primaryServerName = "primary-server-$(Get-Random)"
$secondaryServerName = "secondary-server-$(Get-... |
combined_dataset/train/non-malicious/sample_24_10.ps1 | sample_24_10.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
$ScratchDiskTemplateName = 'D:\UpdateScratchDisk... |
combined_dataset/train/non-malicious/ExportSQLDeadlockGraphs.ps1 | ExportSQLDeadlockGraphs.ps1 | <#
ALZDBA SQLServer_Export_DeadlockGraphs_SMO.ps1
Export top n Deadlock graphs for all databases of a given SQLServer (SQL2008+) Instance
results in a number of .XDL files and one overview file *AllDbDeadlockGraphs.csv.
Double clicking an .XDL file will open the graphical representation of the deadlock info in SQ... |
combined_dataset/train/non-malicious/sample_37_45.ps1 | sample_37_45.ps1 | # Downloading specified vulkan sdk and vulkan runtime
# Touch this file needs update both WINDOWS_X64_BUILD_TAG WINDOWS_X64_TEST_TAG
# This file needs run in administrator mode
$env:VULKAN_SDK_VERSION="1.3.211.0"
$ProgressPreference = "SilentlyContinue"
# Save environment VULKAN_SDK_VERSION to system
[System.Environ... |
combined_dataset/train/non-malicious/192.168.1.1.ps1 | 192.168.1.1.ps1 | function Set-IPAddress {
param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"),
[string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"),
[string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"),
[string]$gateway = $(read-host "Enter... |
combined_dataset/train/non-malicious/2277.ps1 | 2277.ps1 | [CmdletBinding()]
param(
[parameter(Mandatory=$true)]
$SiteServer,
[parameter(Mandatory=$true)]
$SiteCode,
[parameter(Mandatory=$true)]
$ResourceID
)
function Load-Form {
$Form.Controls.Add($DGVResults1)
$Form.Controls.Add($DGVResults2)
$Form.Controls.Add($GBMW)
$Form.Controls.Add($GBMWUpcoming)
$F... |
combined_dataset/train/non-malicious/sample_53_49.ps1 | sample_53_49.ps1 | # region Generated
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... |
combined_dataset/train/non-malicious/sample_65_40.ps1 | sample_65_40.ps1 | <#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2021 v5.8.194
Created on: 10/19/2021 3:50 PM
Created by: ksarens
Updated 10/26/2102
fixing error in help information
adding support for offline... |
combined_dataset/train/non-malicious/sample_53_74.ps1 | sample_53_74.ps1 | #
# Module manifest for module 'OCI.PSModules.Integration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Integration.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_40_71.ps1 | sample_40_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Workrequests'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Workrequests.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/3768.ps1 | 3768.ps1 |
function Test-CreateAndRemoveLogicApp
{
$resourceGroup = TestSetup-CreateResourceGroup
$workflowName = getAssetname
$location = Get-Location "Microsoft.Logic" "workflows" "West US"
$definitionFilePath = Join-Path (Join-Path $TestOutputRoot "Resources") "TestSimpleWorkflowDefinition.json"
$parameter... |
combined_dataset/train/non-malicious/sample_23_70.ps1 | sample_23_70.ps1 | // Copyright (c) Microsoft Corporation. All rights reserved.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function ping(context) {
context.WaitForRequestData(function (pingMessage) {
context.RespondOkWithJsonData({ message: pingMessage });
});
return true;
}
exports.ping = ping;... |
combined_dataset/train/non-malicious/sample_38_10.ps1 | sample_38_10.ps1 | #
# Script module for module 'Az.MachineLearning' that is executed when 'Az.MachineLearning' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 05/16/2024 06:33:08
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try... |
combined_dataset/train/non-malicious/sample_63_31.ps1 | sample_63_31.ps1 | $global:VerbosePreference = 'Continue'
Function Write-Custom-Output
{
Param([string]$message)
$date = Get-Date
$newMessage = '[{0}] {1}' -f $date, $message
Write-Output $newMessage
}
trap [Exception]
{
Write-Custom-Output "WARN: Terminating error encountered on line $($_.Invoc... |
combined_dataset/train/non-malicious/Copy Files Log to Excel.ps1 | Copy Files Log to Excel.ps1 | # Get User/Pass
$Cred = Get-Credential
# Add Quest CMDLETS
Add-PSSnapin Quest.ActiveRoles.ADManagement -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
# Get Computer's from AD
$Computers = Get-QADComputer -SearchRoot "OU=Workstations,DC=Domain,DC=com" -Credential $Cred
# Import BITS for the file tra... |
combined_dataset/train/non-malicious/1285.ps1 | 1285.ps1 |
function Complete-CJob
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[Management.Automation.Job[]]
[Alias('Jobs')]
$Job,
[Parameter()]
[int]
$IntervalSeconds = 1
)
Use-CallerPreference -Cmdlet $PSCmdlet -... |
combined_dataset/train/non-malicious/2299.ps1 | 2299.ps1 | function Invoke-Program {
[CmdletBinding()]
[OutputType([System.Management.Automation.PSObject])]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$FilePath,
[Parameter(Mandatory)]
[string]$ComputerName,
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]$ArgumentList,
[Paramet... |
combined_dataset/train/non-malicious/sample_67_45.ps1 | sample_67_45.ps1 | ##########################################################################
# DELL PROPRIETARY INFORMATION
#
# This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this
# software to you under the terms of a license agreement,nondisclosure agreement or both.
# You may not copy, disclose, o... |
combined_dataset/train/non-malicious/396.ps1 | 396.ps1 |
$script:path_RegistryUserDefault = "HKCU:\SOFTWARE\Microsoft\WindowsPowerShell\PSFramework\Config\Default"
$script:path_RegistryUserEnforced = "HKCU:\SOFTWARE\Microsoft\WindowsPowerShell\PSFramework\Config\Enforced"
$script:path_RegistryMachineDefault = "HKLM:\SOFTWARE\Microsoft\WindowsPowerShell\PSFramework\Config\De... |
combined_dataset/train/non-malicious/sample_27_63.ps1 | sample_27_63.ps1 | @{
ModuleVersion = '7.0.1'
GUID = '3859ddf6-1713-4701-adf3-477aeaa06333'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Microsoft® Corporation. All rights reserved."
NestedModules="Newtonsoft.Json.dll"
}
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDz... |
combined_dataset/train/non-malicious/357.ps1 | 357.ps1 | function Set-PSFTypeAlias
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
[CmdletBinding(DefaultParameterSetName = 'Name', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Set-PSFTypeAlias')]
Param (
[Parameter(Mandatory = $true, Positi... |
combined_dataset/train/non-malicious/sample_15_56.ps1 | sample_15_56.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
function Unpublish-ServiceFab... |
combined_dataset/train/non-malicious/Update VM Tools_2.ps1 | Update VM Tools_2.ps1 | ########################################################
# Created by Brian English
# for Charlotte County Government
# No warranty suggested or implied
########################################################
########################################################
#connect to VirtualCenter server (i.e. virtua... |
combined_dataset/train/non-malicious/MetroApps Module.ps1 | MetroApps Module.ps1 | <#
Created by: Tome Tanasovski
Version: 1.0
Date: 11/2/2012
This module provides two functions:
Get-MetroApp - This cmdlet reads the registry for the keys that have the launcher id and the entry point (interesting for xaml apps, but not so much for html5 apps)
Start-MetroApp - This cmdlet uses one of the id... |
combined_dataset/train/non-malicious/1948.ps1 | 1948.ps1 |
Describe "XmlCommand DRT basic functionality Tests" -Tags "CI" {
BeforeAll {
if(-not ('IsHiddenTestType' -as "type"))
{
Add-Type -TypeDefinition @"
public class IsHiddenTestType
{
public IsHiddenTestType()
{
Property1 = 1;
Property2 = "some st... |
combined_dataset/train/non-malicious/sample_55_36.ps1 | sample_55_36.ps1 | #
# Module manifest for module 'OCI.PSModules.Licensemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSE... |
combined_dataset/train/non-malicious/sample_64_63.ps1 | sample_64_63.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'ht... |
combined_dataset/train/non-malicious/191.ps1 | 191.ps1 | function Set-RDPDisable
{
[CmdletBinding()]
PARAM (
[String[]]$ComputerName = $env:COMPUTERNAME
)
PROCESS
{
FOREACH ($Computer in $ComputerName)
{
TRY
{
IF (Test-Connection -ComputerName $Computer -Count 1 -Quiet)
{
$regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win... |
combined_dataset/train/non-malicious/New-XVM_1.ps1 | New-XVM_1.ps1 | #Examples
<#
New-XVM -Name "WS2012-TestServer01" -SwitchName "Switch(192.168.2.0/24)" -VhdType NoVHD
New-XVM -Name "WS2012-TestServer02" -SwitchName "Switch(192.168.2.0/24)" -VhdType ExistingVHD -VhdPath 'D:\\vhds\\WS2012-TestServer02.vhdx'
New-XVM -Name "WS2012-TestServer03" -SwitchName "Switch(192.168.2.0/24)" ... |
combined_dataset/train/non-malicious/sample_50_78.ps1 | sample_50_78.ps1 | #
# Module manifest for module 'OCI.PSModules.Dataintegration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dataintegration.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported P... |
combined_dataset/train/non-malicious/Get-RecurseMember_2.ps1 | Get-RecurseMember_2.ps1 | function Get-RecurseMember {
<#
.Synopsis
Does a recursive search for unique users that are members of an AD group.
.Description
Recursively gets a list of unique users that are members of the specified
group, expanding any groups that are members out into their member users.
Note: Requires the Ques... |
combined_dataset/train/non-malicious/sample_23_82.ps1 | sample_23_82.ps1 | #!powershell
# Copyright (c) 2022 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#AnsibleRequires -CSharpUtil Ansible.Basic
$spec = @{
options = @{
dns_domain_name = @{
type = 'str'
}
domain_admin_user = @{
... |
combined_dataset/train/non-malicious/Snippet Compiler_1.ps1 | Snippet Compiler_1.ps1 | #Require 2.0
$def = [Environment]::CurrentDirectory
##################################################################################################
$mnuOpen_Click= {
(New-Object Windows.Forms.OpenFileDialog) | % {
$_.FileName = "source"
$_.Filter = "C# (*.cs)|*.cs"
$_.InitialDirectory = $d... |
combined_dataset/train/non-malicious/Invoke-NamedParameter_1.ps1 | Invoke-NamedParameter_1.ps1 | Function Invoke-NamedParameter {
<#
.SYNOPSIS
Invokes a method using named parameters.
.DESCRIPTION
A function that simplifies calling methods with named parameters to make it easier to deal with long signatures and optional parameters. This is particularly helpful for COM objects.
.PARAMETER Object
... |
combined_dataset/train/non-malicious/FuncionInfo_2.types.ps1xml.ps1 | FuncionInfo_2.types.ps1xml.ps1 | <?xml version="1.0" encoding="utf-8" ?>
<Types>
<Type>
<Name>System.Management.Automation.FunctionInfo</Name>
<Members>
<ScriptProperty>
<Name>Verb</Name>
<GetScriptBlock>
if ($this.Name.Contains("-")) {
$this.Name.Substring(0,$this.Name.Indexof("-"))
} else {
$null
... |
combined_dataset/train/non-malicious/sample_7_98.ps1 | sample_7_98.ps1 | #
# Module manifest for module 'OCI.PSModules.Clusterplacementgroups'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Clusterplacementgroups.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
... |
combined_dataset/train/non-malicious/Get-MachineStartupShutdo.ps1 | Get-MachineStartupShutdo.ps1 | ##############################################################################\n##\n## Get-MachineStartupShutdownScript\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYN... |
combined_dataset/train/non-malicious/Get-MySqlDataSet.ps1 | Get-MySqlDataSet.ps1 | # Get-MySQLDataSet - Query a MySQL server & return the result to a PoSh variable
# Created: 11/29/07 Modified: 11/29/07
# Written by: Matt Wilson (Kemis / Matt at ClearChoiceIT dot com) with MAJOR help from
# Joel Bennett (Jaykul): http://powershellcentral.com/scripts/57
# Andrew Dashin: http://andrewdashin.co... |
combined_dataset/train/non-malicious/sample_13_11.ps1 | sample_13_11.ps1 | #************************************************
# DC_RDSServerInfo.ps1
# Version 1.0.0
# Date: 21-01-2012
# Author: Daniel Grund - dgrund@microsoft.com
# Description:
# This script gets the RDS config and
# checks vital signs to inform user.
# 1.0.0 Beta release / 2021-03-30 Waltere #_#
#*****************... |
combined_dataset/train/non-malicious/sample_14_38.ps1 | sample_14_38.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmcontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmcontrolplane.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_49_99.ps1 | sample_49_99.ps1 | #
# Module manifest for module 'OCI.PSModules.Dashboardservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dashboardservice.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported... |
combined_dataset/train/non-malicious/sample_49_62.ps1 | sample_49_62.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmtraces'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmtraces.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_7_41.ps1 | sample_7_41.ps1 | ConvertFrom-StringData @'
id_printsettmpsystem32check_st=One or more TMP file found under system32 folder and this may cause problems to install printer drivers
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8... |
combined_dataset/train/non-malicious/sample_24_20.ps1 | sample_24_20.ps1 | """
Manage Windows features via the ServerManager powershell module. Can list
available and installed roles/features. Can install and remove roles/features.
:maintainer: Shane Lee <slee@saltstack.com>
:platform: Windows Server 2008R2 or greater
:depends: PowerShell module ``ServerManager``
"""
import lo... |
combined_dataset/train/non-malicious/2399.ps1 | 2399.ps1 | function Send-File
{
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string[]]$Path,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$Destination,
[Parameter(Mandatory)]
[System.Management.Automation.Runspaces.PSSession]$Session
)
begin
{
function... |
combined_dataset/train/non-malicious/Fisher-Yates shuffle.ps1 | Fisher-Yates shuffle.ps1 | function Shuffle
{
param([Array] $a)
$rnd=(new-object System.Random)
for($i=0;$i -lt $a.Length;$i+=1){
$newpos=$i + $rnd.Next($a.Length - $i);
$tmp=$a[$i];
$a[$i]=$a[$newpos];
$a[$newpos]=$tmp
}
return $a
}
|
combined_dataset/train/non-malicious/sample_8_38.ps1 | sample_8_38.ps1 | # diag_api.psm1
# by tdimli
# March 2020
# API/helper functions
# errors reported by these diagnostics won't be shown on screen to user
# only saved to xray_ISSUES-FOUND_*.txt report file
$Global:BETA_DIAGS = "
net_802dot1x_KB4556307,
net_firewall_KB4561854,
net_wlan_KB4557342,
net_dnscli_KB4562541,
net_da... |
combined_dataset/train/non-malicious/Alias latest msbuild.ps1 | Alias latest msbuild.ps1 | ## Because of Split-Path, I get the "Framework" folder path (one level above the versioned folders)
$rtr = Split-Path $([System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory())
## Then I loop through them in ascending (numerical, but really ascii) order
## each time I find installutil or mdbuild... |
combined_dataset/train/non-malicious/sample_43_4.ps1 | sample_43_4.ps1 | #
# Module manifest for module 'Az.ServiceFabric'
#
# Generated by: Microsoft Corporation
#
# Generated on: 5/16/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.ServiceFabric.psm1'
# Version number of this module.
ModuleVersion = '3.3.3'
# Supported PS... |
combined_dataset/train/non-malicious/2915.ps1 | 2915.ps1 | properties {
$x = $null
$y = $null
$z = $null
}
task default -depends TestProperties
task TestProperties {
Assert ($x -ne $null) "x should not be null"
Assert ($y -ne $null) "y should not be null"
Assert ($z -eq $null) "z should be null"
}
|
combined_dataset/train/non-malicious/sample_42_59.ps1 | sample_42_59.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmconfig'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmconfig.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/GPRS Online log.ps1 | GPRS Online log.ps1 | ################################################################################
# Get-GprsTime.ps1(V 1008)
# Check the total connect time of any GPRS devices from a specified date.
# Use the -Verbose switch for some extra information if desired. A default value
# can be set with the -Monthly switch but can ... |
combined_dataset/train/non-malicious/sample_19_99.ps1 | sample_19_99.ps1 | #
# Module manifest for module 'OCI.PSModules.Accessgovernancecp'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Accessgovernancecp.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Suppo... |
combined_dataset/train/non-malicious/sample_21_23.ps1 | sample_21_23.ps1 | ConvertFrom-StringData @'
id_w32timeoutput=W32Time
id_w32timeobtaining=Gathering W32Time information
'@
# SIG # Begin signature block
# MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlA... |
combined_dataset/train/non-malicious/4030.ps1 | 4030.ps1 |
function Test-AzureProviderFeature
{
$defaultProviderFeatures = Get-AzProviderFeature
$allProviderFeatures = Get-AzProviderFeature -ListAvailable
Assert-True { $allProviderFeatures.Length -gt $defaultProviderFeatures.Length }
$batchFeatures = Get-AzProviderFeature -ProviderName "Micros... |
combined_dataset/train/non-malicious/3944.ps1 | 3944.ps1 |
function Check-CmdletReturnType
{
param($cmdletName, $cmdletReturn)
$cmdletData = Get-Command $cmdletName;
Assert-NotNull $cmdletData;
[array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") }... |
combined_dataset/train/non-malicious/sample_37_3.ps1 | sample_37_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Logging'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Logging.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_60_53.ps1 | sample_60_53.ps1 | #
# Module manifest for module 'OCI.PSModules.Governancerulescontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Governancerulescontrolplane.dll'
# Version number of this module.
ModuleVersion =... |
combined_dataset/train/non-malicious/sample_27_37.ps1 | sample_27_37.ps1 | #
# Module manifest for module 'Microsoft.SME.PowershellConsole'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.PowershellConsole.psm1'
# Version number of this module.
ModuleVersion = '4.11.0'
# Supported PSEditions
# CompatiblePSEditions = @()
... |
combined_dataset/train/non-malicious/ConvertFrom-FahrenheitWi_2.ps1 | ConvertFrom-FahrenheitWi_2.ps1 | ## From Windows PowerShell Cookbook (O'Reilly)
## by Lee Holmes (http://www.leeholmes.com/guide)
param([double] $Fahrenheit)
Set-StrictMode -Version Latest
## Convert Fahrenheit to Celsius
function ConvertFahrenheitToCelsius([double] $fahrenheit)
{
$celsius = $fahrenheit - 32
$celsius = $celsius /... |
combined_dataset/train/non-malicious/sample_21_94.ps1 | sample_21_94.ps1 | #
# Module manifest for module 'OCI.PSModules.Computecloudatcustomer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computecloudatcustomer.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
... |
combined_dataset/train/non-malicious/sample_27_61.ps1 | sample_27_61.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
<#
.SYNOPSIS
This function makes a best ef... |
combined_dataset/train/non-malicious/1901.ps1 | 1901.ps1 |
Describe "Tests for the Import-PowerShellDataFile cmdlet" -Tags "CI" {
It "Validates error on a missing path" {
{ Import-PowerShellDataFile -Path /SomeMissingDirectory -ErrorAction Stop } |
Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.ImportPowerShellDataFileCommand"
... |
combined_dataset/train/non-malicious/New-TestDataSet.ps1 | New-TestDataSet.ps1 | ## Generate a dummy dataset for testing
Param(
$path = $pwd,
$files = $(ls $path)
)
$global:dt = New-Object system.data.datatable "datatable"
$global:ds = New-Object system.data.dataset "dataset"
$null = $ds.Tables.Add( $dt )
$global:cols = ls | where {!$_.PsIsContainer} |
Get-Member -type Propert... |
combined_dataset/train/non-malicious/sample_24_52.ps1 | sample_24_52.ps1 | # region Generated
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... |
combined_dataset/train/non-malicious/105.ps1 | 105.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User,
$Password
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailab... |
combined_dataset/train/non-malicious/finddupe_16.ps1 | finddupe_16.ps1 | function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.MD5CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.OpenRead();
$hashByteArray = $hashA... |
combined_dataset/train/non-malicious/validate an IP address.ps1 | validate an IP address.ps1 | # validate given IP address in $ip1 variable
$ip1 = "192.168.22.455"
($ip1.split(".") | where-object { $_ -ge 1 -and $_ -le 255 } | Where-Object { $_ -match "\\d{1,3}"} | Measure-Object).count -eq 4
|
combined_dataset/train/non-malicious/sample_12_29.ps1 | sample_12_29.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\sucrase@3.35.0\node_modules\sucrase\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\sucrase@... |
combined_dataset/train/non-malicious/sample_29_39.ps1 | sample_29_39.ps1 | # Use the PowerShell extension setting `powershell.scriptAnalysis.settingsPath` to get the current workspace
# to use this PSScriptAnalyzerSettings.psd1 file to configure code analysis in Visual Studio Code.
# This setting is configured in the workspace's `.vscode/settings.json`.
#
# For more information on PSScrip... |
combined_dataset/train/non-malicious/sample_18_68.ps1 | sample_18_68.ps1 | #************************************************
# DC_DSMisc.ps1
# Version 1.0.1
# Date: 07-10-2009
# VBScript by Craig Landis (clandis@microsoft.com)
# PS1 by Andret Teixeira
#************************************************
Import-LocalizedData -BindingVariable DSMiscStrings -FileName DC_DSMisc -UICulture e... |
combined_dataset/train/non-malicious/sample_42_31.ps1 | sample_42_31.ps1 | @{
GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @('MSFT_MpPerformanceRecording.psm1')
FormatsToProcess = @(... |
combined_dataset/train/non-malicious/sample_25_26.ps1 | sample_25_26.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Enter-AmtRemoteConfiguration {
<#
.Synopsis
Enters a Remote Configuration Session with an Intel Active Management Technology client
.Description
The Enter-AmtRemoteConfiguration Cmdlet starts an interactive configuration ... |
combined_dataset/train/non-malicious/4437.ps1 | 4437.ps1 | function Get-PSRepository {
[CmdletBinding(HelpUri = 'https://go.microsoft.com/fwlink/?LinkID=517127')]
Param
(
[Parameter(ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[string[]]
$Name
)
Begin {
}
Process {
$PSBoundParame... |
combined_dataset/train/non-malicious/sample_1_61.ps1 | sample_1_61.ps1 | // ===========================================================================================================================
// class DCIM_RoleMapping
// ===========================================================================================================================
[
Description ("Contains mapping ru... |
combined_dataset/train/non-malicious/4387.ps1 | 4387.ps1 | function Resolve-PathHelper
{
param
(
[Parameter()]
[ValidateNotNullOrEmpty()]
[string[]]
$path,
[Parameter()]
[switch]
$isLiteralPath,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCmdlet]
$call... |
combined_dataset/train/non-malicious/sample_58_58.ps1 | sample_58_58.ps1 | qيحتوي العمود "%{oii_groupedColumn/}" على مرجع GroupByColumn غير صالح عُيَّن إلى المعّرف "%I64u{groupByColumnId/}"bجُمِّع العمود "%{oii_groupedColumn/}" حسب العمود "%{oii_groupByColumn/}" الذي ينتمي إلى جدول مختلف1لا يجوز تعيين اسم الدور إلى '*' أو '*SharePoint'.Kتشير العلاقة '%{ccon_relname/}' إلى عمود من النوع رقم صف... |
combined_dataset/train/non-malicious/sample_29_82.ps1 | sample_29_82.ps1 | #
# Module manifest for module 'PowerShellEditorServices'
#
# Generated by: daviwil
#
# Generated on: 5/12/2016
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'PowerShellEditorServices.Commands.psm1'
# Version number of this module.
ModuleVersion = '0.2.0'
# I... |
combined_dataset/train/non-malicious/HP_Plink_ISO.ps1 | HP_Plink_ISO.ps1 | $plink = plink -ssh Administrator@$ILOIP -pw $PSWD -auto_store_key_in_cache "set /map1/oemhp_vm1/cddr1 oemhp_image=http://IPADDRESS/ISO.iso"
$plink = plink -ssh Administrator@$ILOIP -pw $PSWD -auto_store_key_in_cache "set /map1/oemhp_vm1/cddr1 oemhp_boot=connect"
$plink = plink -ssh Administrator@$ILOIP -pw $PSWD -au... |
combined_dataset/train/non-malicious/3130.ps1 | 3130.ps1 |
function Get-MACAddress
{
[CmdletBinding()]
param(
[Parameter(
Position=0,
Mandatory=$true,
HelpMessage='ComputerName or IPv4-Address of the device which you want to scan')]
[String[]]$ComputerName
)
Begin{
}
Process{
... |
combined_dataset/train/non-malicious/1035.ps1 | 1035.ps1 |
[CmdletBinding()]
param(
)
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Carbon\Import-Carbon.ps1' -Resolve)
$installRoot = Get-PowerShellModuleInstallPath
$carbonModuleRoot = Join-Path -Path $installRoot -ChildPath 'Carbon'
Uninstall-Junction -Path $carbonModuleRoot
|
combined_dataset/train/non-malicious/1587.ps1 | 1587.ps1 |
if (gcm Get-Clipboard -ea 0) {
return
}
function Get-Clipboard {
Add-Type -AssemblyName System.Windows.Forms
$(if ([threading.thread]::CurrentThread.ApartmentState.ToString() -eq 'STA') {
Write-Verbose 'STA mode: Using [Windows.Forms.Clipboard] directly.'
[System.Windows.For... |
combined_dataset/train/non-malicious/sample_22_26.ps1 | sample_22_26.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\rollup@4.9.6\node_modules\rollup\dist\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\rollup... |
combined_dataset/train/non-malicious/sample_29_51.ps1 | sample_29_51.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubsubscription.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported... |
combined_dataset/train/non-malicious/774.ps1 | 774.ps1 | $ErrorActionPreference = 'Stop'
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | Out-Null
if ($IsWindows -or $PSVersionTable.PSVersion.Major -lt 6) {
Get-Module PowerShellGet,PackageManagement | Remove-Module -Force -Verbose
powershell -Command { Install-Module -Name PowerShellGet -MinimumVe... |
combined_dataset/train/non-malicious/sample_56_45.ps1 | sample_56_45.ps1 | """
Module for managing PowerShell through PowerShellGet (PSGet)
:depends:
- PowerShell 5.0
- PSGet
Support for PowerShell
"""
import logging
import xml.etree.ElementTree
import salt.utils.platform
import salt.utils.versions
from salt.exceptions import CommandExecutionError
# Set up logging
log = logging.g... |
combined_dataset/train/non-malicious/1327.ps1 | 1327.ps1 |
function Test-CPerformanceCounter
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$CategoryName,
[Parameter(Mandatory=$true)]
[string]
$Name
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference... |
combined_dataset/train/non-malicious/sample_37_67.ps1 | sample_37_67.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeaiinference'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeaiinference.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
#... |
combined_dataset/train/non-malicious/3365.ps1 | 3365.ps1 |
Import-Module $PSScriptRoot/TestFx-Tasks
Describe "Test-NewCredentialNewServicePrincipal"{
Context "Creates a correctly formatted ServicePrincipal"{
Login-AzureRmAccount -AccessToken "12345678" -SkipValidation -AccountId "testaccount" -TenantId "8bc48661-1801-4b7a-8ca1-6a3cadfb4870" -Subscriptio... |
combined_dataset/train/non-malicious/Get Twitter RSS Feed_9.ps1 | Get Twitter RSS Feed_9.ps1 | param ([String] $ScreenName)
$client = New-Object System.Net.WebClient
$idUrl = "https://api.twitter.com/1/users/show.json?screen_name=$ScreenName"
$data = $client.DownloadString($idUrl)
$start = 0
$findStr = '"id":'
do {
$start = $data.IndexOf($findStr, $start + 1)
if ($start -gt 0) {
$s... |
combined_dataset/train/non-malicious/4374.ps1 | 4374.ps1 | function Get-UrlFromSwid
{
param
(
[Parameter(Mandatory=$true)]
$SoftwareIdentity,
[Parameter(Mandatory=$true)]
$UrlName
)
foreach($link in $SoftwareIdentity.Links)
{
if( $link.Relationship -eq $UrlName)
{
return $link.HRef
}
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.