full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/Send-Growl 1.0.ps1
Send-Growl 1.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/sample_17_88.ps1
sample_17_88.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # # ModifyProxySettings.ps1 - To be used by the installer - Mo...
combined_dataset/train/non-malicious/New-Zip_1.ps1
New-Zip_1.ps1
Function New-Zip { <# .SYNOPSIS Create a Zip File from any files piped in. .DESCRIPTION Requires that you have the SharpZipLib installed, which is available from http://www.icsharpcode.net/OpenSource/SharpZipLib/ .NOTES File Name : PowerZip.psm1 Author : Christophe CREMON (uxone) - http://powershel...
combined_dataset/train/non-malicious/sample_61_23.ps1
sample_61_23.ps1
# Localized 02/22/2024 08:42 AM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=是(&Y) PromptNoString=否(&N) BundleFound=找到了捆绑: {0} PackageFound=找到包: {0} EncryptedBundleFound=找到加密的包: {0} EncryptedPackageFound=找到加密的包: {0} CertificateFound=找到证书: ...
combined_dataset/train/non-malicious/Route.psm1.ps1
Route.psm1.ps1
None
combined_dataset/train/non-malicious/sample_35_34.ps1
sample_35_34.ps1
ConvertFrom-StringData @' FailoverClustersModuleRequired=O módulo do PowerShell necessário (FailoverClusters) não foi encontrado. Use a Ferramenta Funções e Recursos para instalar: Ferramentas de Administração de Servidor Remoto | Ferramentas de Administração de Recursos | Ferramentas de Cluster de Failover | Módulo d...
combined_dataset/train/non-malicious/1047.ps1
1047.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldGetPowerShellPath { $expectedPath = Join-Path $PSHome powershell.exe if( (Test-OsIs64Bit) -and (Test-PowerShellIs32Bit) ) { $expectedPath = $expect...
combined_dataset/train/non-malicious/3629.ps1
3629.ps1
function Test-ManagedInstanceKeyVaultKeyCI { $params = Get-SqlServerKeyVaultKeyTestEnvironmentParameters $managedInstance = Get-ManagedInstanceForTdeTest $params $mangedInstanceRg = $managedInstance.ResourceGroupName $managedInstanceName = $managedInstance.ManagedInstanceName $managedInstanceResourc...
combined_dataset/train/non-malicious/Get-SqlSpn.ps1
Get-SqlSpn.ps1
####################### <# .SYNOPSIS Gets MSQLSvc service principal names (spn) from Active Directory. .DESCRIPTION The Get-SqlSpn function gets SPNs for MSQLSvc services attached to account and computer objects .EXAMPLE Get-SqlSpn This command gets MSSQLSvc SPNs for the current domain .NOTES Adapted from ht...
combined_dataset/train/non-malicious/sample_8_57.ps1
sample_8_57.ps1
#************************************************ # DC_P2P-Component.ps1 # Version 1.0 # Date: 2009-2014 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about P2P. # Called from: Main Networking Diag #******************************************************* Trap [Exception] ...
combined_dataset/train/non-malicious/sample_39_68.ps1
sample_39_68.ps1
# # Module manifest for module 'OCI.PSModules.Desktops' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Desktops.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/3594.ps1
3594.ps1
function Get-AzureRmSecurityContact-SubscriptionScope { Set-AzSecurityContact -Name "default1" -Email "ascasc@microsoft.com" -Phone "123123123" -AlertAdmin -NotifyOnAlert $contacts = Get-AzSecurityContact Validate-Contacts $contacts } function Get-AzureRmSecurityContact-SubscriptionLevelResource...
combined_dataset/train/non-malicious/sample_21_32.ps1
sample_21_32.ps1
# # Module manifest for module 'Microsoft.SME.AKS' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.AKS.psm1' # Version number of this module. ModuleVersion = '4.11.0' # Supported PSEditions # CompatiblePSEditions = @() # ID used to uniquely ident...
combined_dataset/train/non-malicious/sample_16_11.ps1
sample_16_11.ps1
ConvertFrom-StringData @' id_ctsdnsserver=DNS Server id_ctsdnsserverdescription=Collects information about DNS Server. '@ # SIG # Begin signature block # MIIoOAYJKoZIhvcNAQcCoIIoKTCCKCUCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAI...
combined_dataset/train/non-malicious/sample_39_7.ps1
sample_39_7.ps1
# # Module manifest for module 'OCI.PSModules.Objectstorage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Objectstorage.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_40_67.ps1
sample_40_67.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_59_57.ps1
sample_59_57.ps1
# # Script module for module 'Az.StorageMover' that is executed when 'Az.StorageMover' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 07/04/2024 08:22:41 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try ...
combined_dataset/train/non-malicious/Get-NestedGroups v_3.ps1
Get-NestedGroups v_3.ps1
Function Global:Get-NestedGroups { <# .SYNOPSIS Enumerate all AD group memberships of an account (including nested membership). .DESCRIPTION This script will return the AD group objects for each group the user is a member of. .PARAMETER UserName The username whose group memberships to find. .E...
combined_dataset/train/non-malicious/sample_41_50.ps1
sample_41_50.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ElasticSan.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Module]::Instance # Export nothing to clear implicit expo...
combined_dataset/train/non-malicious/NTFS ACLs Folder Tree_2.ps1
NTFS ACLs Folder Tree_2.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/2296.ps1
2296.ps1
Write-Host -NoNewLine "Enter the path to the MDT Deployment Share (E.g `"\\util01\mdt$`" or `"Z:\`"): " $share = Read-Host Write-Progress -Activity "Driver Scan..." -PercentComplete 0 -Status "Gathering list of devices on this PC..." $devices = (Get-PnpDevice).HardwareID; $devices_list = New-Object -TypeName "System.Co...
combined_dataset/train/non-malicious/4075.ps1
4075.ps1
Function Get-ComputerName { Set-Variable -Name ComputerName -Scope Local -Force $ComputerName = Read-Host "Enter the computer name" Return $ComputerName Remove-Variable -Name ComputerName -Scope Local -Force } Function Get-BitlockeredRecoveryKey { param ([String]$ComputerName) ...
combined_dataset/train/non-malicious/4150.ps1
4150.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()][string] $LogFile, [switch] $Cached, [switch] $Online, [switch] $Full, [string] $OutputFile ) function Get-RelativePath { [CmdletBinding()][OutputType([string])] param () $Path = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent) + "\" Retur...
combined_dataset/train/non-malicious/sample_5_70.ps1
sample_5_70.ps1
ConvertFrom-StringData @' id_ctsmcasecurechannel=Secure Channel Info id_ctsmcagetsecurechannellog=Gathering secure channel information for which domain controllers are being used for authentication. '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgE...
combined_dataset/train/non-malicious/sample_8_31.ps1
sample_8_31.ps1
# # Module manifest for module 'OCI.PSModules.Blockchain' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Blockchain.dll' # Version number of this module. ModuleVersion = '93.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/Get-RecurseMember_1.ps1
Get-RecurseMember_1.ps1
function Get-RecurseMember { <# .Synopsis Does a recursive search for unique users that are members of an AD group. .Description Recursively gets a list of unique users that are members of the specified group, expanding any groups that are members out into their member users. Note: Requires the Ques...
combined_dataset/train/non-malicious/654.ps1
654.ps1
$reportPortalUri = if ($env:PesterPortalUrl -eq $null) { 'http://localhost/reports' } else { $env:PesterPortalUrl } $reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl } Describe "Get-RsRestItemDataSource" { $session = $null $rsFolderPath = ...
combined_dataset/train/non-malicious/sample_50_46.ps1
sample_50_46.ps1
# # Module manifest for module 'OCI.PSModules.Blockchain' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Blockchain.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/SQL-Select.ps1
SQL-Select.ps1
<# .SYNOPSIS Author:...Vidrine Date:.....2012/04/08 .DESCRIPTION Function uses the Microsoft SQL cmdlets 'Invoke-SQLcmd' to connect to a SQL database and run a SELECT statement. Results of the query are returned. Store returned results in a variable to be able to interact with them as an object. .PARAM s...
combined_dataset/train/non-malicious/sample_1_95.ps1
sample_1_95.ps1
ConvertFrom-StringData @' id_tsremoteconfiguringmachine=Configuring %Machine% id_tsremoteconfiguringmachinepspolicy=Configuring PowerShell Execution Policy id_tsremoteerrorsettingpspolicy=Error while setting execution policy on remote system: id_tsremoterestoringmachinepspolicy=Restoring PowerShell Execution Polic...
combined_dataset/train/non-malicious/3356.ps1
3356.ps1
param( [CmdletBinding()] [Parameter(Mandatory = $false, Position = 0)] [switch]$IsNetCore, [Parameter(Mandatory = $false, Position = 1)] [ValidateSet("Debug", "Release")] [string]$BuildConfig, [Parameter(Mandatory = $false, Position = 2)] [ValidateSet("All", "Latest", "...
combined_dataset/train/non-malicious/ConvertFrom-Hashtable_1.ps1
ConvertFrom-Hashtable_1.ps1
# function ConvertFrom-Hashtable { PARAM([HashTable]$hashtable,[switch]$combine) BEGIN { $output = New-Object PSObject } PROCESS { if($_) { $hashtable = $_; if(!$combine) { $output = New-Object PSObject } } $hashtable.GetEnumerator() | ForEach-Object { Add-Member -inputObject $objec...
combined_dataset/train/non-malicious/1944.ps1
1944.ps1
Remove-Variable -Name var1 -ErrorAction SilentlyContinue -Force Describe "Remove-Variable" -Tags "CI" { It "Should throw an error when a dollar sign is used in the variable name place" { New-Variable -Name var1 -Value 4 { Remove-Variable $var1 -ErrorAction Stop } | Should -Throw -ErrorId "VariableNotFound,M...
combined_dataset/train/non-malicious/Get-Netstat 1,_2.ps1
Get-Netstat 1,_2.ps1
$null, $null, $null, $null, $netstat = netstat -a -n -o [regex]$regexTCP = '(?<Protocol>\\S+)\\s+((?<LAddress>(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?))|(?<LAddress>\\[?[0-9a-fA-f]{0,4}(\\:([0-9a-fA-f]{0,4})){1,7}\\%?\\d?\\...
combined_dataset/train/non-malicious/sample_45_54.ps1
sample_45_54.ps1
# region Generated # ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obt...
combined_dataset/train/non-malicious/675.ps1
675.ps1
Describe "Get-RsItemReference" { Context "Get-RsItemReference with min parameters"{ $folderName = 'SutGetRsItemReference_MinParameters' + [guid]::NewGuid() New-RsFolder -Path / -FolderName $folderName $folderPath = '/' + $folderName $localResou...
combined_dataset/train/non-malicious/sample_1_88.ps1
sample_1_88.ps1
#************************************************ # DC_BitsClient-Component.ps1 # Version 1.0: Created # Version 1.1.08.13.14: Added collection for "HKLM\Software\Microsoft\Windows\CurrentVersion\BITS", and updated comment section. # Version 1.2.10.20.14: Added -ErrorAction to correct an exception on some systems. ...
combined_dataset/train/non-malicious/sample_9_66.ps1
sample_9_66.ps1
# Load Common Library # Load Reporting Utilities #_#$debug = $false . ./utils_cts.ps1 $FirstTimeExecution = FirstTimeExecution trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($...
combined_dataset/train/non-malicious/1787.ps1
1787.ps1
Describe "Get-PSProvider" -Tags "CI" { It "Should be able to call with no parameters without error" { { Get-PSProvider } | Should -Not -Throw } It "Should be able to call the filesystem provider" { { Get-PSProvider FileSystem } | Should -Not -Throw $actual = Get-PSProvider FileSystem $actual.Name |...
combined_dataset/train/non-malicious/sample_28_25.ps1
sample_28_25.ps1
parameters: - name: PAT type: string - name: isPreRelease type: string - name: ghCreateRelease type: boolean - name: ghReleaseAddChangeLog type: boolean steps: - pwsh: | $vsixFileName = (Get-ChildItem -File | Select-Object -First 1).Name Write-Host "##vso[task.setvari...
combined_dataset/train/non-malicious/405.ps1
405.ps1
$paramNewVariable = @{ Name = "psframework_killqueue" Value = (New-Object PSFramework.Utility.LimitedConcurrentQueue[int](25)) Option = 'ReadOnly' Scope = 'Script' Description = 'Variable that is used to maintain the list of commands to kill. This is used by Test-PSFFunctionInterrupt. Note: The value tested is t...
combined_dataset/train/non-malicious/sample_48_13.ps1
sample_48_13.ps1
# # Module manifest for module 'OCI.PSModules.Apmconfig' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmconfig.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/Get-Netstat 1,0.ps1
Get-Netstat 1,0.ps1
$null, $null, $null, $null, $netstat = netstat -a -n -o [regex]$regexTCP = '(?<Protocol>\\S+)\\s+(?<LocalAddress>\\S+)\\s+(?<RemoteAddress>\\S+)\\s+(?<State>\\S+)\\s+(?<PID>\\S+)' [regex]$regexUDP = '(?<Protocol>\\S+)\\s+(?<LocalAddress>\\S+)\\s+(?<RemoteAddress>\\S+)\\s+(?<PID>\\S+)' foreach ($net in $netstat) { ...
combined_dataset/train/non-malicious/Import-Delimited 2.ps1
Import-Delimited 2.ps1
################################################################################ ## Convert-Delimiter - A function to convert between different delimiters. ## E.g.: commas to tabs, tabs to spaces, spaces to commas, etc. ################################################################################ ## Written pri...
combined_dataset/train/non-malicious/347.ps1
347.ps1
function Reset-PSFConfig { [CmdletBinding(DefaultParameterSetName = 'Pipeline', SupportsShouldProcess = $true, ConfirmImpact = 'Low', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Reset-PSFConfig')] param ( [Parameter(ValueFromPipeline = $true, ParameterSetName = 'Pipeline')] [PSFramework...
combined_dataset/train/non-malicious/Autoload Module _1.2.ps1
Autoload Module _1.2.ps1
#Requires -Version 2.0 ## Automatically load functions from scripts on-demand, instead of having to dot-source them ahead of time, or reparse them from the script every time. ## Provides significant memory benefits over pre-loading all your functions, and significant performance benefits over using plain scripts. Ca...
combined_dataset/train/non-malicious/sample_2_40.ps1
sample_2_40.ps1
#************************************************ # Gather_Secure_Channel_Info.ps1 # Version 1.1 # Date: 3-30-2012 # Author: Tim Springston # Description: This script queries the currently cached # secure channel information for a domain member # or domain controller. # -Added lo...
combined_dataset/train/non-malicious/Import-GmailFilterXml.ps1
Import-GmailFilterXml.ps1
param ( $Path ) [xml]$flt = Get-Content -Path $Path $title = $flt.feed.title $author = $flt.feed.author.name $output = @() foreach ( $entry in $flt.feed.entry ) { foreach ( $property in $entry.property ) { foreach ($item in $property) { $process = "" | select Id, Updated, Name, Value $process.Id = ...
combined_dataset/train/non-malicious/3523.ps1
3523.ps1
function Get-AzureRmPolicyState-LatestManagementGroupScope { $managementGroupName = Get-TestManagementGroupName $from = Get-TestQueryIntervalStart $policyStates = Get-AzPolicyState -ManagementGroupName $managementGroupName -Top 10 -From $from Validate-PolicyStates $policyStates 10 } function Ge...
combined_dataset/train/non-malicious/ScriptingAgentConfig.xml.ps1
ScriptingAgentConfig.xml.ps1
<?xml version="1.0" encoding="UTF-8" ?> <Configuration version="1.0"> <Feature Name="MailboxProvisioningDatabase" Cmdlets="new-mailbox"> <ApiCall Name="ProvisionDefaultProperties"> #Regex switch to decide mailboxdatabase based on the user specified Name-attribute switch -regex (($provisioningHandler.UserSpec...
combined_dataset/train/non-malicious/3453.ps1
3453.ps1
function Test-DataFlow { $dfname = Get-DataFactoryName $rgname = Get-ResourceGroupName $rglocation = Get-ProviderLocation ResourceManagement $dflocation = Get-ProviderLocation DataFactoryManagement New-AzResourceGroup -Name $rgname -Location $rglocation -Force try ...
combined_dataset/train/non-malicious/sample_44_43.ps1
sample_44_43.ps1
@{ GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @( 'MSFT_MpComputerStatus.cdxml', 'MSFT_Mp...
combined_dataset/train/non-malicious/2099.ps1
2099.ps1
Describe "Tests OutVariable only" -Tags "CI" { BeforeAll { function get-foo1 { [CmdletBinding()] param() "foo" } function get-foo2 { [CmdletBinding()] param() $pscmdlet.writeobject("foo") } ...
combined_dataset/train/non-malicious/633.ps1
633.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "https://github.com/msysgit/msysgit/releases/download/Git-1.9.4-preview20140815/Git-1.9.4-preview20140815.exe" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" ConditionExclusio...
combined_dataset/train/non-malicious/sample_43_93.ps1
sample_43_93.ps1
# # Module manifest for module 'OCI.PSModules.Computeinstanceagent' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Computeinstanceagent.dll' # Version number of this module. ModuleVersion = '77.0.0' # S...
combined_dataset/train/non-malicious/1303.ps1
1303.ps1
function Get-CServiceSecurityDescriptor { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Name ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $sdBytes = [Carbon.Service.Se...
combined_dataset/train/non-malicious/3307.ps1
3307.ps1
function New-PoshBotScheduledTask { [cmdletbinding(SupportsShouldProcess)] param( [string]$Name = 'PoshBot', [string]$Description = 'Start PoshBot', [parameter(Mandatory)] [ValidateScript({ if (Test-Path -Path $_) { if ( (Get-Item -Path $_).Ext...
combined_dataset/train/non-malicious/sample_26_69.ps1
sample_26_69.ps1
# # PowerConsole profile # <# .SYNOPSIS Clear the host content. .DESCRIPTION This function replaces the standard Clear-Host and is aliased by "cls". #> function Clear-Host { $host.PrivateData.ClearHost() } <# .SYNOPSIS Simple path completion function for PowerConsole. #> funct...
combined_dataset/train/non-malicious/258.ps1
258.ps1
Function Get-AccountLockedOut { [CmdletBinding()] param ( [string]$DomainName = $env:USERDOMAIN, [Parameter()] [ValidateNotNullorEmpty()] [string]$UserName = '*', [datetime]$StartTime = (Get-Date).AddDays(-1), $Credential = [System.Management.Automation.PS...
combined_dataset/train/non-malicious/sample_33_52.ps1
sample_33_52.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Test-ScriptExtent { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [OutputType([bool], ParameterSetName='__AllParameterSets')] [OutputType([System.Management.Automation.Language.IScriptExten...
combined_dataset/train/non-malicious/2591.ps1
2591.ps1
function SQL-Query{ param([string]$Query, [string]$SqlServer = $DEFAULT_SQL_SERVER, [string]$DB = $DEFAULT_SQL_DB, [string]$RecordSeparator = "`t") $conn_options = ("Data Source=$SqlServer; Initial Catalog=$DB;" + "Integrated Security=SSPI") $conn = New-Object System.Data.SqlClient.SqlConnection($...
combined_dataset/train/non-malicious/get-smtpconnections.ps1
get-smtpconnections.ps1
param ( $logpath = "C:\\WINDOWS\\system32\\LogFiles\\SMTPSVC1" # can also be fed by "gci $logpath | select basename" but then all logfiles would be read $logfiles = @("ex130213.log","ex130214.log") $regex = "(?:[0-9]{1,3}\\.){3}[0-9]{1,3}" ) $smtphosts = @() foreach ($logFile in $logfiles){ # can also be iter...
combined_dataset/train/non-malicious/sample_0_36.ps1
sample_0_36.ps1
[dynamic, provider("dcismprovider"), Association] class DCIM_LocalPrivilegeMemberOfCollection : CIM_MemberOfCollection { [ Description ("The aggregated member of the Collection."), Key, Override ("Member") ] CIM_ManagedElement REF Member; [ Aggregate, ...
combined_dataset/train/non-malicious/2311f39b-7495-4f1a-9a8b-bc425f057624.ps1
2311f39b-7495-4f1a-9a8b-bc425f057624.ps1
function Get-EasterWestern { Param( [Parameter(Mandatory=$true)] [int] $Year ) $a = $Year % 19 $b = [Math]::Floor($Year / 100) $c = $Year % 100 $d = [Math]::Floor($b / 4) $e = $b % 4 $f = [Math]::Floor(($b + 8) / 25) $g = [Math]::Floor((($b - $f + 1) / 3)) $h = ((19 ...
combined_dataset/train/non-malicious/Get-Netstat 1,_1.ps1
Get-Netstat 1,_1.ps1
$null, $null, $null, $null, $netstat = netstat -a -n -o [regex]$regexTCP = '(?<Protocol>\\S+)\\s+((?<LAddress>(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?))|(?<LAddress>\\[?[0-9a-fA-f]{0,4}(\\:([0-9a-fA-f]{0,4})){1,7}\\%?\\d?\\...
combined_dataset/train/non-malicious/PS2WCF_3.ps1
PS2WCF_3.ps1
# Call WCF Services With PowerShell V1.0 22.12.2008 # # by Christian Glessner # Blog: http://www.iLoveSharePoint.com # Twitter: http://twitter.com/cglessner # Codeplex: http://codeplex.com/iLoveSharePoint # # requires .NET 3.5 # load WCF assemblies [void][System.Reflection.Assembly]::LoadWithPartialName("Sy...
combined_dataset/train/non-malicious/674.ps1
674.ps1
Function Create-PSCredential { param( [Parameter(Mandatory = $True)] [string]$UserName, [Parameter(Mandatory = $True)] [string]$Password ) $SecurePassword = ConvertTo-SecureString $Password -AsPlainText -Force $ps_credential = New-Object Syste...
combined_dataset/train/non-malicious/336b281d-5018-4ca9-a92e-baf5152f59a3.ps1
336b281d-5018-4ca9-a92e-baf5152f59a3.ps1
function Get-Installed { <# .SYNOPSIS This function lists data found in the registry associated with installed programs. .DESCRIPTION Describe the function in more detail Author: Stan Miller .EXAMPLE Get all apps whose display names start with a specific string and display all valuenam...
combined_dataset/train/non-malicious/sample_5_34.ps1
sample_5_34.ps1
# # Module manifest for module 'OCI.PSModules.Datalabelingservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datalabelingservice.dll' # Version number of this module. ModuleVersion = '92.1.0' # Sup...
combined_dataset/train/non-malicious/2535.ps1
2535.ps1
$LastDayOfMonth = (Get-Date -Year (Get-Date).Year -Month (Get-Date).Month -Day 1 -DisplayHint Date).AddMonths(1).AddDays(-1) Write-Host ($lastDayOfMonth).Date $DateDiff1 = New-TimeSpan $(Get-Date -month 9 -day 29 -year 2011) $lastDayOfMonth $DateDiff2 = New-TimeSpan $(Get-Date -month 9 -day 28 -year 2011) $l...
combined_dataset/train/non-malicious/sample_30_73.ps1
sample_30_73.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 = '73.1.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_56_57.ps1
sample_56_57.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the \"License\"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.a...
combined_dataset/train/non-malicious/1393.ps1
1393.ps1
function Get-CDscError { [CmdletBinding(DefaultParameterSetName='NoWait')] [OutputType([Diagnostics.Eventing.Reader.EventLogRecord])] param( [string[]] $ComputerName, [DateTime] $StartTime, [DateTime] $EndTime, [Para...
combined_dataset/train/non-malicious/sample_57_57.ps1
sample_57_57.ps1
/s6#!\a[)+>5Gl2BY1I+?Vb/0/+Lsrr<!,rsU>! %0/4S.+?ht34?O`>0H_eCs"FI-!@]-E0d&Ct5!C)O4<Q:2+=R6h+;H"6.3L8u+?1K-4s2sM+>5Dk./s5h,p4N`+>5Gl3$:CK+?Vb/ %0/+Lsrr<!$rrabn0/4S0+?ht34?O`>0H_eCrrAeoUF@<=0d&J!5!C)O4<Q:2+=R6hs5j:B.3L8u+?:Q.4s2sM+>5Dk./s8H"oe`T %+>5Gl0ea_64s2sM+>5Dk./s5HU&^o:+>5Gl0ea_64s2sM+>5Dk./s5HYQ1mV+>5Gl0ea_64s2sM...
combined_dataset/train/non-malicious/3174.ps1
3174.ps1
function Get-ADSIObject { [cmdletbinding(DefaultParameterSetName='SAM')] Param( [Parameter( Position=0, Mandatory = $true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, ParameterSetName='SAM')] ...
combined_dataset/train/non-malicious/sample_35_61.ps1
sample_35_61.ps1
# # Module manifest for module 'OCI.PSModules.Mediaservices' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Mediaservices.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEdi...
combined_dataset/train/non-malicious/TabExpansion for V2CTP_5.ps1
TabExpansion for V2CTP_5.ps1
## Tab-Completion ################# ## For V2CTP3. ## This won't work on V1 and V2CTP and V2CTP2. ## 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...
combined_dataset/train/non-malicious/Set-Domain_5.ps1
Set-Domain_5.ps1
function Set-Domain { param( [switch]$help, [string]$domain=$(read-host "Please specify the domain to join"), [System.Management.Automation.PSCredential]$credential = $(Get-Credential) ) $usage = "`$cred = get-credential `n" $usage += "Set-Domain -domain MyDomain -credential `$cred`n" if ($hel...
combined_dataset/train/non-malicious/Xml Module 5.0.ps1
Xml Module 5.0.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/3670.ps1
3670.ps1
function Test-AdvancedDataSecurityPolicyTest { $testSuffix = getAssetName Create-AdvancedDataSecurityTestEnvironment $testSuffix $params = Get-SqlAdvancedDataSecurityTestEnvironmentParameters $testSuffix try { $policy = Get-AzSqlServerAdvancedDataSecurityPolicy -ResourceGroupName $params.rgn...
combined_dataset/train/non-malicious/773.ps1
773.ps1
param($buildVersion = $null) $releasePath = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\release") $binariesToSignPath = [System.IO.Path]::GetFullPath("$releasePath\BinariesToSign") $unpackedPackagesPath = [System.IO.Path]::GetFullPath("$releasePath\UnpackedPackages") mkdir $releasePath -Force | Out-Null if (...
combined_dataset/train/non-malicious/sample_31_22.ps1
sample_31_22.ps1
/*! For license information please see 2248.js.LICENSE.txt */ "use strict";(self.webpackChunkeraserlabs=self.webpackChunkeraserlabs||[]).push([[2248],{72248:(e,s,n)=>{n.r(s),n.d(s,{conf:()=>t,language:()=>o});var t={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments...
combined_dataset/train/non-malicious/sample_46_59.ps1
sample_46_59.ps1
#!powershell # Copyright: (c) 2019, Varun Chopra (@chopraaa) <v@chopraaa.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #AnsibleRequires -CSharpUtil Ansible.Basic #AnsibleRequires -OSVersion 6.2 Set-StrictMode -Version 2 $ErrorActionPreference = "Stop" $spec = @{ ...
combined_dataset/train/non-malicious/sample_38_49.ps1
sample_38_49.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Set-AMTSystemDefense { <# .Synopsis Enables Intel Active Management Technology System Defense .Description This CmdLet disables network access using Intel Active Management Technology (AMT) System Defense from clients tha...
combined_dataset/train/non-malicious/3201.ps1
3201.ps1
function Add-ObjectDetail { [CmdletBinding()] param( [Parameter( Mandatory = $true, Position=0, ValueFromPipeline=$true )] [ValidateNotNullOrEmpty()] [psobject[]]$InputObject, [Parameter( Mandatory = $false, ...
combined_dataset/train/non-malicious/1779.ps1
1779.ps1
return Set-Variable dateInFuture -option Constant -value "12/12/2036 09:00" Set-Variable dateInPast -option Constant -value "12/12/2010 09:00" Set-Variable dateInvalid -option Constant -value "12/12/2016 25:00" function RemoveTestUsers { param([string] $basename) $results = Get-LocalUser $basename* ...
combined_dataset/train/non-malicious/Get-Arguments.ps1
Get-Arguments.ps1
##############################################################################\n##\n## Get-Arguments\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nUses comma...
combined_dataset/train/non-malicious/sample_15_38.ps1
sample_15_38.ps1
# # Module manifest for module 'OCI.PSModules.Databasemigration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasemigration.dll' # Version number of this module. ModuleVersion = '73.1.0' # Support...
combined_dataset/train/non-malicious/20498039475807687.ps1
20498039475807687.ps1
# Requires a connection to Exchange Server, or Exchange Management Shell $s = New-PSSession -ConfigurationName Microsoft.Exchange -Name ExchMgmt -ConnectionUri http://ex14.domain.local/PowerShell/ -Authentication Kerberos Import-PSSession $s # Get all Client Access Server properties for all mailboxes with an Activ...
combined_dataset/train/non-malicious/Sort-ISE.ps1
Sort-ISE.ps1
function Sort-ISE () { <# .SYNOPSIS ISE Extension sort text starting at column $start comparing the next $length characters .DESCRIPTION ISE Extension sort text starting at column $start comparing the next $length characters Leftmost column is column 1 .NOTES File Name : Sort_IS...
combined_dataset/train/non-malicious/sample_0_71.ps1
sample_0_71.ps1
# # # Rule to look for organizations that are newer than the deployment # # Created: 5/24/2012 # Author: Jonathan Randall #****************************************************************************************************************** #region Functions function GetOrganizationData([string] $conn_string) ...
combined_dataset/train/non-malicious/4162.ps1
4162.ps1
$RebootThreshold = 14 $Today = Get-Date $Architecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture $Architecture = $Architecture.OSArchitecture $LastReboot = get-winevent -filterhashtable @{ logname = 'system'; ID = 1074 } -maxevents 1 -ErrorAction SilentlyContinue if ($Architecture...
combined_dataset/train/non-malicious/sample_37_6.ps1
sample_37_6.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Import-EditorCommand { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [OutputType([Microsoft.PowerShell.EditorServices.Extensions.EditorCommand, Microsoft.PowerShell.EditorServices])] [Cmdle...
combined_dataset/train/non-malicious/sample_50_26.ps1
sample_50_26.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_50_7.ps1
sample_50_7.ps1
# # Module manifest for module 'OCI.PSModules.Functions' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Functions.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/791.ps1
791.ps1
function Join-ScriptExtent { [CmdletBinding()] [OutputType([System.Management.Automation.Language.IScriptExtent])] param( [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] [System.Management.Automation.Language.IScriptExtent[]] $Extent ) begin { ...
combined_dataset/train/non-malicious/Import-CSV.ps1
Import-CSV.ps1
Param($file,$headers) # Check for Input and fill $data if($input){$data = @();$input | foreach-Object{$data += $_}} # Check for File and Test the Path if($file) { if(Test-Path $file) { # Check for Headers... if none use import-csv if(!$headers) { import-Csv $data...
combined_dataset/train/non-malicious/sample_64_11.ps1
sample_64_11.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="$basedir\..\..\..\..\..\esbuild@0.20.2\node_modules" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux builds of Nod...
combined_dataset/train/non-malicious/sample_41_15.ps1
sample_41_15.ps1
# # Module manifest for module 'PowerShellProTools' # # Generated by: Ironman Software, LLC # # Generated on: 2/20/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'PowerShellProTools.psm1' # Version number of this module. ModuleVersion = '2023.12.0' # Supp...
combined_dataset/train/non-malicious/sample_3_0.ps1
sample_3_0.ps1
# # Module manifest for module 'OCI.PSModules.Identitydomains' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Identitydomains.dll' # Version number of this module. ModuleVersion = '92.1.0' # Supported P...