full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_63_21.ps1
sample_63_21.ps1
# # Module manifest for module 'OCI.PSModules.Integration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Integration.dll' # Version number of this module. ModuleVersion = '85.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_23_45.ps1
sample_23_45.ps1
########################################################### # # 'ExtensionService' module # ########################################################### $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest Import-Module "$PSScriptRoot\ServiceHelper.psm1" $script:GCInstallPath = "$PSScriptRoot\.....
combined_dataset/train/non-malicious/Protect-Variable.ps1
Protect-Variable.ps1
function Protect-Variable { param( [Parameter(Mandatory=$true,Position=0)][String]$Name, [Int]$Scope = 1, [Parameter(ParameterSetName="ValidateScriptBlock")][ScriptBlock]$ScriptBlock, [Parameter(ParameterSetName="ValidateCount")][Int]$MinCount, [Parameter(ParameterSetName="ValidateCount")][Int]$MaxCount, [Paramet...
combined_dataset/train/non-malicious/sample_20_99.ps1
sample_20_99.ps1
# # Module manifest for module 'OCI.PSModules.Ocvp' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ocvp.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/sample_11_12.ps1
sample_11_12.ps1
#************************************************ # TS_UnableToAddNetworkPrintersErrorCheck.ps1 # Version 1.0.1 # Date: 7/19/2013 # Author: v-kaw # Description: [KSE Rule] [ Windows V3] Presence of lots of folders inside \spool\prtprocs\ causes failure to install print queues # Rule number: d4047602-196c-443f-9...
combined_dataset/train/non-malicious/Get-FailingDrive.ps1
Get-FailingDrive.ps1
Function Get-FailingDrive { <# .SYNOPSIS Checks for any potentially failing drives and reports back drive information. .DESCRIPTION Checks for any potentially failing drives and reports back drive information. This only works against local hard drives using SMART technology. Reason values and th...
combined_dataset/train/non-malicious/sample_13_39.ps1
sample_13_39.ps1
# # Module manifest for module 'OCI.PSModules.Loggingingestion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported...
combined_dataset/train/non-malicious/sample_55_4.ps1
sample_55_4.ps1
import{T as s}from"./index-DktkJoV1.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-edit...
combined_dataset/train/non-malicious/sample_47_50.ps1
sample_47_50.ps1
# # Module manifest for module 'Az.LoadTesting' # # Generated by: Microsoft Corporation # # Generated on: 23/04/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.LoadTesting.psm1' # Version number of this module. ModuleVersion = '1.0.1' # Supported PSEdi...
combined_dataset/train/non-malicious/387.ps1
387.ps1
function BeTrueForAny { [CmdletBinding()] param ( $ActualValue, [scriptblock] $TestScript, [switch] $Negate ) end { $succeeded = $false foreach ($value in $ActualValue) { $variables = [System.Collections.Generic.List[psvariable]]( [psvariable]::new('_', $value)) $succeeded = $Te...
combined_dataset/train/non-malicious/2633.ps1
2633.ps1
function Restore-SqlDbWithMove{ [cmdletbinding()] param([string]$ServerInstance = 'localhost' ,[string]$BackupFile ,[string]$NewDataPath ,[string]$NewLogPath = $NewDataPath ,[string]$OutputPath = 'NoPath' ) $relocate = @() $dbname = (Invoke-Sqlcmd -ServerInstance $ServerInstance -Da...
combined_dataset/train/non-malicious/Re-IP VMs.ps1
Re-IP VMs.ps1
foreach ($entry in (import-csv "spreadsheet.csv")) { $ipScript = @" `$NetworkConfig = Get-WmiObject -Class Win32_NetworkAdapterConfiguration `$NicAdapter = `$NetworkConfig | where {`$_.DHCPEnabled -eq "True"} `$NicAdapter.EnableStatic('$entry.IP','$entry.Netmask') `$NicAdapter.SetGateways('$entry.Gateway') ...
combined_dataset/train/non-malicious/Compare-TwitterNames_2.ps1
Compare-TwitterNames_2.ps1
#This script will compare the names of the people you follow on Twitter #and the people following you. It returns a comparison object consisting #of the Twitter name of a subject and a side indicator - #"<=" means that you are following a subject who is not following you, #"=>" means that you are followed by so...
combined_dataset/train/non-malicious/3543.ps1
3543.ps1
function Test-MabGetContainers { $vault = Get-AzRecoveryServicesVault -ResourceGroupName "pstestrg" -Name "pstestrsvault"; $containers = Get-AzRecoveryServicesBackupContainer ` -VaultId $vault.ID ` -ContainerType "Windows" ` -BackupManagementType "MARS"; Assert-AreEqual $containers[0].FriendlyN...
combined_dataset/train/non-malicious/2302.ps1
2302.ps1
[CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateScript({Test-Connection -ComputerName $_ -Quiet -Count 1 })] [string[]]$Computername, [string]$LogFilePath = 'C:\MyLog.log', [string]$SmtpServer = 'mail.domain.com', [string]$EmailFrom = 'notifications@domain.local', [string]$EmailSubject = 'New Local Ad...
combined_dataset/train/non-malicious/sample_40_26.ps1
sample_40_26.ps1
# # Module manifest for module 'OCI.PSModules.Dataflow' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dataflow.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_56_67.ps1
sample_56_67.ps1
# --------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------------------------------------------...
combined_dataset/train/non-malicious/Get-PDC09Videos_1.ps1
Get-PDC09Videos_1.ps1
#requires -version 2.0 PARAM ( [Parameter(Position=1, Mandatory=$true)] [ValidateSet("wmv","wmvhigh","ppt")] # the "mp4" files aren't there yet [String]$MediaType, [string]$Destination = $PWD ) Import-Module BitsTransfer Push-Location $Destination $Extension = $(switch -wildcard($MediaType){"wmv*"...
combined_dataset/train/non-malicious/4375.ps1
4375.ps1
function Resolve-Location { [CmdletBinding()] [OutputType([string])] Param ( [Parameter(Mandatory=$true)] [string] $Location, [Parameter(Mandatory=$true)] [string] $LocationParameterName, [Parameter()] $Credential, [Parameter()] ...
combined_dataset/train/non-malicious/sophos_mrupdate.ps1
sophos_mrupdate.ps1
<# .SYNOPSIS Updates the Sophos Message Relay configuration. .DESCRIPTION Points the local Message Router service to a new parent relay server. .PARAMETER mrinit The mrinit.conf file to use. .PARAMETER loglevel The current loglevel (used by the Log function). Defaults to 'information' (debug m...
combined_dataset/train/non-malicious/sample_58_62.ps1
sample_58_62.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/4338.ps1
4338.ps1
function Get-ScriptSourceLocation { [CmdletBinding()] Param ( [Parameter()] [String] $Location, [Parameter()] $Credential, [Parameter()] $Proxy, [Parameter()] $ProxyCredential ) $scriptLocation = $null if($Location) ...
combined_dataset/train/non-malicious/sample_10_66.ps1
sample_10_66.ps1
#************************************************ # TS_SDPHTTPTests.ps1 # Version 1.0.1 # Date: 01/18/2013 # Author: andret # Description: Test HTTP connectivity to URLs used in SDP Workflow #************************************************ Import-LocalizedData -BindingVariable ScriptStrings #Networking I...
combined_dataset/train/non-malicious/List AD Computers XLS.ps1
List AD Computers XLS.ps1
# Create a new Excel object using COM $Excel = New-Object -ComObject Excel.Application $Excel.visible = $True # WMI Class variables $WMI_CSP = "Win32_ComputerSystemProduct" $WMI_CS = "Win32_ComputerSystem" $WMI_Disk = "Win32_LogicalDisk" $WMI_OS = "Win32_OperatingSystem" $WMI_Proc = "Win32_Processor" # Set...
combined_dataset/train/non-malicious/sample_59_59.ps1
sample_59_59.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/4444.ps1
4444.ps1
function Get-DynamicOptions { param ( [Microsoft.PackageManagement.MetaProvider.PowerShell.OptionCategory] $category ) Write-Debug ($LocalizedData.ProviderApiDebugMessage -f ('Get-DynamicOptions')) Write-Output -InputObject (New-DynamicOption -Category $category -Name $script:Packa...
combined_dataset/train/non-malicious/sample_30_64.ps1
sample_30_64.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function ConvertTo-ScriptExtent { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding()] [OutputType([System.Management.Automation.Language.IScriptExtent])] param( [Parameter(...
combined_dataset/train/non-malicious/sample_1_29.ps1
sample_1_29.ps1
[dynamic, provider("dcismprovider"), Description( "DCIM_PresenceAndStatusSensor is a derivation of " "CIM_Sensor, and represents a sensor.")] class DCIM_PresenceAndStatusSensor : CIM_Sensor { [ Description ("The current state indicated by the Sensor. This is always one of the \"Possi...
combined_dataset/train/non-malicious/1c3a8f71-b8a5-455c-bc04-31657019f3d5.ps1
1c3a8f71-b8a5-455c-bc04-31657019f3d5.ps1
#Params is file or folder param([string] $PSUnitTestFile, [string] $Category ="All", [switch] $ShowReportInBrowser) Write-Debug "PSUnit.Run.ps1: Parameter `$PSUnitTestFile=`"$PSUnitTestFile`"" Write-Debug "PSUnit.Run.ps1: Parameter `$Category=`"$Category`"" #Don't run the script with an empty path to test file ...
combined_dataset/train/non-malicious/Get-MailAttachment.ps1
Get-MailAttachment.ps1
param([Microsoft.Exchange.WebServices.Data.FileAttachment]$attachment) "Downloading Attachment" $attachment.Load() "Done" $path = "C:\\temp\\"+$attachment.Name "Writing to $path" set-content -value $mm[1].Attachments[0].Content -enc byte -path $path "Done" ii $path
combined_dataset/train/non-malicious/3272.ps1
3272.ps1
class BotConfiguration { [string]$Name = 'PoshBot' [string]$ConfigurationDirectory = $script:defaultPoshBotDir [string]$LogDirectory = $script:defaultPoshBotDir [string]$PluginDirectory = $script:defaultPoshBotDir [string[]]$PluginRepository = @('PSGallery') [string[]]$ModuleManifestsToLo...
combined_dataset/train/non-malicious/2861.ps1
2861.ps1
function Invoke-Task { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$taskName ) Assert $taskName ($msgs.error_invalid_task_name) $taskKey = $taskName.ToLower() $currentContext = $psake.context.Peek() if ($currentContext.aliases.Contains($taskKey)) ...
combined_dataset/train/non-malicious/sample_40_64.ps1
sample_40_64.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_47_77.ps1
sample_47_77.ps1
try { $ScriptsFolder = "$env:SystemDrive\CloudDeployment\Setup\Common" Set-Location -Path $ScriptsFolder Import-Module "$env:SystemDrive\CloudDeployment\Setup\Common\RegistrationHelpers.psm1" $registrationParameters = Get-RegistrationParametersFromEce Validate-GetAccessToken...
combined_dataset/train/non-malicious/2801.ps1
2801.ps1
if (Get-Command logparser.exe) { $lpquery = @" SELECT COUNT(CommandLine) as Cnt, CommandLine, Hash FROM *ProcsWMI.tsv GROUP BY CommandLine, Hash ORDER BY Cnt ASC "@ & logparser -stats:off -i:csv -dtlines:0 -fixedsep:on -rtp:-1 "$lpquery"...
combined_dataset/train/non-malicious/3194.ps1
3194.ps1
Function Wait-Path { [cmdletbinding()] param ( [string[]]$Path, [int]$Timeout = 5, [int]$Interval = 1, [switch]$Passthru ) $StartDate = Get-Date $First = $True Do { if($First -eq $True) { $First = $False ...
combined_dataset/train/non-malicious/sample_65_86.ps1
sample_65_86.ps1
# # Module manifest for module 'OCI.PSModules.Globallydistributeddatabase' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Globallydistributeddatabase.dll' # Version number of this module. ModuleVersion =...
combined_dataset/train/non-malicious/Hostprofile Update GUI.ps1
Hostprofile Update GUI.ps1
################################################################################################################ # # Purpose: Host Profile Update # Author: David Chung # # Ver 1.0 - 09/22/2011 Initial Script # Ver 1.1 - 09/26/2011 Added Full GUI support (Primal Forms) # Ver 1.2 - 09/26/2011 Enabled User an...
combined_dataset/train/non-malicious/1036.ps1
1036.ps1
[CmdletBinding()] param( ) $silkJsonPath = Join-Path -Path $PSScriptRoot -ChildPath 'silk.json' -Resolve $silkJson = Get-Content -Path $silkJsonPath -Raw | ConvertFrom-Json if( -not (Get-Member -InputObject $silkJson -Name 'Navigation') ) { Add-Member -InputObject $silkJson -MemberType NoteProperty ...
combined_dataset/train/non-malicious/3936.ps1
3936.ps1
function Test-LoadBalancerCRUD-Public { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $domainNameLabel = Get-ResourceName $lbName = Get-ResourceName $frontendName = Get-ResourceName $backen...
combined_dataset/train/non-malicious/sample_63_26.ps1
sample_63_26.ps1
# # Module manifest for module 'OCI.PSModules.Opensearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opensearch.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/1598.ps1
1598.ps1
filter propmatch ([string]$match='') { $props = @() $obj = $_ $obj | gm -m *property | % { if ($obj.$($_.name) -match $match) {$props += [string]$_.name} } $obj | select $props }
combined_dataset/train/non-malicious/Get-Scope_1.ps1
Get-Scope_1.ps1
function Get-Scope{ $rtnScope = 0 $global:scope = $false $scope = $true while($($ErrorActionPreference = "silentlycontinue"; switch((get-Variable -Name scope -Scope $rtnScope).value){$null{$true} $true{$true} $false{$ErrorActionPreference = "continue"; return ($rtnScope - 1)}})){ $rtnScope+...
combined_dataset/train/non-malicious/sample_38_2.ps1
sample_38_2.ps1
# # Module manifest for module 'OCI.PSModules.Usage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Usage.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/4194.ps1
4194.ps1
Set-Variable -Name Body -Force Set-Variable -Name EmailAddress -Force Set-Variable -Name EmailAddresses -Force Set-Variable -Name Exclusions -Force Set-Variable -Name LocalAdmin -Force Set-Variable -Name LocalAdmins -Force Set-Variable -Name LogFile -Value $env:windir"\Logs\LocalAdministrators.log" -Force Set-Variab...
combined_dataset/train/non-malicious/sample_33_85.ps1
sample_33_85.ps1
# # Script module for module 'Az.HealthcareApis' that is executed when 'Az.HealthcareApis' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 04/23/2024 13:01:41 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try ...
combined_dataset/train/non-malicious/sample_20_43.ps1
sample_20_43.ps1
#************************************************ # TS_SelectClusterNodes.ps1 # Version 1.0.1 # Date: 02-09-2011 # Author: Andre Teixeira - andret@microsoft.com # Description: This script asks customer to select the cluster nodes on which the diagnostic will obtain data from #*************************************...
combined_dataset/train/non-malicious/Get-DatastoreMostFree.ps1
Get-DatastoreMostFree.ps1
#Parameter- Name of the VMware cluster the VM will be assigned to function Get-DatastoreMostFree ($Cluster, [switch] $Second) { <# .SYNOPSIS Return the datastore in the cluster with the most unprovisioned disk space. This takes thin provisioning into account. .DESCRIPTION Queries all the datastores in the clu...
combined_dataset/train/non-malicious/1454.ps1
1454.ps1
function Install-CFileShare { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Name, [Parameter(Mandatory=$true)] [string] $Path, [string] $Description = '', [st...
combined_dataset/train/non-malicious/Out-Html_2.ps1
Out-Html_2.ps1
################################################################################ # Out-HTML - converts cmdlets help to HTML format # Based on Out-wiki by Dimitry Sotnikov (http://dmitrysotnikov.wordpress.com/2008/08/18/out-wiki-convert-powershell-help-to-wiki-format/) # # Modify the invocation line at the bottom of...
combined_dataset/train/non-malicious/sample_65_77.ps1
sample_65_77.ps1
# Input plugin to collect Windows Event Log messages # This plugin ONLY supports Windows [[inputs.win_eventlog]] ## Telegraf should have Administrator permissions to subscribe for some ## Windows Events channels (e.g. System log) ## LCID (Locale ID) for event rendering ## 1033 to force English language ## 0 ...
combined_dataset/train/non-malicious/sample_13_9.ps1
sample_13_9.ps1
PARAM ( [string] $SiteToCheck = $null ) #************************************************ # DCSiteInfo.ps1 # Version 1.0 # Date: 1/14/2014 # Author: Tim Springston [MS] # Description: This script queries for the computers domain # and returns details about all domain controllers which are in # the same...
combined_dataset/train/non-malicious/3915.ps1
3915.ps1
function Test-ListPriceSheets { $priceSheets = Get-AzConsumptionPriceSheet -Top 5 Assert-NotNull $priceSheets Assert-NotNull $priceSheets.Id Assert-NotNull $priceSheets.Name Assert-NotNull $priceSheets.Type $priceSheetProperties = $priceSheets.PriceSheets Assert-NotNull $priceSheetPrope...
combined_dataset/train/non-malicious/sample_20_40.ps1
sample_20_40.ps1
ConvertFrom-StringData @' id_printsettmpsystem32check_st=One or more TMP file found under system32 folder and this may cause problems to install printer drivers '@ # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8...
combined_dataset/train/non-malicious/ISE-CopyOutPutToEditor_1.ps1
ISE-CopyOutPutToEditor_1.ps1
function ISE-CopyOutPutToEditor () { $count = $psise.CurrentOpenedRunspace.OpenedFiles.count $psIse.CurrentOpenedRunspace.OpenedFiles.Add() $Newfile = $psIse.CurrentOpenedRunspace.OpenedFiles[$count] $Newfile.Editor.Text = $psIse.CurrentOpenedRunspace.output.Text $Newfile.Editor.Focus() } $nu...
combined_dataset/train/non-malicious/sample_15_51.ps1
sample_15_51.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Microsoft.PowerShell.Management\Get-Item function:Clear-Host | Microsoft.PowerShell.Management\Set-Item function:__clearhost function Clear-Host { [Alias('cls')] param() __clearhost if ($host.Runspace.LanguageMode -eq ...
combined_dataset/train/non-malicious/264.ps1
264.ps1
Function Get-HashTableEmptyValue { PARAM([System.Collections.Hashtable]$HashTable) $HashTable.GetEnumerator().name | ForEach-Object -Process { if($HashTable[$_] -eq "" -or $HashTable[$_] -eq $null) { Write-Output $_ } } }
combined_dataset/train/non-malicious/count-object_1.ps1
count-object_1.ps1
#a function to count how many items there are, whether its an array, a collection, or actually just # a single no array/non list/non collection object in which case it would be 1 function count-object ($InputObject) { if ($inputobject -eq $Null ) { return 0} if ($inputobject -is [system.array]) { return $inputob...
combined_dataset/train/non-malicious/sample_21_40.ps1
sample_21_40.ps1
ConvertFrom-StringData @' id_ctsgrouppolicyclient=GroupPolicy Client id_ctsgrouppolicyclientdescription=Collects information about GroupPolicy Client. '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE6...
combined_dataset/train/non-malicious/Get-DellWarranty_2.ps1
Get-DellWarranty_2.ps1
function Get-DellWarranty { <# .Synopsis Provides warranty information for one or more Dell service tags. .Description Queries the Dell Website for a list of service tags and returns the warranty information as a custom object. If a service tag has multiple warranties, they are...
combined_dataset/train/non-malicious/4103.ps1
4103.ps1
[CmdletBinding()] param () function Get-Architecture { [CmdletBinding()][OutputType([string])] param () $OSArchitecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture $OSArchitecture = $OSArchitecture.OSArchitecture Return $OSArchitecture } function Get-MSIInformation { ...
combined_dataset/train/non-malicious/NTFS ACLs Folder Tree.ps1
NTFS ACLs Folder Tree.ps1
####################################### # TITLE: listACL.ps1 # # AUTHOR: Santiago Fernandez Mu±oz # # # # DESC: This script generate a HTML # # report show all ACLs asociated with # # a Folder tree structure starting in # # root specified by the user # #######...
combined_dataset/train/non-malicious/3076.ps1
3076.ps1
$global:ValidatorRoot = Split-Path $MyInvocation.MyCommand.Path BeforeEachFeature { New-Module -Name ValidatorTestDe { . $global:ValidatorRoot\ValidatorDe.ps1 -Verbose } | Import-Module -Global } AfterEachFeature { Remove-Module ValidatorTestDe } Given 'MeinValidator gibt vor, True zurückzugeben'...
combined_dataset/train/non-malicious/sample_48_32.ps1
sample_48_32.ps1
# # Module manifest for module 'Az.DataBoxEdge' # # Generated by: Microsoft Corporation # # Generated on: 5/16/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.DataBoxEdge.psm1' # Version number of this module. ModuleVersion = '1.1.1' # Supported PSEdit...
combined_dataset/train/non-malicious/New-SelfRestartingTask_1.ps1
New-SelfRestartingTask_1.ps1
function New-SelfRestartingTask { <# .Notes For production use you should consider investigating more specific matching in the Query clause. There are many possibilities here: you could watch for instances of a process with specific command-line parameters, or a certain caption, etc. Or, you could match again...
combined_dataset/train/non-malicious/sample_21_57.ps1
sample_21_57.ps1
ConvertFrom-StringData @' id_kb2655998_inactivetsportstitle=Checking for Inactive TS Ports id_kb2655998_inactivetsportsdesc=Checking for the presence of a large number of inactive Terminal Server ports. id_kb2655998_inactivetsportsst=Large number of Inactive Terminal Services ports detected '@ # SIG # Begin sign...
combined_dataset/train/non-malicious/3515.ps1
3515.ps1
function Get-ResourceGroupName { return getAssetName } function Get-ResourceName { return getAssetName } function Get-VirtualNetworkName { return getAssetName } function TestSetup-CreateResourceGroup { $resourceGroupName = Get-ResourceGroupName $rglocation = "West US" $resource...
combined_dataset/train/non-malicious/sample_66_70.ps1
sample_66_70.ps1
# Web Deploy: Powershell script which contains common functionality for other scripts to reference. # Copyright (C) Microsoft Corp. 2010 # # Requirements: IIS 7, Windows Server 2008 (or higher) # Import-LocalizedData -BindingVariable Resources -FileName Resources.psd1 #constants $Global:ScriptError = 0 $Glo...
combined_dataset/train/non-malicious/2147.ps1
2147.ps1
Describe 'conversion syntax' -Tags "CI" { It 'converts array of single enum to bool' { [bool]@([ConsoleColor]::Black) | Should -BeFalse [bool]@([ConsoleColor]::Yellow) | Should -BeTrue } It 'calls virtual method non-virtually' { ([object]"abc").ToString() | Sh...
combined_dataset/train/non-malicious/3107.ps1
3107.ps1
"^(254|252|248|240|224|192|128).0.0.0$|^255.(254|252|248|240|224|192|128|0).0.0$|^255.255.(254|252|248|240|224|192|128|0).0$|^255.255.255.(255|254|252|248|240|224|192|128|0)$"
combined_dataset/train/non-malicious/3747.ps1
3747.ps1
function Test_SetAzureKeyVaultManagedStorageAccountAndRawSasDefinition { $managedStorageSasDefinitionName = Get-ManagedStorageSasDefinitionName 'mngsas1' $paramatersSubCommand = '-Name $($managedStorageSasDefinitionName) -Parameter @{"sasType"="service";"serviceSasType"="blob";"signedResourceTypes"="b";"signedV...
combined_dataset/train/non-malicious/482.ps1
482.ps1
function Remove-PPScriptShortcut{ [CmdletBinding()] param( [Parameter(Mandatory=$true)] [String] $Name ) $ShortcutToRemove = Get-PPScript -Name $Name -Shortcut if($ShortcutToRemove){ Get-ChildItem -Path $PSconfigs.Path -Filter $PSconfigs.Script...
combined_dataset/train/non-malicious/3816.ps1
3816.ps1
function Test-ProximityPlacementGroup { param ($loc) $rgname = Get-ComputeTestResourceName try { [string]$loc = Get-ComputeVMLocation; $loc = $loc.Replace(' ', ''); New-AzResourceGroup -Name $rgname -Location $loc -Force; $...
combined_dataset/train/non-malicious/Import-Asup.ps1
Import-Asup.ps1
Function Import-ASUP { param( [string] $Path ) Begin { Function ConvertTo-Bool($bool) { switch ($bool) { "yes" {return $true} "true" {return $true} "enabled" {return $true} "no" {...
combined_dataset/train/non-malicious/sample_47_15.ps1
sample_47_15.ps1
# # Module manifest for module 'OCI.PSModules.Osuborganizationsubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll' # Version number of this module. ModuleVersion...
combined_dataset/train/non-malicious/AnalizeScript.ps1
AnalizeScript.ps1
<# .SYNOPSIS Analyzes script and gives starting lines & columns of script components .DESCRIPTION AnalizeScript opens a dialog box for user selection; checks that input is a powershell script; parses and agrigates the script components into the following tokens: Unknown(s) Command(s)...
combined_dataset/train/non-malicious/Get-NestedGroups_2.ps1
Get-NestedGroups_2.ps1
<# .SYNOPSIS Enumerate all AD group memberships of an account (including nested membership). .DESCRIPTION This script will return all the AD groups an account is member of. .PARAMETER UserName The username whose group memberships to find. .EXAMPLE .\\Get-NestedGroups.ps1 'johndoe' Name ...
combined_dataset/train/non-malicious/sample_0_68.ps1
sample_0_68.ps1
# <copyright> # INTEL CONFIDENTIAL # # Copyright 2021 Intel Corporation # # This software and the related documents are Intel copyrighted materials, and your use of # them is governed by the express license under which they were provided to you ("License"). # Unless the License provides otherwise, you may not us...
combined_dataset/train/non-malicious/2995.ps1
2995.ps1
Set-StrictMode -Version Latest InModuleScope -ModuleName Pester -ScriptBlock { Describe 'Has-Flag' -Fixture { It 'Returns true when setting and value are the same' { $setting = [Pester.OutputTypes]::Passed $value = [Pester.OutputTypes]::Passed $value | Has-Flag $setting...
combined_dataset/train/non-malicious/2095.ps1
2095.ps1
Describe "Tests for (error, warning, etc) action preference" -Tags "CI" { $commonActionPreferenceParameterTestCases = foreach ($commonParameterName in [System.Management.Automation.Cmdlet]::CommonParameters | Select-String Action) { @{ ActionPreferenceParameterName = $commonParameterName ...
combined_dataset/train/non-malicious/379.ps1
379.ps1
Describe "Register-PSFConfig Unit Tests" -Tag "CI", "Pipeline", "Unit" { BeforeAll { Get-PSFConfig -Module Register-PSFConfig -Force | ForEach-Object { $null = [PSFramework.Configuration.ConfigurationHost]::Configurations.Remove($_.FullName) } } AfterAll { Get-PSFConfig -Module Register-PSFConfig -Force | F...
combined_dataset/train/non-malicious/sample_10_86.ps1
sample_10_86.ps1
#************************************************ # DC_DiskInfo.ps1 # Version 1.0 # Date: 09-05-2023 # Author: Edmund Spatariu # Updated: # Description: This script obtains Disk Info and associate a drive letter with corresponding LUN, saving output to a # file named $ComputerName_DC_DiskInfo.txt ...
combined_dataset/train/non-malicious/ConvertTo-Hex_11.ps1
ConvertTo-Hex_11.ps1
# Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx param ( [string]$SidString ) # Create SID .NET object using SID string provided $sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring # Create a byte array of the proper length $sidBytes = New-Object byte[] ...
combined_dataset/train/non-malicious/sample_47_23.ps1
sample_47_23.ps1
# Localized 04/14/2024 08:54 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=&Tak PromptNoString=&Nie BundleFound=Znaleziono pakiet: {0} PackageFound=Znaleziono pakiet: {0} EncryptedBundleFound=Znaleziono zaszyfrowany zbiór: {0} EncryptedPac...
combined_dataset/train/non-malicious/Search-NetworkService.ps1
Search-NetworkService.ps1
#Define PreReqs $timeStamp = Get-Date -UFormat "%m-%d-%Y-%H-%M" $systemVars = Gwmi Win32_ComputerSystem -Comp "." $userName = $systemVars.UserName $compName = $systemVars.Name #User Vars $serviceName = "Spooler" # Spooler will check the Print Spooler <<< Change To Suit Your needs $errorLog = "C:\\Temp\\Log_"+$...
combined_dataset/train/non-malicious/sample_8_26.ps1
sample_8_26.ps1
#************************************************ # TS_PrintHpzui4wmCheck.ps1 # Version 1.0.1 # Date: 2/29/12 # Author: jasonf # Description: KB947477 Detect the OEM HP driver hpzui4wm.DLL. This driver is known to cause the print spooler to crash or hang. #************************************************ #str...
combined_dataset/train/non-malicious/529.ps1
529.ps1
function Backup-AllSPSites{ [CmdletBinding()] param( [Parameter(Position=0, Mandatory=$true)] [String] $Path ) if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Microsoft.SharePoint.PowerShell"} $SPSites = $SPWebApp | Get-SPsite -Li...
combined_dataset/train/non-malicious/sample_56_58.ps1
sample_56_58.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/sample_48_66.ps1
sample_48_66.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/589.ps1
589.ps1
function Connect-PSS{ param ( [parameter(Mandatory=$true)] [string[]]$Name, [parameter(Mandatory=$false)] [System.Management.Automation.Credential()] $Credential = [System.Management.Automation.PSCredential]::Empty ) $Servers = Get-RemoteConnection ...
combined_dataset/train/non-malicious/3646.ps1
3646.ps1
function Test-CreateJob { try { $a1 = Create-ElasticJobAgentTestEnvironment Test-CreateJobWithDefaultParam $a1 Test-CreateJobWithParentObject $a1 Test-CreateJobWithParentResourceId $a1 Test-CreateJobWithPiping $a1 } finally { Remove-ResourceGroupForTest $a1 } } function Test-GetJ...
combined_dataset/train/non-malicious/sample_60_88.ps1
sample_60_88.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 = '83.3.0' # Supported PSE...
combined_dataset/train/non-malicious/1409.ps1
1409.ps1
filter Unprotect-CString { [CmdletBinding(DefaultParameterSetName='DPAPI')] param( [Parameter(Mandatory = $true, Position=0, ValueFromPipeline = $true)] [string] $ProtectedString, [Parameter(Mandatory=$true,ParameterSetName='RSAByCertificate')] [Security.C...
combined_dataset/train/non-malicious/2109.ps1
2109.ps1
Describe 'Test for cmdlet to support Ordered Attribute on hash literal nodes' -Tags "CI" { BeforeAll { If (-not $IsCoreCLR) { Get-WmiObject -Query "select * from win32_environment where name='TestWmiInstance'" | Remove-WmiObject } } AfterAll { If (-not $IsCoreCLR) { ...
combined_dataset/train/non-malicious/sample_48_95.ps1
sample_48_95.ps1
$url = $args[0] Write-Host "Downloading Microsoft Edge Beta" $wc = New-Object net.webclient $msiInstaller = "$env:temp\microsoft-edge-beta.msi" $wc.Downloadfile($url, $msiInstaller) Write-Host "Installing Microsoft Edge Beta" $arguments = "/i `"$msiInstaller`" /quiet" Start-Process msiexec.exe -ArgumentList $argument...
combined_dataset/train/non-malicious/4086.ps1
4086.ps1
function Invoke-MSI { [CmdletBinding()] param ( [string] $DisplayName, [switch] $Install, [string] $LogDirectory, [switch] $Logging, [ValidateNotNullOrEmpty()][String] $MSIFileName, [string] $MSIFilePath, [ValidateNotNullOrEmpty()][String] $Switches = '/qb- /norestart', [string] ...
combined_dataset/train/non-malicious/sample_39_63.ps1
sample_39_63.ps1
"use strict";(self.webpackChunk_ad_qx_lc_designer=self.webpackChunk_ad_qx_lc_designer||[]).push([[7319],{77319:function(w,i,n){n.r(i),n.d(i,{conf:function(){return y},language:function(){return k}});var l=n(90082);var d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,u=Object.protot...
combined_dataset/train/non-malicious/New-Script 2.ps1
New-Script 2.ps1
## New-Script function ## Creates a new script from the most recent commands in history ################################################################################################## ## Example Usage: ## New-Script ScriptName 4 ## creates a script from the most recent four commands ## New-Script...
combined_dataset/train/non-malicious/1637.ps1
1637.ps1
function Get-BootConfigurationData { param ( $bcdeditpath = (Join-Path $env:SystemRoot 'system32\bcdedit.exe') ) $bootconfigurationdata = iex $bcdeditpath $bootconfigurationdata += '' $hash = $null $result = foreach ($line in $bootconfigurationdata) { if ($line -eq '') { ...
combined_dataset/train/non-malicious/2386.ps1
2386.ps1
function New-PodcastEpisode { [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateScript({ Test-Path -Path $_ -PathType Leaf })] [string]$RssFilePath, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$Title, [Parameter(Mandatory)] [ValidateNotNullOrEmp...