full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_38_62.ps1
sample_38_62.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/2363.ps1
2363.ps1
function Get-ClientsUnderNoSite { [CmdletBinding()] param () try { $dcs = ((Get-ADForest).Domains | foreach { (Get-ADDomainController -Server $_ -Filter *) }).HostName foreach ($d in $dcs) { $output = @{'DomainController' = $d} $clients = Select-String -Pattern 'NO_CLIENT_SITE: (.*) \d' -Path "\\$d\...
combined_dataset/train/non-malicious/ScriptTransforms module_2.ps1
ScriptTransforms module_2.ps1
function New-ParameterTransform { #.Synopsis # Generates Parameter Transformation Attributes in simple PowerShell syntax #.Description # New-ParameterTransform allows the creation of .Net Attribute classes which can be applied to PowerShell parameters to transform or manipulate data as it's being passed in. #.Exam...
combined_dataset/train/non-malicious/1776.ps1
1776.ps1
Describe "Get-Credential Test" -tag "CI" { BeforeAll { $th = New-TestHost $th.UI.StringForSecureString = "This is a test" $th.UI.UserNameForCredential = "John" $rs = [runspacefactory]::Createrunspace($th) $rs.open() $ps = [powershell]::Create() $ps.Runspace ...
combined_dataset/train/non-malicious/sample_40_12.ps1
sample_40_12.ps1
# # Module manifest for module 'OCI.PSModules.Aivision' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aivision.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_17_0.ps1
sample_17_0.ps1
parameters: configuration: 'Debug' # Optional: condition for the job to run condition: '' # Optional: 'true' if future jobs should run even if this job fails continueOnError: false # Optional: dependencies of the job dependsOn: '' # Optional: Include PublishBuildArtifacts task enablePublishBuildAr...
combined_dataset/train/non-malicious/3679.ps1
3679.ps1
$samplePrivateBlobNoPassword = "MIIJ+QIBAzCCCbUGCSqGSIb3DQEHAaCCCaYEggmiMIIJnjCCBhcGCSqGSIb3DQEHAaCCBggEggYEMIIGADCCBfwGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAgUeBd7F2KZUwICB9AEggTYSRi88/Xf0EZ9smyYDCr+jHa7a/510s19/5wjqGbLTT/CYBu2qSOhj+g9sNvjj5oWAcluaZ4XCl/oJhXlB+9q9ZYSC6pPhma7/Il+/zlZm8ZUMfg...
combined_dataset/train/non-malicious/HTML Hardware Reports wi.ps1
HTML Hardware Reports wi.ps1
Function Get-HardwareReport { [CmdletBinding()] Param ( [parameter(Mandatory=$true, ValueFromPipeline=$true)] [String[]]$devices ) Begin {Write-Host " Starting Hardware Reports"} Process { foreach ($device in $devices) { $name=$device $filepath="$home\\$name.html" $PingDevice=Test-Connection $name -count 1 -...
combined_dataset/train/non-malicious/sample_2_33.ps1
sample_2_33.ps1
PARAM($Format="html") Import-LocalizedData -BindingVariable AutoRunsString Write-DiagProgress -Activity $AutoRunsString.ID_AutoRuns -Status $AutoRunsString.ID_AutoRunsObtaining $OutputFile = $ComputerName + "_Autoruns.*" $CommandLineToExecute = "cscript.exe Autoruns.VBS /format:$format" RunCmD -commandToR...
combined_dataset/train/non-malicious/sample_49_51.ps1
sample_49_51.ps1
@{ RootModule = 'PSReadLine.psm1' NestedModules = @("Microsoft.PowerShell.PSReadLine2.dll") ModuleVersion = '2.1.0' GUID = '5714753b-2afd-4492-a5fd-01d9e2cff8b5' Author = 'Microsoft Corporation' CompanyName = 'Microsoft Corporation' Copyright = '(c) Microsoft Corporation. All rights reserved.' Description = 'Gr...
combined_dataset/train/non-malicious/Remove-DownloadFlag.ps1
Remove-DownloadFlag.ps1
function Set-DownloadFlag { <# .Synopsis Sets the ZoneTransfer flag which marks a file as being downloaded from the internet. .Description Creates a Zone.Identifier alternate data stream (on NTFS file systems) and writes the ZoneTransfer marker .Parameter Path The file you wish to block .Parameter Passthru ...
combined_dataset/train/non-malicious/JSON_1.ps1
JSON_1.ps1
#requires -version 2.0 # Version History: # v 0.5 - First Public version # v 1.0 - Made ConvertFrom-Json work with arbitrary JSON # - switched to xsl style sheets for ConvertTo-JSON # There is no help (yet) because I'm still changing and renaming everything every time I mess with this code # Full Round...
combined_dataset/train/non-malicious/sample_14_94.ps1
sample_14_94.ps1
@(echo off) > $null if #ftw NEQ '' goto :init ($true){ $Error.clear(); } # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # wrapper script for vcpkg # this is intended to be dot-sourced and then you can use the vcpkg() function # Workaround for $IsWindows not existing in Windows PowerShell if...
combined_dataset/train/non-malicious/3717.ps1
3717.ps1
function Get-ResourceGroupName { return getAssetName } function Get-ResourceName { return getAssetName } function Get-VirtualNetworkName { return getAssetName } function Get-ProviderLocation($provider) { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure....
combined_dataset/train/non-malicious/3120.ps1
3120.ps1
function Update-StringInFile { [CmdletBinding(SupportsShouldProcess=$true)] Param( [Parameter( Position=0, HelpMessage="Folder where the files are stored (will search recursive)")] [ValidateScript({ if(Test-Path -Path $_) { return $true } else { throw "Enter a valid path!" ...
combined_dataset/train/non-malicious/4106.ps1
4106.ps1
function Get-MetaData { [CmdletBinding()][OutputType([object])] param ( [ValidateNotNullOrEmpty()][string]$FileName ) $MetaDataObject = New-Object System.Object $shell = New-Object -COMObject Shell.Application $folder = Split-Path $FileName $file = Split-Path $FileName -Leaf $shellfolder = $shell.Nam...
combined_dataset/train/non-malicious/2029.ps1
2029.ps1
using namespace System.Management.Automation.Language Describe "StaticParameterBinder tests" -Tags "CI" { BeforeAll { $testCases = @( @{ Source = 'Get-Alias abc' Description = 'string constant value' BoundParametersCount = 1 Exce...
combined_dataset/train/non-malicious/List Object Discoveries_1.ps1
List Object Discoveries_1.ps1
# Enumerate OpsMgr 2007 Object Discoveries targeted to Windows Server # Date: 20/10/2008 # Author: Stefan Stranger (help from Jeremy Pavleck and Marco Shaw) # Author: Cory Delamarter (increased speed) get-discovery | ? {$_.Target -match $(get-monitoringclass -Name "Microsoft.Windows.Server.Computer").Id} | ft Name,...
combined_dataset/train/non-malicious/sample_43_76.ps1
sample_43_76.ps1
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. #Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may n...
combined_dataset/train/non-malicious/sample_48_67.ps1
sample_48_67.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. function ParseInterval { $args[0] = $args[0].Substring(1) $DatePart = $args[0].Split("T")[0] $TimePart = $args[0].Split("T")[1] $YearPart = "0" $MonthPart = "0" $DayPart = "0" $HourPart = "0" $MinPart = "0" $SecPart ...
combined_dataset/train/non-malicious/sample_27_26.ps1
sample_27_26.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_36_57.ps1
sample_36_57.ps1
## Copyright (c) Microsoft Corporation. All rights reserved. <# .SYNOPSIS This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. .DESCRIPTION This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. These performance recordings contain Microsoft-Antimal...
combined_dataset/train/non-malicious/sample_15_69.ps1
sample_15_69.ps1
Import-LocalizedData -BindingVariable lvsTxt -FileName AzStackHci.Observability.Strings.psd1 function Test-ObservabilityVolume { <# .SYNOPSIS Check volume free space meets the required observability threshold size .DESCRIPTION Check volume free space meets the required observability th...
combined_dataset/train/non-malicious/Get-NistNtpServer_1.ps1
Get-NistNtpServer_1.ps1
function Get-NistNtpServer { <# .SYNOPSIS Gets the list NIST NTP servers. .DESCRIPTION The Get-NistNtpServer function retrieves the list of NIST NTP server names, IP addresses, locations, and status. .EXAMPLE Get-NistNtpServer Returns the list of NIST NTP servers. .INPUTS None .OUTPUTS...
combined_dataset/train/non-malicious/947.ps1
947.ps1
$uniqueId=$(-join ((97..122) + (48..57) | Get-Random -Count 10 | % {[char]$_})) $apiVersion = "2015-04-08" $location = "West US 2" $resourceGroupName = "myResourceGroup" $accountName = "mycosmosaccount-$uniqueId" $accountResourceType = "Microsoft.DocumentDb/databaseAccounts" $locations = @( @{ "locationName"=...
combined_dataset/train/non-malicious/sample_13_31.ps1
sample_13_31.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/sample_58_9.ps1
sample_58_9.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/Deploy Multiple VMs v1.1.ps1
Deploy Multiple VMs v1.1.ps1
############################################################# # Deploy-VM.ps1 v1.1 # David Summers 2011/8/2 # Script to deploy VM(s) from Template(s) and set appropriate # IP config for Windows VMs. Also sets # of CPUs, MemoryMB, # port group, and several custom attributes. # Moves deployed VM to specific VMs/Te...
combined_dataset/train/non-malicious/sample_22_83.ps1
sample_22_83.ps1
# # Script module for module 'PackageManagement' # Set-StrictMode -Version Latest Microsoft.PowerShell.Utility\Import-LocalizedData LocalizedData -filename PackageManagement.Resources.psd1 # Summary: PackageManagement is supported on Windows PowerShell 3.0 or later, Nano Server and PowerShellCore $isCore = ($P...
combined_dataset/train/non-malicious/sample_31_26.ps1
sample_31_26.ps1
# # Module manifest for module 'OCI.PSModules.Loadbalancer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loadbalancer.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/UIAutomation V1.ps1
UIAutomation V1.ps1
Add-Type -AssemblyName UIAutomationClient Add-Type -AssemblyName UIAutomationTypes ############################################################################################################## ## REQUIRES -Module Accelerators -URI http://www.poshcode.org/762 Import-Module Accelerators $SWA = "System.Windows.Aut...
combined_dataset/train/non-malicious/1639.ps1
1639.ps1
Function Get-FailingDrive { [cmdletbinding()] Param ( [parameter(ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] [string[]]$Computername, [parameter()] [System.Management.Automation.PSCredential]$Credential ) Begin { $queryhash = @{} $BadD...
combined_dataset/train/non-malicious/sample_21_3.ps1
sample_21_3.ps1
#************************************************ # TS_2628581_HPUPDUpgrade.ps1 # Version 1.0.1 # TemplateVersion 1.2 # Date: 04/17/2012 08:02:35 # Author: jasonf # Description: Checks the registry for an HP UPD upgrade from 5.2 to 5.3 which is known to cause issues #********************************************...
combined_dataset/train/non-malicious/407.ps1
407.ps1
$commonParam = @{ HelpFile = (Resolve-Path "$($script:ModuleRoot)\en-us\PSFramework.dll-Help.xml") Module = $ExecutionContext.SessionState.Module } Import-PSFCmdlet @commonParam -Name ConvertTo-PSFHashtable -Type ([PSFramework.Commands.ConvertToPSFHashtableCommand]) Import-PSFCmdlet @commonParam -Name Invoke-PSFCa...
combined_dataset/train/non-malicious/3214.ps1
3214.ps1
$moduleName = $env:BHProjectName $manifest = Import-PowerShellDataFile -Path $env:BHPSModuleManifest $outputDir = Join-Path -Path $ENV:BHProjectPath -ChildPath 'out' $outputModDir = Join-Path -Path $outputDir -ChildPath $env:BHProjectName $outputModVerDir = Join-Path -Path $outputModDir -ChildPath $manifest.ModuleVers...
combined_dataset/train/non-malicious/sample_1_4.ps1
sample_1_4.ps1
ConvertFrom-StringData @' id_surfacepro3detectconnectedstandbystatus=Detect Surface Pro 3 Connected Standby Status Issue id_surfacepro3detectconnectedstandbystatusdesc=Detected Surface Pro 3 Connected Standby Status Issue '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEF...
combined_dataset/train/non-malicious/1747.ps1
1747.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()] [string] $Path = $PSScriptRoot, [switch] $Unregister ) Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' function Start-NativeExecution([scriptblock]$sb, [switch]$IgnoreExitcode) { $backupEAP = $script:ErrorActionPreference $scr...
combined_dataset/train/non-malicious/2280.ps1
2280.ps1
[CmdLetBinding()] param( [parameter(Mandatory=$true, HelpMessage="Name of the Site server with the SMS Provider")] [ValidateNotNullOrEmpty()] [string]$SiteServer, [parameter(Mandatory=$true, HelpMessage="Name of the device that will be checked for warranty")] [ValidateNotNullOrEmpty()] [string]$...
combined_dataset/train/non-malicious/Get-WebFile _2.1.ps1
Get-WebFile _2.1.ps1
## Get-WebFile.ps1 (aka wget for PowerShell) ############################################################################################################## ## Downloads a file or page from the web ## History: ## v3.1 - Unwrap the filename when it has quotes around it ## v3 - rewritten completely using HttpWebReq...
combined_dataset/train/non-malicious/Suspend-Process.ps1
Suspend-Process.ps1
Add-Type -Name Threader -Namespace "" -Member @" [Flags] public enum ThreadAccess : int { Terminate = (0x0001), SuspendResume = (0x0002), GetContext = (0x0008), SetContext = (0x0010), SetInformation = (0x0020), GetInformation = (0x0040), SetThreadToken = (0x0...
combined_dataset/train/non-malicious/ESXi Config Backup Scrip.ps1
ESXi Config Backup Scrip.ps1
###ESXi Configuration Backup Script #DESCRIPION: This Script takes a CSV file with the hostname, username, and password of a list of ESXi servers, and backs up their configurations to a specified Destination #USAGE: This script is meant to be run as a regular scheduled task or a pre-script for a backup job. There is ...
combined_dataset/train/non-malicious/sample_9_67.ps1
sample_9_67.ps1
#************************************************ # TS_SurfacePro3DetectFirmwareVersions.ps1 # Version 1.0.09.19.14: Created and tested SurfacePro3 scripts from Sep12-19 # Date: 2014 # Author: bbenson # Description: SurfacePro3DetectFirmwareVersions # # Rule GUID: 34F6567E-7B92-4C37-B1CA-5DE6E66D4881 # # Files...
combined_dataset/train/non-malicious/1063.ps1
1063.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldConvertToBase64 { $expectedValue = 'YAAxADIAMwA0ADUANgA3ADgAOQAwAC0APQBxAHcAZQByAHQAeQB1AGkAbwBwAFsAXQBcAGEAcwBkAGYAZwBoAGoAawBsADsAJwB6AHgAYwB2AGIAbgBtACwALgAvACA...
combined_dataset/train/non-malicious/sample_55_52.ps1
sample_55_52.ps1
@{ GUID="766204A6-330E-4263-A7AB-46C87AFC366C" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManC...
combined_dataset/train/non-malicious/4209.ps1
4209.ps1
function New-InMemoryModule { [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] [CmdletBinding()] Param ( [Parameter(Position = 0)] [ValidateNotNullOrEmpty()] [String] $ModuleName = [Guid]::NewGuid().ToString...
combined_dataset/train/non-malicious/sample_28_47.ps1
sample_28_47.ps1
# # Module manifest for module 'OCI.PSModules.Visualbuilder' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Visualbuilder.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_47_97.ps1
sample_47_97.ps1
# # Module manifest for module 'ExtensionService' # # Generated by: Microsoft # # Generated on: 04/09/2020 # @{ # Script module or binary module file associated with this manifest. ModuleToProcess = 'ExtensionService.psm1' # Version number of this module. ModuleVersion = '1.0' # ID used to uniquely ...
combined_dataset/train/non-malicious/sample_51_25.ps1
sample_51_25.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# PowerShell Diagnostics Module This module contains a set of wrapper scripts that enable a user to use ETW tracing in Windows PowerShell. #> $script:Logman="$env:windir\system32\logman.exe" $script:wsmanlogfile = "$env:wind...
combined_dataset/train/non-malicious/ESXiMgmt module sample _1.ps1
ESXiMgmt module sample _1.ps1
####################################################################################################################### # File: ESXiMgmt_machines_poweroff_sample.ps1 # # Author: Alexander Petrovskiy ...
combined_dataset/train/non-malicious/sample_49_84.ps1
sample_49_84.ps1
# # Module manifest for module 'OCI.PSModules.Events' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Events.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/sample_19_86.ps1
sample_19_86.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_27_52.ps1
sample_27_52.ps1
# # Module manifest for module 'OCI.PSModules.Autoscaling' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Autoscaling.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/1995.ps1
1995.ps1
Describe "TabCompletion" -Tags CI { BeforeAll { $separator = [System.IO.Path]::DirectorySeparatorChar } It 'Should complete Command' { $res = TabExpansion2 -inputScript 'Get-Com' -cursorColumn 'Get-Com'.Length $res.CompletionMatches[0].CompletionText | Should -BeExactly 'Get-Comma...
combined_dataset/train/non-malicious/sample_34_56.ps1
sample_34_56.ps1
// workaround for https://github.com/microsoft/fast/issues/5675 export function updateProxy(id) { if (!id) { return; } const element = document.getElementById(id); if (element && element.form) { if (element.form.id !== '') { element.proxy.setAttribute("form", elemen...
combined_dataset/train/non-malicious/sample_47_29.ps1
sample_47_29.ps1
Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,06836DC2794B1725 7jb9KmEbTz6f9Rml5H8XH3LtwowJdNaQ5jJmtmCsOPGA5F17QXqRbmkcmNGYVTuT KhM9CJLw+dT6Y9cpJj3Z9+Ze9OG7m3Ti82TOmzHeLKLzlz4KBUV0u896VhxiImvw JMXP+7MOqD/j4oz4U32HBeK7R1AoG/PlREzdZOzYcKEmZ/m/PvIInCHHzxm97rYn 2q78PQLZVXqaFdp+Xkeli4MzjnyZ9fYN2o2EdoxwGdNgOJ0ZXdScAPLH5x3dc...
combined_dataset/train/non-malicious/4411.ps1
4411.ps1
if (-not (Microsoft.PowerShell.Management\Test-Path -Path $script:ProgramFilesInstalledScriptInfosPath) -and (Test-RunningAsElevated)) { $ev = $null $null = Microsoft.PowerShell.Management\New-Item -Path $script:ProgramFilesInstalledScriptInfosPath ` -ItemType Directory ` -Force ` -Erro...
combined_dataset/train/non-malicious/7c573254-14a1-4559-9c68-e51bc0f502b2.ps1
7c573254-14a1-4559-9c68-e51bc0f502b2.ps1
[/HTML) [Http://]
combined_dataset/train/non-malicious/1222.ps1
1222.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) $shareName = 'CarbonTestFileShare' $sharePath = $null $shareDescription = 'Share for testing Carbon''s Get-FileShare function.' function Start-TestFixture { $sharePath = New-TempDirectory -Prefix $PSCommandPath Ins...
combined_dataset/train/non-malicious/1619.ps1
1619.ps1
function pingt { param( [Parameter(ValueFromPipeline=$true)] $comp = $env:COMPUTERNAME, $n = 4, [switch]$t ) if (!$comp) {Throw 'No host provided'} function callping { sleep 1 Write-Host $(Get-Date -f 'yyyy/MM/dd HH:mm:ss ') -NoNewline ping1 $...
combined_dataset/train/non-malicious/Send-Growl 2.0.ps1
Send-Growl 2.0.ps1
## This is the first version of a Growl module (just dot-source to use in PowerShell 1.0) ## Initially it only supports a very simple notice, and I haven't gotten callbacks working yet ## Coming soon: ## * Send notices to other PCs directly ## * Wrap the registration of new messages ## * Figure out the stupid ...
combined_dataset/train/non-malicious/4009.ps1
4009.ps1
workflow Write-DebugAndVerboseOutput { "output message" write-debug -message "debug message" write-verbose -message "verbose message" }
combined_dataset/train/non-malicious/3257.ps1
3257.ps1
class AccessFilter { [hashtable]$Permissions = @{} [CommandAuthorizationResult]Authorize([string]$PermissionName) { if ($this.Permissions.Count -eq 0) { return $true } else { if (-not $this.Permissions.ContainsKey($PermissionName)) { return [CommandAut...
combined_dataset/train/non-malicious/sample_55_59.ps1
sample_55_59.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_60_99.ps1
sample_60_99.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ [CmdletBinding(DefaultParamet...
combined_dataset/train/non-malicious/2957.ps1
2957.ps1
properties { $testMessage = 'Executed Test!' $compileMessage = 'Executed Compile!' $cleanMessage = 'Executed Clean!' } task default -depends Test formatTaskName "-------{0}-------" task Test -depends Compile, Clean { $testMessage } task Compile -depends Clean { $compileMessage } task Clean { $cleanMess...
combined_dataset/train/non-malicious/Test-QADObject.ps1
Test-QADObject.ps1
<# .SYNOPSIS Quick way to see whether the object exists in AD. .DESCRIPTION Returns $true if at least one object matching the criteria exists and false otherwise. .PARAMETER Identity Specify the DN, SID, GUID, UPN or Domain\\Name of the directory object you want to find .EXAMPLE PS C:\\> Test...
combined_dataset/train/non-malicious/sample_33_47.ps1
sample_33_47.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ function New-ServiceFabricApp...
combined_dataset/train/non-malicious/sample_19_98.ps1
sample_19_98.ps1
if($debug -eq $true){[void]$shell.popup("Run DC_ScheduleTasks.ps1")} Import-LocalizedData -BindingVariable ScheduleTasksStrings Write-DiagProgress -Activity $ScheduleTasksStrings.ID_ScheduleTasks -Status $ScheduleTasksStrings.ID_ScheduleTasksObtaining $OutputFile = $ComputerName + "_schtasks.csv" $CommandLin...
combined_dataset/train/non-malicious/sample_38_94.ps1
sample_38_94.ps1
# # Module manifest for module 'OCI.PSModules.Tenantmanagercontrolplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Tenantmanagercontrolplane.dll' # Version number of this module. ModuleVersion = '74...
combined_dataset/train/non-malicious/Start-Countdown_1.ps1
Start-Countdown_1.ps1
function Start-Countdown{ <# .Synopsis Initiates a countdown on your session. Can be used instead of Start-Sleep. Use case is to provide visual countdown progress during "sleep" times .Example Start-Countdown -Seconds 10 This method will clear the screen and display descending seconds .Ex...
combined_dataset/train/non-malicious/2622.ps1
2622.ps1
Import-Module C:\git-repositories\PowerShell\MSFVMLab\MSFVMLab.psm1 -Force $LabConfig = Get-Content C:\git-repositories\PowerShell\MSFVMLab\LabVMS.json | ConvertFrom-Json $WorkingDirectory = $LabConfig.WorkingDirectory $Domain = $LabConfig.Domain $LocalAdminCred = Import-Clixml "$WorkingDirectory\vmlab_localadmin.xml...
combined_dataset/train/non-malicious/sample_37_80.ps1
sample_37_80.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .Synopsis Group Policy tools use administrative template files (.admx, .adml) to populate policy settings in the user interface. This allows administrators to manage registry-based policy settings. This script installes Powe...
combined_dataset/train/non-malicious/GPPreferencesPrinters.ps1
GPPreferencesPrinters.ps1
###########################################################################" # # NAME: GPPreferencesPrinters.psm1 # # AUTHOR: Jan Egil Ring # BLOG: http://blog.crayon.no/blogs/janegil # # COMMENT: Script module for working with shared printer connections in Group Policy Preferences. # Contains a functi...
combined_dataset/train/non-malicious/914.ps1
914.ps1
$subscriptionId = 'yourSubscriptionId' $resourceGroupName ='yourResourceGroupName' $diskName = 'yourDiskName' $location = 'westus' $virtualNetworkName = 'yourVirtualNetworkName' $virtualMachineName = 'yourVirtualMachineName' $virtualMachineSize = 'Standard_DS3' Select-AzSubscription -Subscriptio...
combined_dataset/train/non-malicious/4128.ps1
4128.ps1
Clear-Host Function RenameWindow ($Title) { Set-Variable -Name a -Scope Local -Force $a = (Get-Host).UI.RawUI $a.WindowTitle = $Title Remove-Variable -Name a -Scope Local -Force } Function GetProductName($Description) { Set-Varia...
combined_dataset/train/non-malicious/2257.ps1
2257.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$false, HelpMessage="Specify the name of the variable used in CustomSettings.ini for dynamic Application installations. Default is 'APPLICATIONS'.")] [ValidateNotNullOrEmpty()] [string]$RuleVariableName = "APPLICATIONS", [paramet...
combined_dataset/train/non-malicious/683.ps1
683.ps1
function Set-RsEmailSettings { [cmdletbinding()] param ( [Parameter(Mandatory = $True)] [Microsoft.ReportingServicesTools.SmtpAuthentication] $Authentication = "Ntlm", [Parameter(Mandatory = $True)] [string] $SmtpServer, ...
combined_dataset/train/non-malicious/1684.ps1
1684.ps1
$source = 'C:\temp\music' $dest = 'C:\temp\new' $exclude = '\\my (?:music|pictures)\\' $files = (Get-ChildItem $source -Recurse -File).where{$_.FullName -notmatch $exclude} $index = 0 $total = $files.Count $starttime = $lasttime = Get-Date $results = $files | % { $index++ $currtime = (G...
combined_dataset/train/non-malicious/3749.ps1
3749.ps1
function Get-ResourceGroupName { return getAssetName } function Get-VaultName { return getAssetName } function Get-KeyVaultTestMode { try { $testMode = [Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode; $testMode = $testMode.ToString(); } catch { if ($PS...
combined_dataset/train/non-malicious/sample_6_98.ps1
sample_6_98.ps1
#************************************************ # DC_TrustList.ps1 # Version 1.0 # Date: 1/14/2014 # Author: Tim Springston [MS] # Description: This script queries for the user and computer domain # and returns details about those domains. #************************************************ Import-Local...
combined_dataset/train/non-malicious/Measure-Total.ps1
Measure-Total.ps1
#.Synopsis # Calculate sums on top of Measure-Object #.Description # Pipe in objects with numerical properties, and get an extra output item # with the sum of all the specified properties #.Parameter Property # The names of the properties to total #.Example # wc *.ps1 | total words, lines # # Calculates...
combined_dataset/train/non-malicious/3880.ps1
3880.ps1
function Get-ResourceGroupName { return getAssetName } function Get-ResourceName { return "AzTest" + (getAssetName) } function Get-StorageResourceId($rgname, $resourcename) { $subscription = (Get-AzContext).Subscription.Id return "/subscriptions/$subscription/resourcegroups/$rgname/pr...
combined_dataset/train/non-malicious/sample_26_4.ps1
sample_26_4.ps1
# # Module manifest for module 'OCI.PSModules.Datacatalog' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datacatalog.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_37_26.ps1
sample_37_26.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\vue-tsc@1.8.27_typescript@5.3.3\node_modules\vue-tsc\bin\node_modules;C:\Users\abder\component-maker\web\node_modul...
combined_dataset/train/non-malicious/sample_17_44.ps1
sample_17_44.ps1
# # Module manifest for module 'OCI.PSModules.Dts' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dts.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_21_50.ps1
sample_21_50.ps1
# # Copyright (c) Microsoft Corporation. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ...
combined_dataset/train/non-malicious/TabExpansion_9.ps1
TabExpansion_9.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/Get-SvnInfo.ps1
Get-SvnInfo.ps1
Function Get-SvnInfo { [cmdletbinding()] Param( [ValidateScript({Test-Path $_})] [string]$rootDir = "C:\\Build\\", [ValidateScript({Test-Path $_})] [string]$buildDir = "C:\\Build\\build_dir\\", [ValidateScript({Test-Path $_})] [string]$outputDir = "C:\\Build\\output_dir\\", [ValidateScript({Test-Path $_})] ...
combined_dataset/train/non-malicious/2140.ps1
2140.ps1
if ( $IsCoreCLR ) { return } Describe "Interface inheritance with remoting proxies" -Tags "CI" { $src = @" using System; using System.ServiceModel; namespace MSFT_716893 { [ServiceContract] public interface IInterface1 { [OperationContract]string BaseOperation(int i); } [Service...
combined_dataset/train/non-malicious/sample_42_60.ps1
sample_42_60.ps1
function New-AzDataProtectionBackupPolicy { [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBaseBackupPolicyResource')] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates a new back...
combined_dataset/train/non-malicious/Compiled-Help 1.1.ps1
Compiled-Help 1.1.ps1
#requires -version 2.0 # Compile-Help.ps1 # by Jeff Hillman # # this script uses the text and XML PowerShell help files to generate HTML help # for all PowerShell Cmdlets, PSProviders, and "about" topics. the help topics # are compiled into a .chm file using HTML Help Workshop. # # Minor tweak by John Robbin...
combined_dataset/train/non-malicious/Get-WebFile 3.7.ps1
Get-WebFile 3.7.ps1
## Get-WebFile (aka wget for PowerShell) ############################################################################################################## ## Downloads a file or page from the web ## History: ## v3.7 - [int] to [long] to support files larger than 2.0 GB ## v3.6 - Add -Passthru switch to output TEXT fi...
combined_dataset/train/non-malicious/sample_38_37.ps1
sample_38_37.ps1
# # Module manifest for module 'OCI.PSModules.Autoscaling' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Autoscaling.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/Disable AD Users_1.ps1
Disable AD Users_1.ps1
$NumDays = 90 $LogDir = ".\\Disabled-User-Accounts.log" $currentDate = [System.DateTime]::Now $currentDateUtc = $currentDate.ToUniversalTime() $lltstamplimit = $currentDateUtc.AddDays(- $NumDays) $lltIntLimit = $lltstampLimit.ToFileTime() $adobjroot = [adsi]'' $objstalesearcher = New-Object System.DirectorySer...
combined_dataset/train/non-malicious/sample_13_59.ps1
sample_13_59.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_2_84.ps1
sample_2_84.ps1
########################################################################### # DC_Hardware # Version 1.0 # Date: 09-26-2012 # Author: mifannin # Description: Collects Installed Hardware Data ########################################################################### Import-LocalizedData -BindingVariable Hardwar...
combined_dataset/train/non-malicious/chkhash_12.ps1
chkhash_12.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/Update VM Tools_3.ps1
Update VM Tools_3.ps1
######################################################## # Created by Brian English # Brian.English@charlottefl.com # eddiephoenix@gmail.com # # for Charlotte County Government # No warranty suggested or implied ######################################################## # Purpose: Cycle through all VMs on a...
combined_dataset/train/non-malicious/Translate Service DACLS.ps1
Translate Service DACLS.ps1
Function Get-ServiceDACL { [CmdletBinding()] param( [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)] [String]$Servicename, [Parameter(Mandatory=$false,Position=1)] [String]$Computername= ".") $sddl = Invoke-expression -Command "c:\\Windows\\System32\\sc.ex...
combined_dataset/train/non-malicious/sample_22_11.ps1
sample_22_11.ps1
# # Module manifest for module 'OCI.PSModules.Marketplacepublisher' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Marketplacepublisher.dll' # Version number of this module. ModuleVersion = '79.0.0' # S...