full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/3618.ps1
3618.ps1
function Get-ResourceGroupName { return getAssetName } function Get-ResourceName { return getAssetName } function Get-ProviderLocation($provider) { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { $namespace...
combined_dataset/train/non-malicious/sample_15_34.ps1
sample_15_34.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Find-Ast { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding(PositionalBinding=$false, DefaultParameterSetName='FilterScript')] param( [Parameter(Position=0, ParameterSe...
combined_dataset/train/non-malicious/ADFS local update.ps1
ADFS local update.ps1
Add-PSSnapin Microsoft.Adfs.Powershell Import-Module MSOnline $cred = Get-Credential $AdfsServer = Read-Host "Please type the name of the ADFS server" Write-Host "Connecting to MSOnline..." Connect-MsolService -credential:$cred Write-Host "Setting the local ADFS server..." Set-MSOLADFSContext -Computer:$Ad...
combined_dataset/train/non-malicious/Get-MailboxImportRequest.ps1
Get-MailboxImportRequest.ps1
# .Synopsis # Use the Get-MailboxImportRequestProgress cmdlet to view detailed information about pst import progress. # .Description # The Get-MailboxImportRequestProgress cmdlet displays statistics on imports currently in progress that help determine if a import is likely to complete successfully. To accureatel...
combined_dataset/train/non-malicious/sample_53_97.ps1
sample_53_97.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/Set-Wallpaper (CTP3)_3.ps1
Set-Wallpaper (CTP3)_3.ps1
#requires -version 2.0 ## Set-Wallpaper - set your windows desktop wallpaper ################################################################################################### ## Usage: ## Set-Wallpaper "C:\\Users\\Joel\\Pictures\\Wallpaper\\Dual Monitor\\mandolux-tiger.jpg" "Tile" ## ls *.jpg | get-random ...
combined_dataset/train/non-malicious/PowerCLI 4.1.ps1
PowerCLI 4.1.ps1
$vmPath = "[Storage1] MyVM/MyVM.vmx" $vm = New-VM –VMHost "192.168.1.10" –VMFilePath $vmPath -Name MyVM # Check if there is an error and if so – handle it if (!$?) { if ($error[0].Exception –is [VMware.VimAutomation.ViCore.Types.V1.ErrorHandling.DuplicateName]) { # A VM with the same name already exists. Ch...
combined_dataset/train/non-malicious/sample_13_65.ps1
sample_13_65.ps1
ConvertFrom-StringData @' id_filever=Collecting critical file versions '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC5Phm1j+58Cc4T # lUIb...
combined_dataset/train/non-malicious/chkhash_8.ps1
chkhash_8.ps1
# calculate SHA512 of file. function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.Open...
combined_dataset/train/non-malicious/2056.ps1
2056.ps1
using namespace Microsoft.PowerShell.Commands function PermuteHashtableOnProperty { param([hashtable[]]$Hashtable, [string]$Key, [object]$Value) foreach ($ht in $Hashtable) { $ht.Clone() } foreach ($ht in $Hashtable) { $ht2 = $ht.Clone() $ht2.$Key = $Value ...
combined_dataset/train/non-malicious/sample_17_94.ps1
sample_17_94.ps1
# # Module manifest for module 'OCI.PSModules.Vulnerabilityscanning' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Vulnerabilityscanning.dll' # Version number of this module. ModuleVersion = '80.0.0' #...
combined_dataset/train/non-malicious/sample_66_68.ps1
sample_66_68.ps1
function Get-ALTestRunnerConfigPath { param ( [switch]$ReturnFolderPath ) $ConfigPath = Find-ALTestRunnerConfigInFolder (Get-Location) if ($null -eq $ConfigPath) { $ConfigPath = Find-ALTestRunnerConfigInFolder (Split-Path (Get-Location) -Parent) } if ($null -eq $ConfigPath...
combined_dataset/train/non-malicious/sample_9_22.ps1
sample_9_22.ps1
#************************************************ # TS_FirewallCheck.ps1 # Version 1.0 # Date: 5-1-2012 # Author: davidcop # Description: Checks to see that the Windows Firewall service is running and set to the default start mode of Automatic on 2008/2008 R2 or higher Server #************************************...
combined_dataset/train/non-malicious/sample_25_44.ps1
sample_25_44.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; // services.debug.trace(tname + "=" + val); } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("showEm...
combined_dataset/train/non-malicious/Get-CalendarWeek_2.ps1
Get-CalendarWeek_2.ps1
# Get-CalendarWeek by Holger Adam # Simple function to retrieve the calendar week to a given or the current date. function Get-CalendarWeek { param( $Date = (Get-Date) ) # get current culture object $Culture = [System.Globalization.CultureInfo]::CurrentCulture # retrieve calendar week $Culture....
combined_dataset/train/non-malicious/sample_14_7.ps1
sample_14_7.ps1
ConvertFrom-StringData @' id_wga=Collecting MGADiag id_wgastatus=Running MGADiag.exe '@ # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBtMYXMG...
combined_dataset/train/non-malicious/3015.ps1
3015.ps1
Set-StrictMode -Version Latest Describe 'Describe-Scoped Test Case setup' { BeforeEach { $testVariable = 'From BeforeEach' } $testVariable = 'Set in Describe' It 'Assigns the correct value in first test' { $testVariable | Should -Be 'From BeforeEach' $testVariable = 'Set in It...
combined_dataset/train/non-malicious/Colorize Subversion SVN_5.ps1
Colorize Subversion SVN_5.ps1
# detect source control management software function findscm { $scm = '' :selectscm foreach ($_ in @('svn', 'hg')) { $dir = (Get-Location).ProviderPath.trimEnd("\\") while ($dir.Length -gt 3) { if (Test-Path ([IO.Path]::combine(($dir), ".$_"))) { $scm = $_ break selectscm } $dir =...
combined_dataset/train/non-malicious/621.ps1
621.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "http://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.4.9.zip" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" } $Configs | ForEach-Object{ try{ $_....
combined_dataset/train/non-malicious/2061.ps1
2061.ps1
Describe "InitialSessionState capacity" -Tags CI { BeforeAll { $iss = [initialsessionstate]::CreateDefault() for ($i = 0; $i -lt 5000; $i++) { $ssfe = [System.Management.Automation.Runspaces.SessionStateFunctionEntry]::new("f$i", "'fn f$i'") $iss.Commands.Add($ssfe...
combined_dataset/train/non-malicious/Send-File.ps1
Send-File.ps1
##############################################################################\n##\n## Send-File\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\nSends a file t...
combined_dataset/train/non-malicious/sample_8_90.ps1
sample_8_90.ps1
#************************************************ # RS_BPAinfo.ps1 # 2023-02-20 WalterE mod Trap #we# trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumb...
combined_dataset/train/non-malicious/4367.ps1
4367.ps1
function Get-AvailableScriptFilePath { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter()] [string] $Name ) $scriptInfo = $null $scriptFileName = '*.ps1' $scriptBasePaths = @($script:ProgramFilesScriptsPath, $script:MyDocumentsScriptsPath) $scriptFile...
combined_dataset/train/non-malicious/sample_25_37.ps1
sample_25_37.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ # Loads all Service Fabric SD...
combined_dataset/train/non-malicious/sample_37_20.ps1
sample_37_20.ps1
# # Module manifest for module 'OCI.PSModules.Psql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Psql.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/sample_7_90.ps1
sample_7_90.ps1
#************************************************ # utils_Exchange.ps1 # Version 1.0.1 # Date: 04-12-2013, 2022-07-27 # Author: Jerome COIFFIN - jcoiffin@microsoft.com # Description: Utility functions for use by Exchange SDP 3.0+ manifests #************************************************ #Import-LocalizedDa...
combined_dataset/train/non-malicious/sample_16_71.ps1
sample_16_71.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 = '75.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/1325.ps1
1325.ps1
function Get-CIisWebsite { [CmdletBinding()] [OutputType([Microsoft.Web.Administration.Site])] param( [string] [Alias('SiteName')] $Name ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState ...
combined_dataset/train/non-malicious/sample_17_57.ps1
sample_17_57.ps1
#************************************************ # TS_StoreAppsFailureForDCOMErrorCheck.ps1 # Version 1.0.1 # Date: 3/13/2013 # Author: V-maam # Description: [Idea ID 7544] [Windows] WinStore - Apps do not launch, because "ALL APPLICATIONS PACKAGES" removed from DCOM ACL # Rule number: 7544 # Rule URL: http:...
combined_dataset/train/non-malicious/sample_32_85.ps1
sample_32_85.ps1
trap { # If we except, lets report it visually. Can help with debugging if there IS a problem # in here. Write-Host "EXCEPTION: $($PSItem.ToString())" -ForegroundColor Red Write-Host "$($PSItem.ScriptStackTrace)" Start-Sleep 10 } # Get an environment variable with default value if not present func...
combined_dataset/train/non-malicious/sample_4_54.ps1
sample_4_54.ps1
#************************************************ # DC_BackgroundCollector.ps1 # Version 2.0.0 # Date: 9-23-2011 # Author: Patrick Lewis - patlewis@microsoft.com # Description: This script compresses and collects background process file #************************************************ PARAM($process=$null, $fil...
combined_dataset/train/non-malicious/sample_52_59.ps1
sample_52_59.ps1
# # Module manifest for module 'OCI.PSModules.Networkfirewall' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Networkfirewall.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported P...
combined_dataset/train/non-malicious/4148.ps1
4148.ps1
[CmdletBinding()] param () function Uninstall-MSIbyGUID { [CmdletBinding()] param ( [ValidateNotNullOrEmpty()][String]$GUID, [ValidateNotNullOrEmpty()][String]$Switches ) [string]$DisplayName = ((Get-ChildItem -Path REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserDa...
combined_dataset/train/non-malicious/sample_50_75.ps1
sample_50_75.ps1
# Localized 05/08/2024 05:10 AM (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/Reset SharePoint Alerts.ps1
Reset SharePoint Alerts.ps1
Function Reset-Alerts { <# .Synopsis Resets alerts for the specified site. .Description By default this resets scheduled alerts for the specified site. This can also reset all alerts for the site and/or for a specific user. This is inspired by: http://gallery.technet.microsoft.com/scriptcent...
combined_dataset/train/non-malicious/New-CodeSigningCert_2.ps1
New-CodeSigningCert_2.ps1
## New-CodeSigningCert.ps1 ######################################################################################################################## ## Does the setup needed to self-sign PowerShell scripts ... ## Generates a "test" self-signed root Certificate Authority ## And then generates a code-signing certific...
combined_dataset/train/non-malicious/sample_14_20.ps1
sample_14_20.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/3361.ps1
3361.ps1
function Get-AzureRmStorageAccount { [CmdletBinding()] [Alias("Get-AzStorageAccount")] param( [string] [Parameter(Position=0, ValueFromPipelineByPropertyName=$true)] $ResourceGroupName, [string] [Parameter(Position=1, ValueFromPipelineByPropertyName=$true)] [alias("StorageAccountName")] $Name) BEGIN { ...
combined_dataset/train/non-malicious/sample_44_37.ps1
sample_44_37.ps1
# # Module manifest for module 'OCI.PSModules.Licensemanager' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSE...
combined_dataset/train/non-malicious/315.ps1
315.ps1
function Register-PSFSessionObjectType { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [string] $DisplayName, [Parameter(Mandatory = $true)] [string] $TypeName ) process { [PSFramework.ComputerManagement.ComputerManagementHost]::KnownSessionTypes[$TypeName] = $DisplayName } }
combined_dataset/train/non-malicious/642.ps1
642.ps1
$global:WorkingPath = (Get-Location).Path $global:PSProfile = New-Object PSObject -Property @{ Path = Split-Path $MyInvocation.MyCommand.Definition -Parent GitSource = "https://github.com/janikvonrotz/PowerShell-PowerUp.git" Install = Get-ChildItem -Path (Split-Path $MyInvocation.MyCommand.Definition -Parent)...
combined_dataset/train/non-malicious/sample_35_76.ps1
sample_35_76.ps1
# # Module manifest for module 'OCI.PSModules.Ospgateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ospgateway.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/4329.ps1
4329.ps1
function Test-WebUri { [CmdletBinding()] [OutputType([bool])] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [Uri] $uri ) return ($uri.AbsoluteURI -ne $null) -and ($uri.Scheme -match '[http|https]') }
combined_dataset/train/non-malicious/sample_9_18.ps1
sample_9_18.ps1
#************************************************ # RC_HTTPRedirectionTSGateway.ps1 # Version 1.0 # Date: 5-1-2012 # Author: davidcop # Description: Checks for HTTP redirection on either the /rpc virtual directory or the web site that host the /rpc virtual directory #**********************************************...
combined_dataset/train/non-malicious/2119.ps1
2119.ps1
Describe 'Basic debugger tests' -tag 'CI' { BeforeAll { Register-DebuggerHandler } AfterAll { Unregister-DebuggerHandler } Context 'The value of $? should be preserved when exiting the debugger' { BeforeAll { $testScript = { function Test-Dol...
combined_dataset/train/non-malicious/sample_56_27.ps1
sample_56_27.ps1
# make sure we stop on exceptions $ErrorActionPreference = "Stop" # This object reprents the result value for tab expansion functions when no result is returned. # This is so that we can distinguish it from $null, which has different semantics $NoResultValue = New-Object PSObject -Property @{ NoResult = $true } ...
combined_dataset/train/non-malicious/3241.ps1
3241.ps1
class CommandHistory { [string]$Id [string]$CommandId [string]$CallerId [CommandResult]$Result [ParsedCommand]$ParsedCommand [datetime]$Time CommandHistory([string]$CommandId, [string]$CallerId, [CommandResult]$Result, [ParsedCommand]$ParsedCommand) { $this...
combined_dataset/train/non-malicious/sample_64_34.ps1
sample_64_34.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # UnzipAndCopyMDS.ps1 # Kill all running Monitoring processes an...
combined_dataset/train/non-malicious/Test-FileLock.ps1
Test-FileLock.ps1
filter Test-FileLock { if ($args[0]) {$filepath = gi $(Resolve-Path $args[0]) -Force} else {$filepath = gi $_.fullname -Force} if ($filepath.psiscontainer) {return} $locked = $false trap { Set-Variable -name locked -value $true -scope 1 continue } $inputStream = New-Objec...
combined_dataset/train/non-malicious/3713.ps1
3713.ps1
function Get-ResourceGroupName { return getAssetName } function Get-WorkspaceCollectionName { return getAssetName } function Clean-ResourceGroup($rgname) { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { ...
combined_dataset/train/non-malicious/sample_56_85.ps1
sample_56_85.ps1
# Localized 05/07/2022 06:56 AM (GMT) 303:7.0.30723 CL_LocalizationData.psd1 # Localized 01/04/2013 11:32 AM (GMT) 303:4.80.0411 CL_LocalizationData.psd1 ConvertFrom-StringData @' ###PSLOC Program_Choice_NOTLISTED=Listelenmeyen Version_Choice_DEFAULT=Yok Version_Choice_WIN8RTM=Windows 8 Version_Choice_WIN7RTM=...
combined_dataset/train/non-malicious/sample_61_38.ps1
sample_61_38.ps1
<unk> 0 <s> 0 </s> 0 _t -0 _th -1 _a -2 in -3 er -4 _s -5 ou -6 _w -7 on -8 at -9 _the -10 re -11 an -12 or -13 en -14 _c -15 is -16 _m -17 it -18 ing -19 _f -20 _h -21 _b -22 _I -23 _to -24 es -25 ll -26 _p -27 _d -28 _y -29 nd -30 _o -31 _you -32 ar -33 _l -34 _in -35 _n -36 ed...
combined_dataset/train/non-malicious/sample_64_70.ps1
sample_64_70.ps1
# # Module manifest for module 'OCI.PSModules.Lockbox' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Lockbox.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/sample_62_28.ps1
sample_62_28.ps1
Get-Module | ForEach-Object { Remove-Module -Name $_.Name -Force } $PSModuleAutoloadingPreference = 'none' Import-Module Microsoft.PowerShell.Utility [void][System.Reflection.Assembly]::Load('System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') [void][System.Reflection.Assembly]::Load...
combined_dataset/train/non-malicious/sample_48_77.ps1
sample_48_77.ps1
. $PSScriptRoot\GetModuleExtension.ps1 function Get-PlasterTemplate { [CmdletBinding()] param( [Parameter(Position=0, ParameterSetName="Path", HelpMessage="Specifies a path to a folder containing a Plaster template or multiple template folders. Can also be a path ...
combined_dataset/train/non-malicious/4247.ps1
4247.ps1
Function Get-CreditCardData { param ( [string]$path = $(throw "-path is required";) ) $Excel = New-Object -ComObject Excel.Application $REGEX = [regex]"(?im)(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d...
combined_dataset/train/non-malicious/3251.ps1
3251.ps1
class ParsedCommand { [string]$CommandString [string]$Plugin = $null [string]$Command = $null [string]$Version = $null [hashtable]$NamedParameters = @{} [System.Collections.ArrayList]$PositionalParameters = (New-Object System.Collections.ArrayList) [datetime]$Time = (Get-Date).ToUniversalTi...
combined_dataset/train/non-malicious/4268.ps1
4268.ps1
Function Get-RecentFiles { $obj = New-Object -ComObject WScript.Shell $Path = [System.Environment]::GetFolderPath('Recent') $files = Get-ChildItem -Path $Path | Sort-Object LastAccessTime | Select-Object -Last 50 echo "" echo "[+] Get-RecentFiles" echo "" foreach ($file in $files) { ...
combined_dataset/train/non-malicious/JSON 1.7.ps1
JSON 1.7.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/124.ps1
124.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/Xml Module 6.0.ps1
Xml Module 6.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/sample_25_77.ps1
sample_25_77.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 License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
combined_dataset/train/non-malicious/2254.ps1
2254.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, ParameterSetName="ConfigMgr", HelpMessage="Site server where the SMS Provider is installed")] [parameter(ParameterSetName="WIM")] [ValidateNotNullOrEmpty()] [ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet}...
combined_dataset/train/non-malicious/sample_33_77.ps1
sample_33_77.ps1
# # Module manifest for module 'OCI.PSModules.Apmsynthetics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmsynthetics.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/452.ps1
452.ps1
Register-PSFConfigValidation -Name "integer0to9" -ScriptBlock { Param ( $Value ) $Result = New-Object PSOBject -Property @{ Success = $True Value = $null Message = "" } try { [int]$number = $Value } catch { $Result.Message = "Not an integer: $Value" $Result.Success = $False return $Result } ...
combined_dataset/train/non-malicious/sample_53_36.ps1
sample_53_36.ps1
<TemplateItem> <Name>AI - Chat - Personalized</Name> <IconType>.svg</IconType> <IconData>H4sIAAAAAAAACu1a205sxxF991dMJq9z2X3vtg62DhdbkXBiKbajPEUYJkCMAQEGn/P1WWtVNzMQ&#xD; fCK/RrEtpnvv6u66rqrq7Xdf/vrz1exxc3d/eXO9N3eraT7bXJ/enF1en+/Nv//uq2Wdf/nFZ+/+&#xD; cPiXg+/+/u3R7P7xfPbt9/vHfzqYzZfr9d/CwXp9+N3h7K8/fD1zK7deH/...
combined_dataset/train/non-malicious/2042.ps1
2042.ps1
using namespace System.Management.Automation using namespace System.Management.Automation.Language Describe "SemanticVersion api tests" -Tags 'CI' { Context "Constructing valid versions" { It "String argument constructor" { $v = [SemanticVersion]::new("1.2.3-Alpha-super.3+BLD.a1-xxx.03") ...
combined_dataset/train/non-malicious/744.ps1
744.ps1
function DoSomeThingTo-RSCatalogItem { [CmdletBinding()] param ( [string] $ReportServerUri, [Alias('ReportServerCredentials')] [System.Management.Automation.PSCredential] $Credential, $Proxy ) Begin { $Proxy...
combined_dataset/train/non-malicious/ConvertTo-CliXml.ps1
ConvertTo-CliXml.ps1
function ConvertTo-CliXml { param( [parameter(position=0,mandatory=$true,valuefrompipeline=$true)] [validatenotnull()] [psobject]$object ) begin { $type = [type]::gettype("System.Management.Automation.Serializer") $ctor = $type.getconstructor("instance,nonpubl...
combined_dataset/train/non-malicious/sample_39_51.ps1
sample_39_51.ps1
# # Module manifest for module 'OCI.PSModules.Disasterrecovery' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Disasterrecovery.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported...
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_56_19.ps1
sample_56_19.ps1
# # Module manifest for module 'OCI.PSModules.Stackmonitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Stackmonitoring.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported P...
combined_dataset/train/non-malicious/4304.ps1
4304.ps1
function SuiteSetup { Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue $script:ProgramFilesModulesPath = Get-AllUsersModulesPath $script:MyDocumentsModulesPath = Get-CurrentUserModulesPath ...
combined_dataset/train/non-malicious/sample_47_65.ps1
sample_47_65.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Out-CurrentFile { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding()] param( [Switch]$AsNewFile, [Parameter(ValueFromPipeline, Mandatory = $true)] $...
combined_dataset/train/non-malicious/28.ps1
28.ps1
. $PSScriptRoot\Shared.ps1 Describe 'Default Prompt Tests - NO ANSI' { BeforeAll { [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')] $prompt = Get-Item Function:\prompt $OFS = '' } BeforeEach { $global:GitPromptSet...
combined_dataset/train/non-malicious/16ca876b7bb7ac8c2f362b52.ps1
16ca876b7bb7ac8c2f362b52.ps1
#.Synopsis # Test the HMAC hash(es) of a file #.Description # Takes the HMAC hash of a file using specified algorithm, and optionally, compare it to a baseline hash #.Example # Test-Hash npp.5.3.1.Installer.exe -HashFile npp.5.3.1.release.md5 # # Searches the provided hash file for a line matching the "...
combined_dataset/train/non-malicious/sample_21_10.ps1
sample_21_10.ps1
ConvertFrom-StringData @' progressbar_id_crm_iis7httpcompression_enabled=WCF httpCompression is not enabled on the Microsoft Dynamics CRM 2011 server progressbar_id_crm_iis7httpcompression_enableddesc=While this setting is on the Microsoft CRM Server, it will have a very big impact on the Microsoft CRM 2011 Outlook c...
combined_dataset/train/non-malicious/2195.ps1
2195.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")] [ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})] [ValidateNotNullOrEmpty()] [string]$SiteServer, [parameter(Mandatory=$true, HelpMessag...
combined_dataset/train/non-malicious/sample_19_16.ps1
sample_19_16.ps1
ConvertFrom-StringData @' id_clusterinfo=Cluster Information id_clusterinfoobtaining=Obtaining cluster basic information id_clustername=Cluster Name id_clusterdomain=Cluster Domain id_clustercsv=Shared Volumes id_clustercsvroot=Shared Volumes Root '@ # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHj...
combined_dataset/train/non-malicious/New-MailBoxViaUI.ps1
New-MailBoxViaUI.ps1
# Requires ShowUI 1.3 function New-MailBoxViaUI { $MailboxInfo = UniformGrid -ControlName "GetMailboxInfo" -Columns 2 { Label "First Name:" TextBox -Name FirstName Label "Last Name:" TextBox -Name "LastName" Label "Mailbox Name:" TextBox -Name "Name" But...
combined_dataset/train/non-malicious/4344.ps1
4344.ps1
function Test-ValidManifestModule { [CmdletBinding()] [OutputType([bool])] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $ModuleBasePath, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $ModuleNa...
combined_dataset/train/non-malicious/sample_47_74.ps1
sample_47_74.ps1
<# ------ Input Prompts ------ #> $fields = @( New-Object "System.Management.Automation.Host.FieldDescription" "Input" New-Object "System.Management.Automation.Host.FieldDescription" "Input List" ) $fields[1].SetParameterType([int[]]) $host.UI.Prompt("Caption", "Message", $fields) Get-Credential G...
combined_dataset/train/non-malicious/ASPX Mailbox (6 of 6).ps1
ASPX Mailbox (6 of 6).ps1
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Management.Automation; using System.Management.Automation.Runspaces; using System.Net.Mail; public partial class MailboxTaskResults : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e)...
combined_dataset/train/non-malicious/1889.ps1
1889.ps1
Describe "Get-Random DRT Unit Tests" -Tags "CI" { $testData = @( @{ Name = 'no params'; Maximum = $null; Minimum = $null; GreaterThan = -1; LessThan = ([int32]::MaxValue); Type = 'System.Int32' } @{ Name = 'only positive maximum number'; Maximum = 100; Minimum = $null; GreaterThan = -1; LessThan =...
combined_dataset/train/non-malicious/sample_26_40.ps1
sample_26_40.ps1
# Copyright (C) Intel Corporation,2021 All Rights Reserved. function Invoke-ConfigureTLSServerAuthentication { <# .Synopsis Configures AMT connection to TLS with server authentication. .Description This cmdlet configures the AMT connection to TLS with server authentication. The cmdlet adds the AM...
combined_dataset/train/non-malicious/sample_16_47.ps1
sample_16_47.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; // services.debug.trace(tname + "=" + val); } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("showEm...
combined_dataset/train/non-malicious/sample_57_75.ps1
sample_57_75.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/sample_19_11.ps1
sample_19_11.ps1
#************************************************ # DC_HyperVBasicInfo.ps1 # Version 1.0 # Date: 4-7-2015 # Author: Ryutaro Hayashi <Ryutaro.Hayashi@microsoft.com> # Ported to SDP and included in HyperV SDP by Tim Springston <tspring@microsoft.com> # Description: Data collection for hyperv. #********************...
combined_dataset/train/non-malicious/sample_1_76.ps1
sample_1_76.ps1
ConvertFrom-StringData @' id_kb947477_hpdlltitle=Checking Spooler Service for hpzui4wm.dll id_kb947477_hpdlldescription=Checking for HP driver hpzui4wm.dll loaded in Spooler Service. '@ # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgE...
combined_dataset/train/non-malicious/1725.ps1
1725.ps1
function Get-ServiceNowRequestItem { [OutputType([System.Management.Automation.PSCustomObject])] [CmdletBinding(DefaultParameterSetName, SupportsPaging)] param( [parameter(Mandatory = $false)] [string]$OrderBy = 'opened_at', [parameter(Mandatory = $false)] ...
combined_dataset/train/non-malicious/Get-User_5.ps1
Get-User_5.ps1
function Get-User($user) { # this function should be passed the CN of the user to be returned $dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() $root = [ADSI] "LDAP://$($dom.Name)" $searcher = New-Object System.DirectoryServices.DirectorySearcher $root $searcher.filter = "(&(objec...
combined_dataset/train/non-malicious/1092.ps1
1092.ps1
Set-StrictMode -Version 'Latest' & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1') describe Uninstall-Group { $groupName = 'TestUninstallGroup' $description = 'Used by Uninstall-Group.Tests.ps1' BeforeEach { Install-Group -Name $groupName -Description $descript...
combined_dataset/train/non-malicious/841.ps1
841.ps1
class CsvProcessor { [psobject]$Logger [psobject]$ProcessItemFunction CsvProcessor($logger, $processItemFunction) { $this.Logger = $logger $this.ProcessItemFunction = $processItemFunction } [psobject] LoadCsv($CsvFilePath) { $resolvedCsvPath = Resolve-Path -LiteralP...
combined_dataset/train/non-malicious/Email Forwarding - O365.ps1
Email Forwarding - O365.ps1
<# Author: Matt Schmitt Date: 11/28/12 Version: 1.0 From: USA Email: ithink2020@gmail.com Website: http://about.me/schmittmatt Twitter: @MatthewASchmitt Description A script for forwarding and unforwarding email for users in Office 365. #> Write-Host "" Write-Ho...
combined_dataset/train/non-malicious/sample_1_35.ps1
sample_1_35.ps1
ConvertFrom-StringData @' id_windowsexplorerdatfiles_title=Windows Explorer DAT files id_windowsexplorerdatfiles_status=Collecting Windows Explorer DAT files '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7...
combined_dataset/train/non-malicious/Get-MemoryChart_2.ps1
Get-MemoryChart_2.ps1
#.Synopsis # Draw pie charts of server memory usage by process #.Description # Uses PowerBoots to draw a pipe-chart of each computer's memory use. While you wait for that information # to be gathered, it shows you the latest xkcd comic. ##DEPEND-ON -Function Get-Comic http://poshcode.org/1003 # Uses the Tra...
combined_dataset/train/non-malicious/sample_16_60.ps1
sample_16_60.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/Get-Cert.ps1
Get-Cert.ps1
$UsingStatements = @" using System.Net.Security; using System.Net.Sockets; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; "@ $GetCert = @" RemoteCertificateValidationCallback callback = delegate( object sender, X509Certificate cert, X509Chain chain, SslPoli...
combined_dataset/train/non-malicious/sample_34_50.ps1
sample_34_50.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .Synopsis Group Policy tools use administrative template files (.admx, .adml) to populate policy settings in the user interface. This allows administrators to manage registry-based policy settings. This script installes Powe...
combined_dataset/train/non-malicious/Get-RDPSettings.ps1
Get-RDPSettings.ps1
######################################################################################################################## # NAME # Get-RDPSetting # # SYNOPSIS # Gets some (with filter) or all properties from a RDP file. # # SYNTAX # Edit-RDP [-Path] <string> [-Name] <string> [[-Value] <object>] [-Pas...