full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/Movable button.ps1
Movable button.ps1
$btnMove_MouseDown= { if ($_.Button -eq [Windows.Forms.MouseButtons]::Left) { $bool = $true $coor = [Drawing.Point]$_.Location } } $btnMove_MouseMove= { if ($bool) { $btnMove.Location = New-Object Drawing.Point( ($btnMove.Left - $btnMove.X + $_.X), ($btnMove.Top - $btnMove.Y + $_.Y) ...
combined_dataset/train/non-malicious/4318.ps1
4318.ps1
Describe PowerShell.PSGet.UpdateModuleManifest -Tags 'BVT','InnerLoop' { BeforeAll { Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue $script:TempPath = Get-TempPath $scri...
combined_dataset/train/non-malicious/vSphere Resultant Privs_2.ps1
vSphere Resultant Privs_2.ps1
# Need the Quest ActiveRoles cmdlets for this one. Add-PSSnapin Quest.ActiveRoles* -ea SilentlyContinue function Get-Groups { param($principal) # Start with this principal's base set of groups. Write-Verbose "Checking principal $principal" $groups = Get-QADUser $principal | Get-QADMemberOf # Groups ca...
combined_dataset/train/non-malicious/3109.ps1
3109.ps1
function Get-LastBootTime { [CmdletBinding()] param( [Parameter( Position=0, HelpMessage='ComputerName or IPv4-Address of the remote computer')] [String[]]$ComputerName=$env:COMPUTERNAME, [Parameter( Position=1, HelpMessage='Credentials to authent...
combined_dataset/train/non-malicious/4115.ps1
4115.ps1
param ( [Parameter(Mandatory = $false)][string]$LogFile = 'ImagedSystems.log', [Parameter(Mandatory = $true)][string]$MonitoringHost, [Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()][string]$EmailAddress, [Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()][string]$SMTPServer, [Parameter(Mandatory = $...
combined_dataset/train/non-malicious/Get-Netstat _1.9.ps1
Get-Netstat _1.9.ps1
$null, $null, $null, $null, $netstat = netstat -a -n -o [regex]$regex = '\\s+(?<Protocol>\\S+)\\s+(?<LocalAddress>\\S+)\\s+(?<RemoteAddress>\\S+)\\s+(?<State>\\S+)\\s+(?<PID>\\S+)' $netstat | ForEach-Object { if ( $_ -match $regex ) { $process = "" | Select-Object Protocol, LocalAddress, Rem...
combined_dataset/train/non-malicious/sample_31_87.ps1
sample_31_87.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apa...
combined_dataset/train/non-malicious/602.ps1
602.ps1
function Get-SPLists{ param( [Parameter(Mandatory=$false)] $SPWeb, [Parameter(Mandatory=$false)] [string]$FilterListName, [switch]$OnlyDocumentLibraries, [switch]$Recursive ) if ((Get-PSSnapin โ€œMicrosoft.SharePoint.PowerShellโ€ -ErrorAction SilentlyContinue) ...
combined_dataset/train/non-malicious/3933.ps1
3933.ps1
function Test-VirtualNetworkTapCRUDUsingIpConfig { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $nicName = Get-ResourceName $domainNameLabel = Get-ResourceName $rglocation = Get-Pro...
combined_dataset/train/non-malicious/4450.ps1
4450.ps1
function Find-Package { [CmdletBinding()] param ( [string[]] $names, [string] $requiredVersion, [string] $minimumVersion, [string] $maximumVersion ) Write-Debug ($LocalizedData.ProviderApiDebugMessage -f ('Find-Package')) Set-M...
combined_dataset/train/non-malicious/sample_41_59.ps1
sample_41_59.ps1
# # Module manifest for module 'OCI.PSModules.Desktops' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Desktops.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_12_0.ps1
sample_12_0.ps1
@{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" AliasesTo...
combined_dataset/train/non-malicious/1239.ps1
1239.ps1
[CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Name, [Parameter(Mandatory=$true)] [string] $Value ) Set-StrictMode -Version 'Latest' $Name,$Value = $Name,$Value | ForEach-Object { [Text.Encoding]::Unicode.GetString( [Convert]::FromBase64String($_) ) } ...
combined_dataset/train/non-malicious/sample_56_34.ps1
sample_56_34.ps1
# Localized 06/28/2023 08:04 AM (GMT) 303:7.0.30723 msft_packagemanagement.strings.psd1 ######################################################################################### # # Copyright (c) Microsoft Corporation. # ######################################################################################### Co...
combined_dataset/train/non-malicious/Start-Cassini.ps1
Start-Cassini.ps1
function Start-Cassini([string]$physical_path=".", [int]$port=12372, [switch]$dontOpenBrowser) { $serverLocation = Resolve-Path "C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\DevServer\\10.0\\WebDev.WebServer40.EXE"; $full_app_path = Resolve-Path $physical_path $url = "http://localhost:$port" &($...
combined_dataset/train/non-malicious/sample_36_22.ps1
sample_36_22.ps1
# ---------------------------------------------------------------------------------- # 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 obtain a copy of the Licen...
combined_dataset/train/non-malicious/sample_41_84.ps1
sample_41_84.ps1
param([string] $AgentInstallDir) #Get the agent updater module path using intallation directory details $AgentInstallDir=$AgentInstallDir.Trim() $AgentUpdaterModulePath=Join-Path -Path $AgentInstallDir -ChildPath "Kailani.Afs.Updater.Cmdlets.dll" Write-Host "Running the agent updater action from $AgentUpdaterModu...
combined_dataset/train/non-malicious/4260.ps1
4260.ps1
Function Test-ADCredential { Param($username, $password, $domain) Add-Type -AssemblyName System.DirectoryServices.AccountManagement $ct = [System.DirectoryServices.AccountManagement.ContextType]::Domain $pc = New-Object System.DirectoryServices.AccountManagement.PrincipalContext($ct, $domain) $object = New-...
combined_dataset/train/non-malicious/4238.ps1
4238.ps1
Function Get-ServicePerms { $csharp= @" using System; using System.Data; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Text; using System.Threading; using System.Management; using System.Text.RegularExpressions; using System.Security.AccessControl; using System.Security....
combined_dataset/train/non-malicious/sample_48_7.ps1
sample_48_7.ps1
ConvertFrom-StringData @' FailoverClustersModuleRequired=No se encontrรณ el mรณdulo de PowerShell (FailoverClusters) necesario. Usa la herramienta Roles y caracterรญsticas para instalar: Herramientas de administraciรณn remota del servidor | Herramientas de administraciรณn de las caracterรญsticas | Herramientas de clรบsteres ...
combined_dataset/train/non-malicious/2502.ps1
2502.ps1
param ( $IPBlock = "10.0.2" , $IPRange = "0..3" ) foreach($i in 0..13) { try { $ip = "$IPBlock.$i" $HostName = [System.Net.Dns]::GetHostByAddress($ip).HostName Test-Connection $HostName -Count 1 } catch { Write-Warning "Cannot resolve $ip" ...
combined_dataset/train/non-malicious/sample_65_99.ps1
sample_65_99.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ##############################################################>...
combined_dataset/train/non-malicious/4249.ps1
4249.ps1
function powercat { param( [alias("Client")][string]$c="", [alias("Listen")][switch]$l=$False, [alias("Port")][Parameter(Position=-1)][string]$p="", [alias("Execute")][string]$e="", [alias("ExecutePowershell")][switch]$ep=$False, [alias("Relay")][string]$r="", [alias("UDP")][switch]$u=$Fal...
combined_dataset/train/non-malicious/sample_56_61.ps1
sample_56_61.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apach...
combined_dataset/train/non-malicious/sample_12_88.ps1
sample_12_88.ps1
### # ==++== # # 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 obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
combined_dataset/train/non-malicious/Get-Command 2.0.ps1
Get-Command 2.0.ps1
## Which.ps1 - aka Get-Command ################################################################################################### ## This ought to be the same as Get-Command, except... ## This Which function will output the commands ... ## in the actual order they would be used by the shell ######################...
combined_dataset/train/non-malicious/sample_5_87.ps1
sample_5_87.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 = '93.0.0' # Supported...
combined_dataset/train/non-malicious/1172.ps1
1172.ps1
$rootKey = 'hklm:\Software\Carbon\Test\Test-RemoveRegistryKeyValue' $valueName = 'RegValue' function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { if( -not (Test-Path $rootKey -PathType Container) ) { Ne...
combined_dataset/train/non-malicious/sample_16_53.ps1
sample_16_53.ps1
@{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" AliasesTo...
combined_dataset/train/non-malicious/sample_15_82.ps1
sample_15_82.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\which@2.0.2\node_modules\which\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\which@2.0.2\n...
combined_dataset/train/non-malicious/Sendmail for PoSh 2 CTP3.ps1
Sendmail for PoSh 2 CTP3.ps1
#region vars $script:maileditor = "C:\\Programme\\vim\\vim72\\vim.exe" $script:encryption = "C:\\Programme\\GNU\\GnuPG\\gpg.exe" $script:enckey = "s.patrick1982@gmail.com" $script:tempmail = "C:\\temp\\psmail.txt" $script:sigmail = "C:\\temp\\halten\\sig.txt" $script:mailbody = "" #endregion vars #region init...
combined_dataset/train/non-malicious/2265.ps1
2265.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$false, HelpMessage="Site server where the SMS Provider is installed")] [ValidateNotNullOrEmpty()] [string]$SiteServer, [parameter(Mandatory=$false, HelpMessage="Specify the PackageID or CI Unique Name of the object to check if ref...
combined_dataset/train/non-malicious/Split-Job V 1.2.1.ps1
Split-Job V 1.2.1.ps1
#requires -version 2.0 <# ################################################################################ ## Run commands in multiple concurrent pipelines ## by Arnoud Jansveld - www.jansveld.net/powershell ## ## Basic "drop in" usage examples: ## - Functions that accept pipelined input: ## Without S...
combined_dataset/train/non-malicious/sample_65_6.ps1
sample_65_6.ps1
<# .SYNOPSIS MSRD-Collect graphical user interface (Lite version) .DESCRIPTION Module for the MSRD-Collect graphical user interface (Lite version) .NOTES Author : Robert Klemencz Requires : MSRD-Collect.ps1 Version : See MSRD-Collect.ps1 version Feedback : https://aka.ms/MSRD-C...
combined_dataset/train/non-malicious/sample_61_20.ps1
sample_61_20.ps1
# # Module manifest for module 'OCI.PSModules.Computeinstanceagent' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Computeinstanceagent.dll' # Version number of this module. ModuleVersion = '85.1.0' # S...
combined_dataset/train/non-malicious/sample_43_59.ps1
sample_43_59.ps1
ConvertFrom-StringData @' IPAddressDisplayNameFormat=IP-Adresse: {0} NetworkNameDisplayNameFormat=Name: {0} NetworkNameOfflineDisplayNameFormat=IP-Adresse: Adresse in โ€ž{0}โ€œ CreateClusterProgressValidationStart=Die Eignung von Servern fรผr einen Failovercluster wird รผberprรผft... CreateClusterProgressValidationEnd=Di...
combined_dataset/train/non-malicious/sample_13_43.ps1
sample_13_43.ps1
ConvertFrom-StringData @' id_roiscan=Robust Office Inventory Scan id_roiscanobtaining=Collecting Robust Office Inventory Scan '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIB...
combined_dataset/train/non-malicious/sample_29_38.ps1
sample_29_38.ps1
# # Module manifest for module 'OCI.PSModules.Loggingingestion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported...
combined_dataset/train/non-malicious/sample_20_72.ps1
sample_20_72.ps1
# # Module manifest for module 'Microsoft.SME.ScheduledTasks' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.ScheduledTasks.psm1' # Version number of this module. ModuleVersion = '4.10.0' # Supported PSEditions # CompatiblePSEditions = @() # ID ...
combined_dataset/train/non-malicious/sample_45_20.ps1
sample_45_20.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\cssesc@3.0.0\node_modules\cssesc\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\cssesc@3.0....
combined_dataset/train/non-malicious/VMWare Quick Migration_5.ps1
VMWare Quick Migration_5.ps1
######################################### #Name: VMWare Quick Migration Function #Author: Justin Grote <jgrote NOSPAMAT enpointe DOT com> #Credit: Inspired by Mike DiPetrillo's Quick Migration Script: http://www.mikedipetrillo.com/mikedvirtualization/2008/10/quick-migration-for-vmware-the-power-of-powershell.html #...
combined_dataset/train/non-malicious/sample_11_50.ps1
sample_11_50.ps1
ijSTF2QMV0d+rdP3fk8k50BbsieCqKs1WTvT+jFULHTjlpk9UnbjiqLjVKpUAT4MLT4zUGl/YFdmyrpQYfWigRS1RntchqkPJTD7NeN6ug37JMtlZRGUNuz6fjeBpYaoFtnUfngiIl4u4fE7wieYLuWMGuD0eUtKAyWbSgDmaJ3QfLThj9njjBD0yBheJsT5Itq607DTGYPPNegCfObVTz+wbEz3oZlsFzhTGJ7RrHDXDpXMOfKxCFdQR13ZHfoqgyRNeo8ytpmQhJhY6ynapl2UDurdwNxnAi+GBRKW68tON3DmDQDDXBovjXHL2+Ll...
combined_dataset/train/non-malicious/1968.ps1
1968.ps1
Describe 'ConvertFrom-Markdown tests' -Tags 'CI' { BeforeAll { $esc = [char]0x1b $hostSupportsVT100 = $Host.UI.SupportsVirtualTerminal function GetExpectedString { [CmdletBinding()] param( [ValidateSet( "Header1", "Header2", "...
combined_dataset/train/non-malicious/sample_56_25.ps1
sample_56_25.ps1
Import-Module BitsTransfer $DownloadedInstaller="$env:temp\IBM_Cloud_CLI.exe" $RepoHost="download.clis.cloud.ibm.com" $metadataHost="$RepoHost/ibm-cloud-cli-metadata" $binaryDownloadHost="$RepoHost/ibm-cloud-cli" # fetch version metadata of CLI $infoEndpoint="https://$metadataHost/info.json" $req = [System.Net.WebReq...
combined_dataset/train/non-malicious/New-ODataServiceProxy_3.ps1
New-ODataServiceProxy_3.ps1
function New-ODataServiceProxy { #.Synopsis # Creates a proxy class for an odata web service and assigns it to the specified variable. # DOES NOT output the proxy on the pipleline, and you should not do so either! #.Description # Uses the data service client utility (DataSvcUtil.exe) to generate a proxy class ...
combined_dataset/train/non-malicious/sample_17_23.ps1
sample_17_23.ps1
# # Module manifest for module 'OCI.PSModules.Budget' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Budget.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/2711.ps1
2711.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$true,Position=0,ParameterSetName="SinglePartition")] [Parameter(Mandatory=$false,Position=0,ParameterSetName="Default")] [ValidateScript({ $filter = [String]::Format("DeviceId like '%PHYSICALDRIVE{0}'", $_.ToString()) if ($null -ne (Get-WMIObject -Class Win32_...
combined_dataset/train/non-malicious/1198.ps1
1198.ps1
$userDomain = $env:USERDNSDOMAIN $computerDomain = Get-WmiObject 'Win32_ComputerSystem' | Select-Object -ExpandProperty Domain if( (Get-Service -Name MSMQ -ErrorAction SilentlyContinue) -and $userDomain -eq $computerDomain ) { $publicQueueName = 'CarbonTestGetQueue-Public' $privateQueueName = 'Ca...
combined_dataset/train/non-malicious/1177.ps1
1177.ps1
$chocolateyInstall = Join-Path -Path $PSScriptRoot -ChildPath '..\tools\chocolateyInstall.ps1' -Resolve & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) $destinationDir = Join-Path -Path (Get-PowerShellModuleInstallPath) -ChildPath 'Carbon' $installCarbonJunction = $false $i...
combined_dataset/train/non-malicious/Send-SmtpMessage.ps1
Send-SmtpMessage.ps1
## Send-SmtpMessage -- a special implementation to show how to send via GMail ## GMail is a bit more complicated than most.... ################################################################################################### ## Examples: ## Send-SmtpMessage "receiver@gmail.com" "Hello there" "This is an important...
combined_dataset/train/non-malicious/sample_26_2.ps1
sample_26_2.ps1
# Localized 06/28/2023 07:58 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1 ConvertFrom-StringData @' ###PSLOC Troubleshoot_Title=Fejlfinding Troubleshoot_DetectDVDDevice=Kontrollerer dvd-enhed... Troubleshoot_DetectDVDvideoDecoder=Kontrollerer videodekoder til afspilning af dvd... Troubleshoot_DetectDVDAudioDe...
combined_dataset/train/non-malicious/sample_34_43.ps1
sample_34_43.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/470.ps1
470.ps1
param ( $ApiKey, $WorkingDirectory = $env:SYSTEM_DEFAULTWORKINGDIRECTORY ) Write-Host "Creating and populating publishing directory" $publishDir = New-Item -Path $WorkingDirectory -Name publish -ItemType Directory Copy-Item -Path "$($WorkingDirectory)\PSFramework" -Destination $publishDir.FullName -Recurse -Forc...
combined_dataset/train/non-malicious/Highlight-Syntax 2.0.ps1
Highlight-Syntax 2.0.ps1
#requires -version 2.0 # Highlight-Syntax.ps1 # version 2.0 # by Jeff Hillman # # this script uses the System.Management.Automation.PsParser class # to highlight PowerShell syntax with HTML. param( [string] $code, [switch] $LineNumbers ) if ( Test-Path $code -ErrorAction SilentlyContinue ) { $code =...
combined_dataset/train/non-malicious/sample_3_8.ps1
sample_3_8.ps1
# 2023-02-24 WalterE mod Trap #we# $startTime_AutoAdd = Get-Date trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" } Write-Host -Background...
combined_dataset/train/non-malicious/4153.ps1
4153.ps1
param ( [switch] $FullScan, [switch] $QuickScan, [switch] $Email, [string] $EmailRecipient = '', [string] $EmailSender = '', [string] $SMTPServer = '' ) Import-Module $env:ProgramFiles"\Microsoft Security Client\MpProvider\MpProvider.psd1" $RelativePath = (split-path $SCRIPT:MyInvocation.MyCommand.Path ...
combined_dataset/train/non-malicious/2463.ps1
2463.ps1
function Get-Weekday { [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidatePattern('sunday|monday|tuesday|wednesday|thursday|friday|saturday')] [string]$Weekday ) process { try { $Weekday = $Weekday.ToLower() $DesiredWeekDay = [regex]::Matches($Weekday, 'sunday|monday|tuesday|wednesday|th...
combined_dataset/train/non-malicious/sample_65_28.ps1
sample_65_28.ps1
# ---------------------------------------------------------------------------------- # 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 obtain a copy of the Licen...
combined_dataset/train/non-malicious/sample_48_57.ps1
sample_48_57.ps1
$path = (Get-Location).path $CurrentValue = [Environment]::GetEnvironmentVariable("PSModulePath", "Machine") If (-Not ($CurrentValue -Like "*$path*") ) { write "path is " + $path $NewValue = $CurrentValue + ";$path" [Environment]::SetEnvironmentVariable("PSModulePath", $NewValue, "Machine") } # SIG...
combined_dataset/train/non-malicious/3376.ps1
3376.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$False, Position=0)] [String]$Folder ) function SyncVersion([string]$FilePath) { $FolderPath = [System.IO.Path]::GetDirectoryName($FilePath) Write-Output "Folder Path: $FolderPath" $matches = ([regex]::matches((Get-Content $FilePath), "ModuleVersion = '([\d\....
combined_dataset/train/non-malicious/3454.ps1
3454.ps1
function Test-Trigger { $dfname = Get-DataFactoryName $rgname = Get-ResourceGroupName $rglocation = Get-ProviderLocation ResourceManagement $dflocation = Get-ProviderLocation DataFactoryManagement New-AzResourceGroup -Name $rgname -Location $rglocation -Force try { ...
combined_dataset/train/non-malicious/1203.ps1
1203.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) Describe 'Carbon.Shell.Command.Split' { It 'simple split' { $path,$args = [Carbon.Shell.Command]::Split('test.exe arg1 arg2') $expectedPath = 'test.exe' $expectedArgs = @('arg1', 'arg2') ...
combined_dataset/train/non-malicious/1708.ps1
1708.ps1
Function Update-ServiceNowNumber { [System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidUsingConvertToSecureStringWithPlainText','')] [System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidGlobalVars','')] [CmdletBinding(DefaultParameterSetName,SupportsShouldProcess=$true)] Param( ...
combined_dataset/train/non-malicious/ConvertFrom-Hashtable_2.ps1
ConvertFrom-Hashtable_2.ps1
# function ConvertFrom-Hashtable { PARAM([HashTable]$hashtable,[switch]$combine) BEGIN { $output = New-Object PSObject } PROCESS { if($_) { $hashtable = $_; if(!$combine) { $output = New-Object PSObject } } $hashtable.GetEnumerator() | ForEach-Object { Add-Member -inputObject $outpu...
combined_dataset/train/non-malicious/sample_60_58.ps1
sample_60_58.ps1
# # Module manifest for module 'OCI.PSModules.Databasetools' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasetools.dll' # Version number of this module. ModuleVersion = '85.2.0' # Supported PSEdi...
combined_dataset/train/non-malicious/1244.ps1
1244.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [string]$Prefix, [Switch]$Force ) Set-StrictMode -Version 'Latest' $carbonPsd1Path = Join-Path -Path $PSScriptRoot -ChildPath 'Carbon.psd1' -Resolve & { $originalVerbosePref = $Global:VerbosePreference $originalWhatIfPref =...
combined_dataset/train/non-malicious/sample_9_43.ps1
sample_9_43.ps1
# # # Rule to check TurnOffFetchThrottling registry key # # http://support.microsoft.com/kb/911510 # http://msdn.microsoft.com/en-us/library/aa682811.aspx # # Created: 05/24/2012 # Author: Jonathan Randall #****************************************************************************************************...
combined_dataset/train/non-malicious/451.ps1
451.ps1
Register-PSFConfigValidation -Name "bool" -ScriptBlock { Param ( $Value ) $Result = New-Object PSObject -Property @{ Success = $True Value = $null Message = "" } try { if ($Value.GetType().FullName -ne "System.Boolean") { $Result.Message = "Not a boolean: $Value" $Result.Success = $False ...
combined_dataset/train/non-malicious/sample_26_67.ps1
sample_26_67.ps1
########################################################################################## # <copyright file="Functions.ps1" company="Microsoft"> # Copyright (c) Microsoft Corporation. All rights reserved. # </copyright> # <summary>Functions.ps1 script.</summary> ##############################################...
combined_dataset/train/non-malicious/sample_54_81.ps1
sample_54_81.ps1
# Microsoft Windowsโ„ข์— ์„ค์น˜ Download the latest **Windows archive** from [QOwnNotes Releases on GitHub](https://github.com/pbek/QOwnNotes/releases) (look for a file called `QOwnNotes.zip`) and unzip it to anywhere you like. ์„ค์น˜ํ•  ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค! ::: ๊ฒฝ๊ณ  **์ž๋™ ์—…๋ฐ์ดํŠธ ํ”„๋กœ๊ทธ๋žจ**์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ์‚ฌ์šฉ์ž ๊ณ„์ •์— ์“ฐ๊ธฐ ๊ถŒํ•œ์ด ์žˆ๋Š” ์œ„์น˜๋กœ ์••์ถ•์„ ํ’‰๋‹ˆ๋‹ค. By default, your user...
combined_dataset/train/non-malicious/2847.ps1
2847.ps1
function GetCurrentConfigurationOrDefault() { if ($psake.context.count -gt 0) { return $psake.context.peek().config } else { return $psake.config_default } }
combined_dataset/train/non-malicious/sample_58_77.ps1
sample_58_77.ps1
# # Module manifest for module 'OCI.PSModules.Database' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Database.dll' # Version number of this module. ModuleVersion = '83.3.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_48_62.ps1
sample_48_62.ps1
# # Module manifest for module 'OCI.PSModules.Servicemesh' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemesh.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/2055.ps1
2055.ps1
Describe "New-ModuleManifest basic tests" -tags "CI" { BeforeAll { $moduleName = 'test' $modulePath = "$TestDrive/Modules/$moduleName" $manifestPath = Join-Path $modulePath "$moduleName.psd1" New-Item -Path "$TestDrive/Modules/$moduleName" -ItemType Directory } AfterEach...
combined_dataset/train/non-malicious/2747.ps1
2747.ps1
Get-NetRoute
combined_dataset/train/non-malicious/sample_13_98.ps1
sample_13_98.ps1
ConvertFrom-StringData @' id_ctstcpip=TCPIP id_ctstcpipdescription=Collects information about TCPIP. '@ # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlA...
combined_dataset/train/non-malicious/sample_32_73.ps1
sample_32_73.ps1
# # Module manifest for module 'OCI.PSModules.Certificates' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Certificates.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditi...
combined_dataset/train/non-malicious/sample_46_10.ps1
sample_46_10.ps1
# # Module manifest for module 'OCI.PSModules.Dataflow' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dataflow.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/2009.ps1
2009.ps1
. "$psscriptroot/TestRunner.ps1" $assemblyName = "Microsoft.PowerShell.CoreCLR.Eventing" $excludeList = @() Test-ResourceStrings -AssemblyName $AssemblyName -ExcludeList $excludeList
combined_dataset/train/non-malicious/USB Script backup_4.ps1
USB Script backup_4.ps1
<# .SYNOPSIS Backup-ToUSB.ps1 (Version 3.1, 19 Jan 2012) .DESCRIPTION This script will backup recently changed *.ps1,*.psm1,*.psd1 files from any selected folder (default is $pwd) to any number of inserted USB devices, on which an archive folder 'PSarchive' will be created if it does not already exist. Any ...
combined_dataset/train/non-malicious/3229.ps1
3229.ps1
properties { $projectRoot = $ENV:BHProjectPath if(-not $projectRoot) { $projectRoot = $PSScriptRoot } $sut = $env:BHModulePath $tests = "$projectRoot\Tests" $outputDir = Join-Path -Path $projectRoot -ChildPath 'out' $outputModDir = Join-Path -Path $outputDir -ChildPath $env:BHProjec...
combined_dataset/train/non-malicious/Get-DefragAnalysis_1.ps1
Get-DefragAnalysis_1.ps1
# defrag_analysis.ps1 # # Displays Defrag Analysis Info for a remote server. # # Author: tojo2000@tojo2000.com Set-PSDebug -Strict` trap [Exception] { continue } function GenerateForm { [reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null [reflection.assembly]::loadwithpartialname(...
combined_dataset/train/non-malicious/sample_11_90.ps1
sample_11_90.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 = '74.1.0' # Supported P...
combined_dataset/train/non-malicious/sample_15_29.ps1
sample_15_29.ps1
ConvertFrom-StringData @' id_ssas_collectssasregkeys=Analysis Services Registy Keys id_ssas_collectssasregkeysdesc=Collecting SQL Server Analysis Services registry keys '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYC...
combined_dataset/train/non-malicious/d1c44eb5-e148-4345-a712-661f0b8e3e08.ps1
d1c44eb5-e148-4345-a712-661f0b8e3e08.ps1
# # simple example using a hash to parse CAS Connect Logs # # after using the get-CASConnectLogEntries.ps1 to collect the log information # this script runs thru those files and counts Cached vs Classic # # # the directory where you keep these "cas connect logs" - change to fit your needs $Script:CasLogUNC...
combined_dataset/train/non-malicious/vmware guests subnet.ps1
vmware guests subnet.ps1
$snapins = "vmware.vimautomation.core" foreach ($snapin in $snapins){if (!(Get-PSSnapin $snapin -ErrorAction SilentlyContinue)){Add-PSSnapin $snapin}} $vserver = "vmware vCenter Server" $vNetwork = "General_Services" $logfile = "d:\\Scripts\\log\\vm.log" $subnet = "255.255.255.128" connect-viserver -Server $v...
combined_dataset/train/non-malicious/1971.ps1
1971.ps1
Describe "Format-Custom" -Tags "CI" { Context "Check Format-Custom aliases" { It "Should have the same output between the alias and the unaliased function" { $nonaliased = Get-FormatData | Format-Custom $aliased = Get-FormatData | fc $($nonaliased | Out-String).Com...
combined_dataset/train/non-malicious/2289.ps1
2289.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, ParameterSetName="AllObjectTypes", HelpMessage="Specify the features to delegate permissions for")] [parameter(Mandatory=$true, ParameterSetName="SpecificObjectTypes")] [ValidateNotNullOrEmpty()] [ValidateSet("PasswordWrite...
combined_dataset/train/non-malicious/sample_50_76.ps1
sample_50_76.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.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_4_89.ps1
sample_4_89.ps1
ConvertFrom-StringData @' id_dpm_information=DPM Information id_dpm_errorlogs_files=DPM Errorlog Files '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAF...
combined_dataset/train/non-malicious/sample_34_60.ps1
sample_34_60.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Get-AMTPowerState { <# .Synopsis Returns the system power state .Description This Cmdlet returns the system power state from clients that have Intel Active Management Technology(AMT) firmware version 3.2 or higher. .Note...
combined_dataset/train/non-malicious/sample_64_56.ps1
sample_64_56.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 = '84.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/SharePoint Site Owners.ps1
SharePoint Site Owners.ps1
Get-SPWebApplication | Get-SPSite -Limit ALL | ForEach-Object { $content = ""; $rootSite = New-Object Microsoft.SharePoint.SPSite($_.Url) $subSites = $rootSite.AllWebs; if($subSites.Count -le 0) { @@ This occurs when a Site Collection does not contains any subsite (not even the root s...
combined_dataset/train/non-malicious/1079.ps1
1079.ps1
$importCarbonPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon\Import-Carbon.ps1' -Resolve Describe 'Import-Carbon' { BeforeEach { $Global:Error.Clear() if( (Get-Module 'Carbon') ) { Remove-Module 'Carbon' -Force } } AfterEach { ...
combined_dataset/train/non-malicious/sample_35_45.ps1
sample_35_45.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.DataCollectionRule.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.DataCollectionRule.internal.psm1' if(Test-Path $internalM...
combined_dataset/train/non-malicious/sample_39_27.ps1
sample_39_27.ps1
# # Module manifest for module 'OCI.PSModules.Audit' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Audit.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/3509.ps1
3509.ps1
$global:resourceType = "Microsoft.IoTCentral/IotApps" function Test-IotCentralAppLifecycleManagement{ $rgname = Get-ResourceGroupName $rname = Get-ResourceName $subdomain = ($rname) + "subdomain" $location = Get-Location "Microsoft.IoTCentral" "IotApps" $sku = "S1" $displayName = "Custom Io...
combined_dataset/train/non-malicious/3288.ps1
3288.ps1
class DiscordConnection : Connection { [Net.WebSockets.ClientWebSocket]$WebSocket [pscustomobject]$GatewayInfo [string]$GatewayUrl [bool]$Connected [object]$ReceiveJob = $null DiscordConnection() { $this.WebSocket = [Net.WebSockets.ClientWebSocket]::new() $this.WebSocket.Option...
combined_dataset/train/non-malicious/2468.ps1
2468.ps1
[CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipeline)] [string[]]$AzureVM, [string]$ServiceName = 'ADBCLOUD', [switch]$Overwrite ) begin { Set-StrictMode -Version Latest try { $AzureModuleFilePath = "$($env:ProgramFiles)\Microsoft SDKs\Windows Azure\PowerShell\ServiceManagement\Azure\Azure.psd1...
combined_dataset/train/non-malicious/Script logging.ps1
Script logging.ps1
#region Log File Management $ScriptName = $MyInvocation.mycommand.name $LocalAppDir = "$(gc env:LOCALAPPDATA)\\PS_Data" $LogName = $ScriptName.replace(".ps1", ".log") $MaxLogFileSizeMB = 5 # After a log file reaches this size it will archive the existing and create a new one trap [Exception] { sendl "er...