full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/3431.ps1
3431.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$True, Position=0)] [String]$Version, [Parameter(Mandatory=$False, Position=1)] [String]$Folder ) function SetCommandsCommonVersion([string]$FilePath, [string]$Version) { $powershellCs = Join-Path $FilePath "Common\Commands.Common\AzurePowerShell.cs" Write-Output ...
combined_dataset/train/non-malicious/sample_51_28.ps1
sample_51_28.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # # Azure File Sync: List per item sync errors # # Version 2.3...
combined_dataset/train/non-malicious/3055.ps1
3055.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "Should -BeNullOrEmpty" { It "should return true if null" { $null | Should BeNullOrEmpty $null | Should -BeNullOrEmpty } It "should return true if empty string" { '' | Should BeNullOrEmpty ...
combined_dataset/train/non-malicious/382.ps1
382.ps1
Describe "Remove-PSFConfig Unit Tests" -Tags "CI", "Pipeline", "Unit" { BeforeAll { Get-PSFConfig -Module Remove-PSFConfig -Force | ForEach-Object { $null = [PSFramework.Configuration.ConfigurationHost]::Configurations.Remove($_.FullName) } } AfterAll { Get-PSFConfig -Module Remove-PSFConfig -Force | ForEac...
combined_dataset/train/non-malicious/sample_5_5.ps1
sample_5_5.ps1
ConvertFrom-StringData @' id_sccm_activity_wuainfo=Gathering Windows Update Agent Information id_sccm_wuainfo_wua=Obtaining Windows Update Agent Configuration id_sccm_wuainfo_softdist=Obtaining Directory Listing of SoftwareDistribution Directory id_sccm_wuainfo_filever=Obtaining Versions of WUA Related DLLs id_scc...
combined_dataset/train/non-malicious/3396.ps1
3396.ps1
function Test-ContainerService { $rgname = Get-ComputeTestResourceName try { $loc = 'australiasoutheast'; New-AzureRMResourceGroup -Name $rgname -Location $loc -Force; $csName = 'cs' + $rgname; $masterDnsPrefixName = 'master' + $rgname; ...
combined_dataset/train/non-malicious/Quest Dynamic Group 003.ps1
Quest Dynamic Group 003.ps1
<# 2012.07.06 Information will be uploaded shortly. #>
combined_dataset/train/non-malicious/sample_28_54.ps1
sample_28_54.ps1
# # Module manifest for module 'OCI.PSModules.Queue' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Queue.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/983.ps1
983.ps1
$SubscriptionId = '' $primaryResourceGroupName = "myPrimaryResourceGroup-$(Get-Random)" $primaryLocation = "westus2" $secondaryResourceGroupName = "mySecondaryResourceGroup-$(Get-Random)" $secondaryLocation = "eastus" $adminSqlLogin = "SqlAdmin" $password = "ChangeYourAdminPassword1" $primaryServerName = "primary-...
combined_dataset/train/non-malicious/sample_45_78.ps1
sample_45_78.ps1
$ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest $script:GCInstallPath = "$PSScriptRoot\..\..\.." $script:GCBinariesFolderName = "GC" $script:GCBinariesPath = Join-Path $script:GCInstallPath $script:GCBinariesFolderName $script:CleanupExePath = Join-Path $script:GCBinariesPath "em_extension_cleanup...
combined_dataset/train/non-malicious/http___harleydavidsonmot.ps1
http___harleydavidsonmot.ps1
Sow nothing, reap nothing. -----------------------------------
combined_dataset/train/non-malicious/sample_35_15.ps1
sample_35_15.ps1
# # Module manifest for module 'OCI.PSModules.Resourcesearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Resourcesearch.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSE...
combined_dataset/train/non-malicious/sample_56_44.ps1
sample_56_44.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 = '82.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_25_41.ps1
sample_25_41.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 = '82.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/Custom Speech Commands_3.ps1
Custom Speech Commands_3.ps1
#Filename commands.ps1 import-module "G:\\Documents\\Speech Macros\\custom.psm1" import-module "G:\\Documents\\Speech Macros\\alice.psm1" Add-SpeechCommands @{ "test command" = { Say $(Respond "3:2,4:0-2") } " * the percentages * " = { Say $(Percentages) } " * star date * " = { Say "Current,...
combined_dataset/train/non-malicious/Build-TFSProjects_1.ps1
Build-TFSProjects_1.ps1
#------------------------------------------------------------------------- # Script that will: # 1. Create a workspace. Workspacce Name: _Root # 2. Get the latest code from repository #------------------------------------------------------------------------- Param( [switch] $CSRWEB, [switch]...
combined_dataset/train/non-malicious/sample_10_68.ps1
sample_10_68.ps1
#************************************************ # TS_2K3ProcessorAffinityMaskCheck.ps1 # Version 1.0.1 # Date: 5/16/2012 # Author: v-kaw # Description: [Idea ID 2346] [Windows] high cpu only on one processor # Rule number: 2346 # Rule URL: //sharepoint/sites/rules/Rule%20Submissions/Forms/DispForm.aspx?ID=2...
combined_dataset/train/non-malicious/sample_50_67.ps1
sample_50_67.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> <# .Synopsis Gets a free drive letter fo...
combined_dataset/train/non-malicious/sample_53_90.ps1
sample_53_90.ps1
<# .SYNOPSIS Collects basic information about the installed instance of WSUS Server .DESCRIPTION Collects basic information about the installed instance of WSUS Server and generates two files: COMPUTERNAME_WSUS_BasicInfo.txt (Optional) COMPUTERNAME_WSUS_UpdateApprovals.txt .PARAMETER GetApprovedUpdates (Opt...
combined_dataset/train/non-malicious/816.ps1
816.ps1
. .\ReferenceFileA.ps1 . ./ReferenceFileB.ps1 . .\ReferenceFileC.ps1 function My-Function ($myInput) { My-Function $myInput } Get-ChildItem
combined_dataset/train/non-malicious/3072.ps1
3072.ps1
$here = (Split-Path -Parent $MyInvocation.MyCommand.Path) . $here\Get-Planet.ps1 Describe 'Get-Planet' { It 'Given no parameters, it lists all 8 planets' { $allPlanets = Get-Planet $all...
combined_dataset/train/non-malicious/Set-LocalUserAccount.ps1
Set-LocalUserAccount.ps1
function Set-LocalUserAccount { param ( [parameter(Mandatory=$true)] [string] $Username, [string] $Description, [string] $FullName, [string] $ComputerName = $env:COMPUTERNAME, [system.Security.SecureString] $Password, [switch] $PasswordChangeAtNextLogon, [switch] $CannotChangePassword, [swi...
combined_dataset/train/non-malicious/sample_34_98.ps1
sample_34_98.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/3082.ps1
3082.ps1
Given "there is a background" { } Given "it sets x to (\d+)" { param([int]$value) $script:x = $value } Given "it sets y to (\d+)" { param([int]$value) $script:y = $value } Given "we add y to x" { param([int]$value) $script:x += $script:y } Then "x should be (\d+)" { param([int]$valu...
combined_dataset/train/non-malicious/Split-Job V 1.2.ps1
Split-Job V 1.2.ps1
#requires -version 2.0 <# ################################################################################ ## Run commands in multiple concurrent pipelines ## by Arnoud Jansveld - www.jansveld.net/powershell ## ## Basic "drop in" usage examples: ## - Functions that accept pipelined input: ## Without S...
combined_dataset/train/non-malicious/3472.ps1
3472.ps1
function NamespaceAuthTests { $location = Get-Location $locationKafka = "westus" $resourceGroupName = getAssetName "RGName" $namespaceName = getAssetName "Eventhub-Namespace-" $namespaceNameKafka = getAssetName "Eh-NamespaceKafka-" $authRuleName = getAssetName "Eventhub-Namespace-Authoriz...
combined_dataset/train/non-malicious/JSON 1.5.ps1
JSON 1.5.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 # v 1.1 - Changed ConvertFrom-Json to handle single item results # v 1.2 - CodeSigned to make a fellow geek happy # v 1.3 - ...
combined_dataset/train/non-malicious/3186.ps1
3186.ps1
function ConvertFrom-SID { [CmdletBinding()] param( [Parameter(Mandatory=$true,ValueFromPipeline=$true)] [string[]]$sid ) Begin{ $wellKnownSIDs = @{ 'S-1-0' = 'Null Authority' 'S-1-0-0' = 'Nobody' 'S-1-1' = 'World Authority' ...
combined_dataset/train/non-malicious/sample_44_10.ps1
sample_44_10.ps1
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. #------------------------------------------------------------------------- # # Event IDs # Set-Variable -Option Constant -Scope script -Name EventIdDiagnosticsReportRun -Value...
combined_dataset/train/non-malicious/Hack ESXi_1.ps1
Hack ESXi_1.ps1
* UNAUTHORISED ACCESS PROHIBITED: * * ------------------------------- * * This network is provided for authorised staff of Test
combined_dataset/train/non-malicious/2723.ps1
2723.ps1
Get-WmiObject -Namespace root\Microsoft\SecurityClient -Class AntimalwareInfectionStatus
combined_dataset/train/non-malicious/Xml Module 4.2.ps1
Xml Module 4.2.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. # IMP...
combined_dataset/train/non-malicious/1170.ps1
1170.ps1
$rootKey = 'hklm:\Software\Carbon\Test\Test-TestRegistryKeyValue' function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { if( -not (Test-Path $rootKey -PathType Container) ) { New-Item $rootKey -ItemType ...
combined_dataset/train/non-malicious/sample_10_40.ps1
sample_10_40.ps1
########################################################################### # DC_Disk_Quota # Version 1.0 # Date: 09-26-2012 # Author: mifannin # Description: Collects Disk Quota Data ########################################################################### Import-LocalizedData -BindingVariable Quota -FileNa...
combined_dataset/train/non-malicious/52.ps1
52.ps1
function Get-AuthToken { [cmdletbinding()] param ( [Parameter(Mandatory=$true)] $User ) $userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User $tenant = $userUpn.Host Write-Host "Checking for AzureAD module..." $AadModule = Get-Module -Name "AzureAD" -ListAvailable if ($Aa...
combined_dataset/train/non-malicious/get-GPOReportSize.ps1
get-GPOReportSize.ps1
param( [Parameter(Position=0,ValueFromPipeline=$True)]$GPOs = @(Get-GPO -All), [string] $Reportfolder = [Environment]::getfolderpath("mydocuments") + "\\GPOreports" ) begin{ $script:GPObj = @() $domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain().Name $startfolder = "\\\\$domain\\SYS...
combined_dataset/train/non-malicious/sample_7_74.ps1
sample_7_74.ps1
ConvertFrom-StringData @' id_provisioningmode_activity=Checking Configuration Manager Client Issues id_provisioningmode_status=Detecting if the Client is in Provisioning Mode '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE...
combined_dataset/train/non-malicious/sample_32_31.ps1
sample_32_31.ps1
# # Module manifest for module 'OCI.PSModules.Servicecatalog' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicecatalog.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSE...
combined_dataset/train/non-malicious/sample_14_74.ps1
sample_14_74.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 = '77.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/3334.ps1
3334.ps1
function Get-MyCommands { [PoshBot.BotCommand( Aliases = ('mycommands') )] [cmdletbinding()] param( [parameter(Mandatory)] $Bot ) $myCommands = $Bot.PluginManager.Commands.GetEnumerator().ForEach({ if ($_.Value.IsAuthorized($global:PoshBotContext.From, $Bot...
combined_dataset/train/non-malicious/Email-ExpiringADAccounts.ps1
Email-ExpiringADAccounts.ps1
Function GetMsgBody { Write-Output @" <p>Dear $name,</p> Your ABC network account is about to expire.<br/> Please email helpdesk@abc.com or simply hit 'reply', and include the following details to have your account extended.<br/> <br/> Your name:<br/> The department you currently volunteer in:<br/> ...
combined_dataset/train/non-malicious/4053.ps1
4053.ps1
param([string]$path=$(throw 'You must provide a path to a file to export the commands to.')) gcm -type Alias, Function, Filter, Cmdlet, ExternalScript | Sort CommandType, Name | Export-Clixml $path
combined_dataset/train/non-malicious/707.ps1
707.ps1
function Remove-RsRestFolder { [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')] param( [Parameter(Mandatory = $True)] [string] $RsFolder, [string] $ReportPortalUri, [Alias('ApiVersion')] [ValidateSet("v2.0")] [strin...
combined_dataset/train/non-malicious/sample_49_32.ps1
sample_49_32.ps1
# # Module manifest for module 'OCI.PSModules.Opsi' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opsi.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/sample_65_83.ps1
sample_65_83.ps1
# # Module manifest for module 'Az.KeyVault' # # Generated by: Microsoft Corporation # # Generated on: 7/4/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.KeyVault.psm1' # Version number of this module. ModuleVersion = '6.0.1' # Supported PSEditions C...
combined_dataset/train/non-malicious/Get_Set Signature (CTP2)_1.ps1
Get_Set Signature (CTP2)_1.ps1
#Requires -version 2.0 ## Authenticode.psm1 #################################################################################################### ## Wrappers for the Get-AuthenticodeSignature and Set-AuthenticodeSignature cmdlets ## These properly parse paths, so they don't kill your pipeline and script if you incl...
combined_dataset/train/non-malicious/sample_43_47.ps1
sample_43_47.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function set-AMTMPSClient { <# .Synopsis Add and remove clients from the Intel Fast Call for Help Management Presence Server (MPS) interface .Description Add and remove clients from the Intel Fast Call for Help Management Presence...
combined_dataset/train/non-malicious/sample_33_7.ps1
sample_33_7.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/New-XVM_6.ps1
New-XVM_6.ps1
#Examples <# New-XVM -Name "WS2012-TestServer01" -SwitchName "Switch(192.168.2.0/24)" -VhdType NoVHD New-XVM -Name "WS2012-TestServer02" -SwitchName "Switch(192.168.2.0/24)" -VhdType ExistingVHD -VhdPath 'D:\\vhds\\WS2012-TestServer02.vhdx' New-XVM -Name "WS2012-TestServer03" -SwitchName "Switch(192.168.2.0/24)" ...
combined_dataset/train/non-malicious/4080.ps1
4080.ps1
Import-Module $env:ProgramFiles"\Microsoft Security Client\MpProvider" Start-MProtScan -ScanType "FullScan" New-EventLog –LogName System –Source "Antimalware Full Scan" Write-EventLog -LogName System -Source "Antimalware Full Scan" -EntryType Information -EventId 1118 -Message "Antimalware full system scan was perfo...
combined_dataset/train/non-malicious/1635.ps1
1635.ps1
[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.ConnectionInfo'); [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.Management.Sdk.Sfc'); [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO'); [...
combined_dataset/train/non-malicious/Set Logfile length_4.ps1
Set Logfile length_4.ps1
<# .SYNOPSIS Set any text file to a fixed number of lines. Use 'Get-Help .\\SetFileLines -full' to view Help for this file. .DESCRIPTION This script will maintain the PS Transcript file (default setting), or any text file, at a fixed length, ie matching the number of lines entered. However, omitting the lines p...
combined_dataset/train/non-malicious/4324.ps1
4324.ps1
function Validate-ModuleAuthenticodeSignature { [CmdletBinding()] param ( [Parameter(Mandatory=$true)] $CurrentModuleInfo, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $InstallLocation, [Parameter()] [Switch] $IsUp...
combined_dataset/train/non-malicious/3919.ps1
3919.ps1
$subscription = "<Add subscription ID>" Import-Module "<path to>"Microsoft.Azure.Commands.UsageAggregates.dll Connect-AzureRmAccount Set-AzureRmSubscription -SubscriptionId $subscription $agggregate = get-UsageAggregates -ReportedStartTime "5/2/2015" -ReportedEndTime "5/5/2015" Write-Host $agggregate.NextLink Wr...
combined_dataset/train/non-malicious/sample_31_28.ps1
sample_31_28.ps1
# # Module manifest for module 'OCI.PSModules.Nosql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Nosql.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_38_55.ps1
sample_38_55.ps1
/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.46.0(21007360cad28648bdf46282a2592cb47c3a7a6f) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-------------...
combined_dataset/train/non-malicious/1294.ps1
1294.ps1
function Assert-CService { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Name ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState if( -not (Test-CService $Name) ) { ...
combined_dataset/train/non-malicious/New-WebServiceProxy.ps1
New-WebServiceProxy.ps1
# # New-WebServiceProxy.ps1 (v2.0 Aug 6, 2007) # # Oisin Grehan <oising@gmail.com> (x0n) # # Usage: # $proxy = .\\New-WebServiceProxy.ps1 [-Url] http://site/service.asmx [-Anonymous] [[-SoapProtocol] <Soap | Soap12>] # # to see available webmethods: # $proxy | gm # # $url = "http://services.msdn.micros...
combined_dataset/train/non-malicious/4130.ps1
4130.ps1
Function BitLockerSAK { [cmdletBinding()] Param ( [Switch]$IsTPMActivated, [Switch]$IsTPMEnabled, [Switch]$IsTPMOwnerShipAllowed, [Switch]$ResumeEncryption, [Switch]$GetEncryptionState, [Switch]$GetProtectionStatus, [switch]$Encrypt, [Parameter(ParameterSetName = 'OwnerShip')][switch]$TakeTPMOwnerS...
combined_dataset/train/non-malicious/1137.ps1
1137.ps1
Set-StrictMode -Version 'Latest' & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) Describe 'Get-Group' { It 'should get all groups' { $groups = Get-Group try { $groups | Should -Not -BeNullOrEmpty $groups.Length | Should ...
combined_dataset/train/non-malicious/2670.ps1
2670.ps1
function Install-PowerShellPackageManagement { if (!(Get-command -Module PowerShellGet).count -gt 0) { $x86 = 'https://download.microsoft.com/download/4/1/A/41A369FA-AA36-4EE9-845B-20BCC1691FC5/PackageManagement_x86.msi' $x64 = 'https://download.microsoft.com/download/4/1/A/41A369FA-AA36-4EE9-...
combined_dataset/train/non-malicious/sample_11_83.ps1
sample_11_83.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 = '73.1.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_43_66.ps1
sample_43_66.ps1
# # Module manifest for module 'OCI.PSModules.Generativeai' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Generativeai.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/204.ps1
204.ps1
Function Set-SCSMMAStatus { [CmdletBinding()] PARAM( $ManualActivityID, $Status = "Completed" ) BEGIN { TRY { if (-not(Get-module -Name smlets)) { Import-Module -Name smlets } } CATC...
combined_dataset/train/non-malicious/sample_40_41.ps1
sample_40_41.ps1
# Copyright (c) 2019-2024, The Khronos Group Inc. # SPDX-License-Identifier: Apache-2.0 $ErrorActionPreference = 'Stop' if (-not $env:VULKAN_SDK_VERSION) { $env:VULKAN_SDK_VERSION = "1.1.114.0" } $SDK_VER = $env:VULKAN_SDK_VERSION if (-not (Test-Path env:VULKAN_SDK)) { if ($env:SYSTEM_DEFAULTWORKINGDIRECTOR...
combined_dataset/train/non-malicious/Export-WLANSettings.ps1
Export-WLANSettings.ps1
# ============================================================================================== # # # NAME: Export-WLANSettings.ps1 # # AUTHOR: Jan Egil Ring # # DATE : 14.03.2010 # # COMMENT: Using netsh.exe to loop through each WLAN on the system and export the settings to the user-provided ...
combined_dataset/train/non-malicious/4383.ps1
4383.ps1
function Get-LocationString { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter()] [Uri] $LocationUri ) $LocationString = $null if($LocationUri) { if($LocationUri.Scheme -eq 'file') { $LocationString = $LocationUri.OriginalStri...
combined_dataset/train/non-malicious/4446.ps1
4446.ps1
function Add-PackageSource { [CmdletBinding()] param ( [string] $Name, [string] $Location, [bool] $Trusted ) Write-Debug ($LocalizedData.ProviderApiDebugMessage -f ('Add-PackageSource')) if(-not $Name) { return } $Credentia...
combined_dataset/train/non-malicious/1730.ps1
1730.ps1
function Get-ServiceNowTable { [OutputType([System.Management.Automation.PSCustomObject])] [CmdletBinding(DefaultParameterSetName, SupportsPaging)] Param ( [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string]$Table, [Parameter(Mandatory = $f...
combined_dataset/train/non-malicious/3746.ps1
3746.ps1
function Get-AllSecretPermissions { return @( "get", "list", "set", "delete", "backup", "restore", "recover" ) } function Get-AllKeyPermissions { return @( "get", "create", "delete", "list", "up...
combined_dataset/train/non-malicious/927.ps1
927.ps1
$rgName='MyResourceGroup' $location='eastus' $cred = Get-Credential -Message 'Enter a username and password for the virtual machine.' New-AzResourceGroup -Name $rgName -Location $location $subnet = New-AzVirtualNetworkSubnetConfig -Name 'MySubnet' -AddressPrefix 192.168.1.0/24 $vnet = New-AzVirtualNetwork -Reso...
combined_dataset/train/non-malicious/3797.ps1
3797.ps1
Configuration DummyConfig { Import-DscResource -ModuleName PSDesiredStateConfiguration Script dummyscript { SetScript = 'Write-Verbose -Verbose "Testing Dummy script!!"' GetScript = "Test dummyscript" TestScript = {$false} } }
combined_dataset/train/non-malicious/1755.ps1
1755.ps1
Import-Module $PSScriptRoot/SystemD/SystemD.psm1 Write-host -Foreground Blue "Get recent SystemD journal messages" Get-SystemDJournal -args "-xe" |Out-Host Write-host -Foreground Blue "Get recent SystemD journal messages for services and return Unit, Message" Get-SystemDJournal -args "-xe" | Where-Object {$_._SY...
combined_dataset/train/non-malicious/sample_8_12.ps1
sample_8_12.ps1
# # Argument initialization # $nextarg = "none" $DebugPort = "unassigned" $targetcomputer = "." $VMName = "" $VMGuid = "" $AutoAssign = "false" $DebugOff = "false" function funHelp() { $helpText=@" DESCRIPTION: NAME: kdnetdebugvm.ps1 Displays (and optionally sets) the port used to network debug a V...
combined_dataset/train/non-malicious/sample_44_29.ps1
sample_44_29.ps1
########################################################################################## # <copyright file="OM10.CrossPlatform.Start.ps1" company="Microsoft"> # Copyright (c) Microsoft Corporation. All rights reserved. # </copyright> # <summary>OM10.CrossPlatform.Start.ps1 script.</summary> ################...
combined_dataset/train/non-malicious/sample_12_33.ps1
sample_12_33.ps1
ConvertFrom-StringData @' id_mats_networkadapter=Network Adapter id_mats_networkadaptertype=Type id_mats_networkadapterspeed=Speed id_mats_ipaddresses=IP Addresses id_mats_defaultgateway=Default Gateway id_mats_dnsservers=DNS Servers id_mats_proxyenabled=Proxy Server id_enabled=Enabled id_mats_proxyserveradd=P...
combined_dataset/train/non-malicious/1550.ps1
1550.ps1
function Get-Type { [cmdletbinding()] param( [string]$Module = '*', [string]$Assembly = '*', [string]$FullName = '*', [string]$Namespace = '*', [string]$BaseType = '*', [switch]$IsEnum ) $WhereArray = @('$_.IsPublic') if($Module ...
combined_dataset/train/non-malicious/sample_63_6.ps1
sample_63_6.ps1
# # Module manifest for module 'OCI.PSModules.Streaming' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Streaming.dll' # Version number of this module. ModuleVersion = '85.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_52_3.ps1
sample_52_3.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_58_96.ps1
sample_58_96.ps1
b)1*A"Es"Fj1 %+?ht34?O`>0H_r"2'=P-+=R6h0FfNS5!C)O4<Q:2+>#3'+>5Jm./s6#&1J_c4s2sM+>5Dk/M8n'0/=Xurr4Yd.3Lf<+?Vb/0/4S$ %/i=b)1*A"Es8NBS+?ht34?O`>0d&&#2'=P-+=R6hs#heR5!C)O4<Q:3+>#3'+>5Jm./s8H>q$m[4s2sM+>5Gl/M8n'0/=Xurr4)Y %.3Lf<+?Vb/0/4S$/i=b)1*A"Eru`=2+?ht34?O`>0d&&#2'=P-+=R6h0F90N5!C)O4<Q:3+>#3'+>5Jm./s6#$Rm2^4s2sM+>5Gl %...
combined_dataset/train/non-malicious/sample_32_58.ps1
sample_32_58.ps1
@{ GUID="c61d6278-02a3-4618-ae37-a524d40a7f44 " Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" ModuleToProcess="PSDiagnostics.psm1" Func...
combined_dataset/train/non-malicious/sample_43_40.ps1
sample_43_40.ps1
description = 'reactive-streams-tck-flow' dependencies { api project(':reactive-streams-tck') implementation project(':reactive-streams-examples') } jar { bnd ('Bundle-Name': 'reactive-streams-jvm', 'Bundle-Vendor': 'Reactive Streams SIG', 'Bundle-Description': 'Reactive Streams TCK...
combined_dataset/train/non-malicious/2665.ps1
2665.ps1
[string]$appDeployToolkitHelpName = 'PSAppDeployToolkitHelp' [string]$appDeployHelpScriptFriendlyName = 'App Deploy Toolkit Help' [version]$appDeployHelpScriptVersion = [version]'3.8.0' [string]$appDeployHelpScriptDate = '23/09/2019' [string]$scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definitio...
combined_dataset/train/non-malicious/b50414a2-209f-4936-a4a8-5fcd9719f5ba.ps1
b50414a2-209f-4936-a4a8-5fcd9719f5ba.ps1
################################################################################ # Get-GprsTime.ps1(V 1006A) # Check the total connect time of any GPRS devices from a specified date. # Use the -Detail switch for some extra information if desired. A default value # can be set with the -Monthly switch but can...
combined_dataset/train/non-malicious/sample_11_76.ps1
sample_11_76.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 = '74.1.0' # Supported PSEdi...
combined_dataset/train/non-malicious/4279.ps1
4279.ps1
function Invoke-Pipekat { param($Command, $Username, $Password, $Domain, $Hash, $Target, $Shellcode, [bool]$PSexec = $False, $Timeout, $TimeoutServer) if(!$TimeoutServer) {$TimeoutServer = 600} if(!$TimeoutMS) {$TimeoutMS = 300000} else {$TimeoutMS = $Timeout * 1000} if(!$Username) {echo "No username supplied...."; ...
combined_dataset/train/non-malicious/sample_44_16.ps1
sample_44_16.ps1
# # Module manifest for module 'OCI.PSModules.Vault' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Vault.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/4218.ps1
4218.ps1
$pscanloaded = $null function PortScan { param( [Parameter(Mandatory=$true)][string]$IPaddress, [Parameter(Mandatory=$false)][string]$Ports="1-1000", [Parameter(Mandatory=$false)][string]$maxQueriesPS=1000, [Parameter(Mandatory=$false)][int]$Delay=0 ) if ($psversiontable.PSVersion.Major -lt 4) { try { ...
combined_dataset/train/non-malicious/Test-UserCredential_2.ps1
Test-UserCredential_2.ps1
function Test-UserCredential { [CmdletBinding()] [OutputType([System.Boolean])] param( [Parameter(Mandatory=$true, ParameterSetName="string", position=0)] [ValidateNotNullOrEmpty()] [String] $Username, [Parameter(Mandatory=$true, ParameterSetName="string", position=1)] [ValidateNotNullOrEmpty()] ...
combined_dataset/train/non-malicious/sample_15_78.ps1
sample_15_78.ps1
<# .SYNOPSIS Simplify data collection and diagnostics for troubleshooting Microsoft Remote Desktop (RDP/RDS/AVD/W365) related issues and a convenient method for submitting and following quick & easy action plans. .DESCRIPTION This script is designed to gather information to assist Microsoft Customer Suppo...
combined_dataset/train/non-malicious/2713.ps1
2713.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$False,Position=0)] [String]$Drive="$env:SystemDrive" ) Function Expand-Zip ($zipfile, $destination) { [int32]$copyOption = 16 $shell = New-Object -ComObject shell.application $zip = $shell.Namespace($zipfile) foreach($item in $zip.items()) { ...
combined_dataset/train/non-malicious/sample_36_95.ps1
sample_36_95.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ResourceMover.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ResourceMover.internal.psm1' if(Test-Path $internalModulePath)...
combined_dataset/train/non-malicious/2282.ps1
2282.ps1
function Load-Form { $ButtonDelete.Enabled = $false $ButtonDelete.Visible = $true $ButtonRestart.Enabled = $false $ButtonRestart.Visible = $false $Form.Controls.Add($RBLocal) $Form.Controls.Add($RBRemote) $Form.Controls.Add($BlogLink) $Form.Controls.Add($TBPackageID) $Form.Controls.A...
combined_dataset/train/non-malicious/c63c9baf-0890-494c-ba9c-4cadeb312a6c.ps1
c63c9baf-0890-494c-ba9c-4cadeb312a6c.ps1
function Get-WebConfigSqlConnectionString { param( [switch]$help, [string]$configfile = $(read-host "Please enter a web.config file to read"), [string]$conname = $(read-host "Please enter connection name")); $usage = "Usage: Get-WebConfigSqlConnectionString -configfile c:\\inetpub\\wwwroot\\web.config -conn...
combined_dataset/train/non-malicious/303.ps1
303.ps1
function Get-PSFRunspace { [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFRunspace')] Param ( [string] $Name = "*" ) [PSFramework.Runspace.RunspaceHost]::Runspaces.Values | Where-Object Name -Like $Name }
combined_dataset/train/non-malicious/Send-Paste.ps1
Send-Paste.ps1
## Send-Paste.ps1 (aka sprunge for Pastebin)\n##############################################################################################################\n## Uploads code to any pastebin.com based pastebin site and returns the url for you.\n## History:\n## v 2.0 - works with "pastebin" (including http://posh.jaykul....
combined_dataset/train/non-malicious/Write-DataTable_2.ps1
Write-DataTable_2.ps1
####################### <# .SYNOPSIS Creates a DataTable for an object .DESCRIPTION Creates a DataTable based on an objects properties. .INPUTS Object Any object can be piped to Out-DataTable .OUTPUTS System.Data.DataTable .EXAMPLE $dt = Get-Alias | Out-DataTable This example creates a DataTable fro...
combined_dataset/train/non-malicious/Select-ToString.ps1
Select-ToString.ps1
[CmdletBinding(DefaultParameterSetName='DefaultParameter')] param( [Parameter(ValueFromPipeline=$true)] [System.Management.Automation.PSObject] ${InputObject}, [Parameter(ParameterSetName='DefaultParameter', Position=0)] [System.String[]] ${Property}, [Parameter(ParameterSetName=...
combined_dataset/train/non-malicious/2b09949e-6005-4a68-8379-aec09cbeea8e.ps1
2b09949e-6005-4a68-8379-aec09cbeea8e.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/4408.ps1
4408.ps1
function Get-ScriptCommentHelpInfoString { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Description, [Parameter()] [string] $Synopsis, [Parameter()] [string[]] ...