full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/3814.ps1
3814.ps1
function Test-SingleNetworkInterface { $rgname = Get-ComputeTestResourceName try { $loc = Get-ComputeVMLocation; New-AzResourceGroup -Name $rgname -Location $loc -Force; $vmsize = 'Standard_A2'; $vmname = 'vm' + $rgname; ...
combined_dataset/train/non-malicious/3044.ps1
3044.ps1
function Should-BeTrue($ActualValue, [switch] $Negate, [string] $Because) { if ($Negate) { return Should-BeFalse -ActualValue $ActualValue -Negate:$false -Because $Because } if (-not $ActualValue) { $failureMessage = "Expected `$true,$(Format-Because $Because) but got $(Format-Nicely $...
combined_dataset/train/non-malicious/Roman Numeral Clock.ps1
Roman Numeral Clock.ps1
function RomanNumeral($Num,$Pos) { [array]$RomanFormat="9","0","00","000","01","1","10","100","1000","02" [array]$RomanColumns="I","V","X","X","L","C" $Format=$RomanFormat[$num] $NumberOfCharacters=$Format.Length If ( $Format -ne "9" ) { For ($Counter=0;$Counter -lt ($numberOfCharacters);$count...
combined_dataset/train/non-malicious/TabExpansion_6.ps1
TabExpansion_6.ps1
## Tab-Completion ################# ## Please dot souce this script file. ## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list. ## Some features(relate to '$_' expansion) require the latest Get-PipelineObject.ps1 in a same diretory. (from http://poshcode.org/author/foo...
combined_dataset/train/non-malicious/Invoke-ElevatedCommand.ps1
Invoke-ElevatedCommand.ps1
Function Invoke-ElevatedCommand { <# .DESCRIPTION Invokes the provided script block in a new elevated (Administrator) powershell process, while retaining access to the pipeline (pipe in and out). Please note, "Write-Host" output will be LOST - only the object pipeline and errors are handled. In genera...
combined_dataset/train/non-malicious/2707.ps1
2707.ps1
function Get-ObjDump { [CmdletBinding()] Param ( [Parameter(Position = 0, Mandatory = $True, ValueFromPipeline = $True)] [ValidateScript({ Test-Path $_ })] [String[]] $Path ) BEGIN { $Code = @' using System; using System.IO; using System...
combined_dataset/train/non-malicious/333.ps1
333.ps1
function Get-PSFPath { [CmdletBinding()] Param ( [Parameter(Mandatory = $true, Position = 0)] [string] $Name ) process { Get-PSFConfigValue -FullName "PSFramework.Path.$Name" } }
combined_dataset/train/non-malicious/sample_31_2.ps1
sample_31_2.ps1
# # Module manifest for module 'OCI.PSModules.Bds' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Bds.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_19_22.ps1
sample_19_22.ps1
ConvertFrom-StringData @' ###PSLOC ElevationModeInfo = Powershell running as Administrator. Continuing........ ElevationModeMsg = Running as administrator is required for this operation.Please restart PowerShell as Administrator and retry. ElevationModeErrMsg = This operation requires elevation. '@ # SIG # Begi...
combined_dataset/train/non-malicious/sample_62_64.ps1
sample_62_64.ps1
# # Module manifest for module 'OCI.PSModules.Vbsinst' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Vbsinst.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/sample_4_71.ps1
sample_4_71.ps1
# # Module manifest for module 'OCI.PSModules.Apigateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apigateway.dll' # Version number of this module. ModuleVersion = '93.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/chkhash_23.ps1
chkhash_23.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_17_19.ps1
sample_17_19.ps1
########################################################### # # 'GCArcService' module # ########################################################### $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest Import-Module "$PSScriptRoot\ServiceHelper.psm1" $script:GCInstallPath = "$PSScriptRoot\..\..\...
combined_dataset/train/non-malicious/sample_62_77.ps1
sample_62_77.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/1038.ps1
1038.ps1
[CmdletBinding()] param( ) @( 'http://msdn.microsoft.com/en-us/library/windows/desktop/bb530716.aspx', 'http://msdn.microsoft.com/en-us/library/windows/desktop/bb545671.aspx' ) | ForEach-Object { Invoke-WebRequest -Uri $_ } | Select-Object -ExpandProperty 'RawContent' | Select-String -AllMatche...
combined_dataset/train/non-malicious/sample_22_40.ps1
sample_22_40.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 = 'https://aka...
combined_dataset/train/non-malicious/PowerShell Talk Chickens_2.ps1
PowerShell Talk Chickens_2.ps1
#The PowerShell Talk #Virtualization Congress 2009 # #The Chicken Counter Script #Get our cretendials #More on credential stores: http://professionalvmware.com/2009/04/09/posh-article-of-the-week-secure-credential-storage/ $credentials = Get-VICredentialStoreItem -File "c:\\scripts\\really_secure_file.xml" ...
combined_dataset/train/non-malicious/sample_19_20.ps1
sample_19_20.ps1
ConvertFrom-StringData @' id_bpastarting=Starting Best Practices Analyzer id_bparunning=Running Best Practices Analyzer id_bpagenerating=Generating BPA Output '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8...
combined_dataset/train/non-malicious/Claimtypes, ADFS SP2010.ps1
Claimtypes, ADFS SP2010.ps1
Add-PSSnapin -Name Microsoft.SharePoint.PowerShell $claim = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" -IncomingClaimTypeDisplayName "EmailAddress" -SameAsIncoming $claim2 = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.microsoft.com/...
combined_dataset/train/non-malicious/1211.ps1
1211.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Get-ExpectedIPAddress { [Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces() | Where-Object { $_.OperationalStatus -eq 'Up' -and $_.NetworkInterfaceT...
combined_dataset/train/non-malicious/sample_5_13.ps1
sample_5_13.ps1
ConvertFrom-StringData @' id_ctsrpc=Remote Procedure Call (RPC) id_ctsrpcdescription=Collects information about Remote Procedure Call (RPC). '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # K...
combined_dataset/train/non-malicious/3209.ps1
3209.ps1
param( $Configuration = 'Release', [Parameter(Mandatory)] $OutFile ) $errorActionPreference = "Stop" $RepoRoot = (Resolve-Path "$PSScriptRoot/..").Path $ourAssembly = "$RepoRoot\PSReadLine\bin\$Configuration\Microsoft.PowerShell.PSReadLine2.dll" $t ='Microsoft.PowerShell.PSConsoleReadLine' -as [type] if...
combined_dataset/train/non-malicious/Tac (reverse cat)_1.ps1
Tac (reverse cat)_1.ps1
# From "Unix like command for tac?" thread on posh NG # solution by Keith Hill param([string]$path) $fs = New-Object System.IO.FileStream ((Resolve-Path $path), 'Open', 'Read') trap { $fs.Close(); break } $pos = $fs.Length $sb = New-Object System.Text.StringBuilder while (--$pos -ge 0) { [void]$fs.See...
combined_dataset/train/non-malicious/1382.ps1
1382.ps1
function Test-CZipFile { [OutputType([bool])] [CmdletBinding()] param( [Parameter(Mandatory=$true)] [Alias('FullName')] [string] $Path ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState...
combined_dataset/train/non-malicious/sample_43_14.ps1
sample_43_14.ps1
. ./Stop-Process2.ps1 notepad.exe notepad.exe notepad.exe Stop-Process2 -Name "notepad" # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA4mt...
combined_dataset/train/non-malicious/sample_32_45.ps1
sample_32_45.ps1
# # Module manifest for module 'OCI.PSModules.Email' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Email.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/ScriptSVN.ps1
ScriptSVN.ps1
# # Script from SVN Utility # ~~~~~~~~~~~~~~~~~~~~~~~ # This script processes template files and produces and output file. # Its a simple macro processor really. # We use it to extract the latest version of our database procedurrads and functions # from our source code control server to create deployment scripts....
combined_dataset/train/non-malicious/8b29c3c3-9f8f-4a19-83de-cdc6f2129025.ps1
8b29c3c3-9f8f-4a19-83de-cdc6f2129025.ps1
#========================================================================== # NAME: getunknownsids.ps1 # # AUTHOR: Stephen Wheet # Version: 4.0 # Date: 6/11/10 # # COMMENT: # This script was created to find unknown SIDs or old domain permissions # on folders. It ignores folders where inheirtance is turned ...
combined_dataset/train/non-malicious/2264.ps1
2264.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Specify a single or an array of either IP addresses, NetBIOS names or FQDNs")] [string[]]$Targets, [parameter(Mandatory=$true, HelpMessage="Specify a single or an array or ports to validate")] [string[]]$Ports, ...
combined_dataset/train/non-malicious/1247.ps1
1247.ps1
function Uninstall-CUser { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [ValidateLength(1,20)] [string] $Username ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext....
combined_dataset/train/non-malicious/sample_20_15.ps1
sample_20_15.ps1
#************************************************ # TS_SysvolNetLogonShareCheck.ps1 # Version 1.0.1 # Date: 03-29-2011 # Author: Your Name - Your Email Address # Description: SYSVOL and/or NETLOGON shares are missing on domain controller #************************************************ Import-LocalizedData -...
combined_dataset/train/non-malicious/sample_1_17.ps1
sample_1_17.ps1
ConvertFrom-StringData @' id_symantecipscheck=Symantec Intrusion Prevention System (IPS) id_symantecipscheckdesc=Checking if Symantec Intrusion Prevention System (IPS) is installed '@ # SIG # Begin signature block # MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEA...
combined_dataset/train/non-malicious/sample_36_12.ps1
sample_36_12.ps1
# make sure we stop on exceptions $ErrorActionPreference = "Stop" # This object reprents the result value for tab expansion functions when no result is returned. # This is so that we can distinguish it from $null, which has different semantics $NoResultValue = New-Object PSObject -Property @{ NoResult = $true } ...
combined_dataset/train/non-malicious/2015.ps1
2015.ps1
. "$psscriptroot/TestRunner.ps1" $assemblyName = "Microsoft.WSMan.Management" $excludeList = @() if ( $IsWindows ) { import-module Microsoft.WSMan.Management } Test-ResourceStrings -AssemblyName $AssemblyName -ExcludeList $excludeList
combined_dataset/train/non-malicious/sample_63_43.ps1
sample_63_43.ps1
# Import the helper functions Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [parameter(Mandatory = $true)] [System.String] $Category ) #Write-Verbose "Use this cmdlet t...
combined_dataset/train/non-malicious/sample_55_49.ps1
sample_55_49.ps1
. "$PSScriptRoot\..\project\api.ps1" . "$PSScriptRoot\..\checks\helpers.ps1" function Create-Release { param ( $Version, $EnvironmentName, $Workdir ) $project = (Get-Project-Definition) $ApplicationName = $project.product + '-' + $EnvironmentName $FromTag = $p...
combined_dataset/train/non-malicious/sample_50_64.ps1
sample_50_64.ps1
# # Module manifest for module 'Az.AnalysisServices' # # Generated by: Microsoft Corporation # # Generated on: 5/16/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.AnalysisServices.psm1' # Version number of this module. ModuleVersion = '1.1.5' # Suppor...
combined_dataset/train/non-malicious/sample_3_34.ps1
sample_3_34.ps1
ConvertFrom-StringData @' id_maxconcurrentapilite_st=MaxConcurrentApi Problems Detected id_mcalite_status=MaxConcurrentApi Problem Detection id_mcalite_wait=Performance counters are being examined for MaxConcurrentApi NTLM load issues. '@ # SIG # Begin signature block # MIIoVAYJKoZIhvcNAQcCoIIoRTCCKEECAQExDzANB...
combined_dataset/train/non-malicious/346.ps1
346.ps1
function Get-PSFConfigValue { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSPossibleIncorrectComparisonWithNull", "")] [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFConfigValue')] Param ( [Alias('Name')] [Parameter(Mandatory = $true)] [string] $FullName...
combined_dataset/train/non-malicious/3859.ps1
3859.ps1
function Test-ConvertLegacyKindExchangeAshburn { try { $peerAsn = makePeerAsn 11164; $name = getPeeringVariable "Name" "AS11164_Ashburn_Exchange" $rg = getPeeringVariable "ResourceGroupName" "Building40" $legacy = Get-AzLegacyPeering -Kind Exchange -PeeringLoca...
combined_dataset/train/non-malicious/sample_46_41.ps1
sample_46_41.ps1
# # Module manifest for module 'OCI.PSModules.Apigateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apigateway.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/3923.ps1
3923.ps1
function Test-ListInvoices { $billingInvoices = Get-AzBillingInvoice Assert-True {$billingInvoices.Count -ge 1} Assert-NotNull $billingInvoices[0].Name Assert-NotNull $billingInvoices[0].Id Assert-NotNull $billingInvoices[0].Type Assert-NotNull $billingInvoices[0].InvoicePeriodStartDate Ass...
combined_dataset/train/non-malicious/2739.ps1
2739.ps1
function Get-RegKeyValueNData { Param( [Parameter(Mandatory=$True,Position=0)] [String]$Path ) Push-Location Set-Location -Path "Registry::$Path" Get-Item -Force . | Select-Object -ExpandProperty Property | Foreach-Object { New-Object psobject -Property @{"property" = $_; ...
combined_dataset/train/non-malicious/1252.ps1
1252.ps1
function Remove-CGroupMember { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $Name, [Parameter(Mandatory=$true)] [string[]] [Alias('Members')] $Member ) Set-StrictMode -Version...
combined_dataset/train/non-malicious/Search Files by Date_1.ps1
Search Files by Date_1.ps1
<# Author: Matt Schmitt Date: 11/30/12 Version: 1.0 From: USA Email: ithink2020@gmail.com Website: http://about.me/schmittmatt Twitter: @MatthewASchmitt Description A script for finding files in a directory by Last Accessed Date. #> Write-Host "Enter Root Direc...
combined_dataset/train/non-malicious/sample_17_14.ps1
sample_17_14.ps1
ConvertFrom-StringData @' FailoverClustersModuleRequired=Nie znaleziono wymaganego modułu programu PowerShell (FailoverClusters). Użyj narzędzia Role i funkcje, aby zainstalować następujące oprogramowanie: Narzędzia administracji zdalnej serwera | Narzędzia do administrowania funkcjami | Narzędzia klastra trybu failov...
combined_dataset/train/non-malicious/Wrapper 1 Select-String .ps1
Wrapper 1 Select-String .ps1
[CmdletBinding()] param( [Parameter(ParameterSetName='Object', Mandatory=$true, ValueFromPipeline=$true)] [AllowEmptyString()] [AllowNull()] [System.Management.Automation.PSObject] ${InputObject}, [Parameter(Mandatory=$true, Position=0)] [System.String[]] ${Pattern}, [P...
combined_dataset/train/non-malicious/2344.ps1
2344.ps1
$remove_ous = $false $ous_to_keep = @('UAP - PEAP TLS','UAP - PEAP TLS Only','Disabled Users'); $ad_objects = Get-ADObject -Filter "ObjectClass -eq 'user' -or ObjectClass -eq 'computer' -or ObjectClass -eq 'group' -or ObjectClass -eq 'organizationalUnit'"; $aOuDns = @(); foreach ($o in $ad_objects) { $sDn = $o.Dist...
combined_dataset/train/non-malicious/ConvertFrom-Property.ps1
ConvertFrom-Property.ps1
<# .SYNOPSIS Converts data from flat or single-level property files into PSObjects .DESCRIPTION Converts delimited string data into objects .PARAMETER PropertyText The text to be parsed .PARAMETER Separator The value separator string used between name=value pairs. Allows regular expressions. Def...
combined_dataset/train/non-malicious/TabExpansion_13.ps1
TabExpansion_13.ps1
## Tab-Completion ################# ## Please dot souce this script file. ## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list. ## ## What this can do is: ## ## [datetime]::n<tab> ## [datetime]::now.d<tab> ## $a = New-Object "Int32[,]" 2,3; $b = "PowerShell","Pow...
combined_dataset/train/non-malicious/sample_19_83.ps1
sample_19_83.ps1
# # Module manifest for module 'OCI.PSModules.Jms' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Jms.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_25_2.ps1
sample_25_2.ps1
# # Module manifest for module 'OCI.PSModules.Fusionapps' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Fusionapps.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/Get-PSVersion.ps1
Get-PSVersion.ps1
Set-Alias Ver Get-PSVersion function Get-PSVersion { [string]$Major = ($PSVersionTable).PSVersion.Major [string]$Minor = ($PSVersionTable).PSVersion.Minor [string]$Out = $Major + '.' + $Minor Write-Output $Out }
combined_dataset/train/non-malicious/sample_27_29.ps1
sample_27_29.ps1
let resizeObserver; let observerAddRemove; export function FluentOverflowInitialize(dotNetHelper, id, isHorizontal, querySelector) { var localSelector = querySelector; if (!localSelector) { // cannot use :scope for node.matches() further down localSelector = ".fluent-overflow-item"; ...
combined_dataset/train/non-malicious/sample_31_72.ps1
sample_31_72.ps1
// Copyright (c) Microsoft Corporation. All rights reserved. "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function exitIfHostProcessNotRunning(processName, pid) { try { process.kill(pid, 0); } catch (error) { console.error('Unable to find parent process ' + processName + ':' + pi...
combined_dataset/train/non-malicious/Kill-Process.ps1
Kill-Process.ps1
function Kill-Process() { param( [string[]]$ComputerNames, [string[]]$ProcessNames, $User ) ########################################################################################################### if ($ProcessNames -eq $null) {Write-Error 'The parametre "ProcessNames" cannot be empty';break} ################...
combined_dataset/train/non-malicious/sample_28_84.ps1
sample_28_84.ps1
[CmdletBinding()] param ( [Parameter(Mandatory)] [string]$Owner, [Parameter(Mandatory)] [string]$RepoName, [Parameter()] [string]$Branch, [Parameter(Mandatory)] [string]$LocalPath, [Parameter()] [string]$Path, [Parameter()] [Validat...
combined_dataset/train/non-malicious/1050.ps1
1050.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldDetect64BitProcess { $expectedResult = ( $env:PROCESSOR_ARCHITECTURE -eq 'AMD64' ) Assert-Equal $expectedResult (Test-PowerShellIs64Bit) }
combined_dataset/train/non-malicious/sample_43_54.ps1
sample_43_54.ps1
/////////////////////////////////////////////////////////////////////////////// // Helper to set a designer prop /////////////////////////////////////////////////////////////////////////////// function setDesignerProp(tname, ttype, tvalue) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)...
combined_dataset/train/non-malicious/sample_5_50.ps1
sample_5_50.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/sample_40_13.ps1
sample_40_13.ps1
# Copyright (c) Microsoft Corporation. # # This script will # 1. Examine Azcmagent configuration # 2. Check if automatic upgrade is enabled # 3. Check if desired version is greater than existing agent version # 4. Check if automatic upgrade has already been attempted before # 5. Get the download l...
combined_dataset/train/non-malicious/Invoke-CmdScript.ps1
Invoke-CmdScript.ps1
##############################################################################\n##\n## Invoke-CmdScript\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nInvoke ...
combined_dataset/train/non-malicious/sample_63_32.ps1
sample_63_32.ps1
# # Module manifest for module 'OCI.PSModules.Usageapi' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Usageapi.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/2178.ps1
2178.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true,ParameterSetName="Single")] [parameter(ParameterSetName="Recurse")] [string]$SiteServer, [parameter(Mandatory=$false,ParameterSetName="Single")] $ApplicationName, [parameter(Mandatory=$true,ParameterSetName="Single")] [parameter(ParameterSet...
combined_dataset/train/non-malicious/sample_11_51.ps1
sample_11_51.ps1
ConvertFrom-StringData @' id_fileacl=Determining file ACL's '@ # SIG # Begin signature block # MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA6VsPfmmzM00am # qvD0ITk80rX9ws5...
combined_dataset/train/non-malicious/sample_15_58.ps1
sample_15_58.ps1
######################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # Localized PSGet.Resource.psd1 # ######################################################################################### ConvertFrom-StringData @' ###PSL...
combined_dataset/train/non-malicious/3221.ps1
3221.ps1
describe 'Get-PoshBotConfiguration' { BeforeAll { $PSDefaultParameterValues = @{ 'Get-PoshBotConfiguration:Verbose' = $false } } it 'Gets a configuration from path' { $psd1 = Get-Item -Path (Join-Path -Path $PSScriptRoot -ChildPath '..\..\Artifacts\Cherry2000.psd1') ...
combined_dataset/train/non-malicious/Get-Hostname_3.ps1
Get-Hostname_3.ps1
# .SYNOPSIS # Print the hostname of the system. # .DESCRIPTION # This function prints the hostname of the system. You can additionally output the DNS # domain or the FQDN by using the parameters as described below. # .PARAMETER Short # (Default) Print only the computername, i.e. the same value as returned by $env...
combined_dataset/train/non-malicious/sample_13_78.ps1
sample_13_78.ps1
ConvertFrom-StringData @' id_remotedesktoplserverkb2512845_sd=The version of Terminal Services Licensing installed on this computer is incompatible with Windows Server 2008 (or newer) Remote Desktop Services '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgE...
combined_dataset/train/non-malicious/sample_45_90.ps1
sample_45_90.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/sample_54_45.ps1
sample_54_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/1508.ps1
1508.ps1
function Assert-NoError { [CmdletBinding()] param( [Parameter(Position=0)] [string] $Message ) Set-StrictMode -Version 'Latest' if( $Global:Error.Count -gt 0 ) { $errors = $Global:Error | ForEach-Object { $_; if( (Get-Member 'ScriptSt...
combined_dataset/train/non-malicious/POC-adding custom PS job.ps1
POC-adding custom PS job.ps1
#this is just a quite proof of concept, totally useless in of itself, with functions not fleshed out function get-jobrepository { [CmdletBinding()] param() $pscmdlet.JobRepository } function add-job { [CmdletBinding()] param($job) $pscmdlet.JobRepository.add($job) } $src = @" using System; using Sy...
combined_dataset/train/non-malicious/sample_2_81.ps1
sample_2_81.ps1
# # Module manifest for module 'OCI.PSModules.Networkfirewall' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Networkfirewall.dll' # Version number of this module. ModuleVersion = '93.0.0' # Supported P...
combined_dataset/train/non-malicious/sample_40_10.ps1
sample_40_10.ps1
##------------------------------------------------------------------ ## <copyright file="Update-Extension.ps1" company="Microsoft"> ## Copyright (C) Microsoft. All rights reserved. ## </copyright> ##------------------------------------------------------------------ $ErrorActionPreference = "Stop" $function...
combined_dataset/train/non-malicious/1288.ps1
1288.ps1
function Set-CIisWebsiteSslCertificate { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $SiteName, [Parameter(Mandatory=$true)] [string] $Thumbprint, [Parameter(Mandatory=$true)] ...
combined_dataset/train/non-malicious/588.ps1
588.ps1
function Connect-VSphere{ param ( [parameter(Mandatory=$true)] [string[]]$Name ) if((Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue) -eq $Null){Add-PSSnapin VMware.VimAutomation.Core} if((Get-PSSnapin VMware.VimAutomation.Vds -ErrorAction Silently...
combined_dataset/train/non-malicious/4404.ps1
4404.ps1
function Get-InstalledScriptFilePath { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter()] [string] $Name ) $installedScriptFilePaths = @() $scriptFilePaths = Get-AvailableScriptFilePath @PSBoundParameters foreach ($scriptFilePath in $scriptFilePaths) ...
combined_dataset/train/non-malicious/sample_63_87.ps1
sample_63_87.ps1
# # Module manifest for module 'OCI.PSModules.Jms' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Jms.dll' # Version number of this module. ModuleVersion = '89.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/1930.ps1
1930.ps1
Describe "Event Subscriber Tests" -tags "CI" { BeforeEach { Get-EventSubscriber | Unregister-Event } AfterEach { Get-EventSubscriber | Unregister-Event } It "Register an event with no action, trigger it and wait for it to be raised." -Pending:$true{ Get-EventSubscribe...
combined_dataset/train/non-malicious/734.ps1
734.ps1
function Export-RsSubscriptionXml { [cmdletbinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')] param( [Parameter(Mandatory=$True,Position=0)] [string] $Path, [Parameter(Mandatory = $True, ValueFromPipeline=$true)] [object] $Subscrip...
combined_dataset/train/non-malicious/Demo-Confirm.ps1
Demo-Confirm.ps1
### NOTE: the <#PS ... #> is the prompt! <#PS [40] #> $ConfirmPreference High <#PS [41] #> function get-confirmed { [CmdletBinding(SupportsShouldProcess=$true)]param() $ConfirmPreference } <#PS [42] #> get-confirmed High <#PS [43] #> get-confirmed -confirm Low <#PS [44] #> get-confirmed -confi...
combined_dataset/train/non-malicious/Get-PerformanceHistory _2.ps1
Get-PerformanceHistory _2.ps1
##requires -version 2.0 ## Get-PerformanceHistory.ps1 ############################################################################################################## ## Lets you see the amount of time recent commands in your history have taken ## History: ## v2.53 - added back the Lines, Words, and Characters .... ...
combined_dataset/train/non-malicious/sample_66_18.ps1
sample_66_18.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux builds of Node # are installed in the same directory $exe=".exe" } $ret=0 if (Test-Path "$basedir/node$exe") { # Suppor...
combined_dataset/train/non-malicious/sample_42_82.ps1
sample_42_82.ps1
ijSTF2QMV0d+rdP3fk8k53GOxHYba+0n/svCuKxy0FFJBbPCaWYUMVPTDp/0q/Sq/tNl48Gkt5p/4y47Z98SoBhm1ROfFQv/LumOewCOjwhSXZ8+ocfZLwlT8zJHg1cdLkMqP799KnYFoN4QLmjUHqVDUwq4CmmophV8wyG8vmcK4OsOvcmNiEzkrerlRuaXvpJ25KAGafpznKr9Q37RQF8gFH5d0Cynfu5QaMUMLnwDXPlolBOAyWYgp8i35x945M13RRZouh5t7/mS87WtnPFRoXuybMGiXNg2IYmmIGjix+bMlq2vivMLzbBS2VMV...
combined_dataset/train/non-malicious/ListCmdletParameters.ps1
ListCmdletParameters.ps1
# To use # Save script as LISTPARAMETERS.PS1 # # To get the parameters from a Powershell cmdlet just execute # # ./LISTPARAMETERS.PS1 -helpdata (GET-HELP GET-CHILDITEM) # # To list in a clean column, all of the parameters for GET-CHILDITEM # # ./LISTPARAMETERS.PS1 -helpdata (GET-HELP SET-QADUSER) # # To li...
combined_dataset/train/non-malicious/new get-childitem.ps1
new get-childitem.ps1
Function Get-ChildItem { <# .ForwardHelpTargetName Get-ChildItem .ForwardHelpCategory Cmdlet #> [CmdletBinding(DefaultParameterSetName='Items', SupportsTransactions=$true)] param( [Parameter(ParameterSetName='Items', Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [Sys...
combined_dataset/train/non-malicious/Replace-InTextFile.ps1
Replace-InTextFile.ps1
# Replace-InTextFile.ps1 # Replace Strings in files param ( [string] $Path = "." , [string] $Filter # Select no files, by default.... , [string] $pattern = $(Read-Host "Please enter a pattern to match") , [string] $replace = $(Read-Host "Please enter a replacement string") ...
combined_dataset/train/non-malicious/sample_55_20.ps1
sample_55_20.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.EventHub.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Module]::Instance # Export nothing to clear implicit exports ...
combined_dataset/train/non-malicious/sample_40_62.ps1
sample_40_62.ps1
# # Module manifest for module 'OCI.PSModules.Threatintelligence' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Threatintelligence.dll' # Version number of this module. ModuleVersion = '80.0.0' # Suppo...
combined_dataset/train/non-malicious/sample_8_1.ps1
sample_8_1.ps1
ConvertFrom-StringData @' id_printdevmodes2countcheck_st=There are several printers listed under HKU\\.DEFAULT\\Printers\\DevModes2 '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAA...
combined_dataset/train/non-malicious/3486.ps1
3486.ps1
function Test-MonitoringRelatedCommands{ try { $location = "West US 2" $cluster = Create-Cluster -Location $location $workspaceName = Generate-Name("workspace-ps-test") $resourceGroupName = $cluster.ResourceGroup $sku = "pernode" $workspace = New-AzOperationalInsightsWorkspace -L...
combined_dataset/train/non-malicious/909.ps1
909.ps1
$subscriptionId = 'yourSubscriptionId' $resourceGroupName ='yourResourceGroupName' $snapshotName = 'yourSnapshotName' $storageType = 'StandardLRS' $location = 'westus' $sourceVHDURI = 'https://yourStorageAccountName.blob.core.windows.net/vhds/yourVHDName.vhd' $storageAccountId = '/subscriptions/your...
combined_dataset/train/non-malicious/sample_7_68.ps1
sample_7_68.ps1
[dynamic, provider("dcismprovider"), Description( "DCIM_LifecycleJobAlertIndication is a derivation of " "CIM_ProcessIndication.")] class DCIM_LifecycleJobAlertIndication : CIM_AlertIndication { [ Description ("The time at which indication is generated") ] datetime Ind...
combined_dataset/train/non-malicious/sample_66_27.ps1
sample_66_27.ps1
# # Module manifest for module 'OCI.PSModules.Lockbox' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Lockbox.dll' # Version number of this module. ModuleVersion = '85.1.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/2981.ps1
2981.ps1
function Describe { param( [Parameter(Mandatory = $true, Position = 0)] [string] $Name, [Alias('Tags')] [string[]] $Tag = @(), [Parameter(Position = 1)] [ValidateNotNull()] [ScriptBlock] $Fixture ) if ($Fixture -eq $null) { if ($Name.Co...
combined_dataset/train/non-malicious/sample_67_49.ps1
sample_67_49.ps1
# # Module manifest for module 'OCI.PSModules.Common' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Common.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/sample_12_62.ps1
sample_12_62.ps1
# # Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker' # # Generated by: Microsoft Corporation # # Generated on: 19/01/2022 # @{ # Script module or binary module file associated with this manifest. RootModule = '' # Version number of this module. ModuleVersion = '1.2100.25...
combined_dataset/train/non-malicious/Findup_18.ps1
Findup_18.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; using System.Text.RegularExpressions; namespace Findup { public class FileLengthComparer : I...
combined_dataset/train/non-malicious/sample_54_59.ps1
sample_54_59.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 = @(...