full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_10_64.ps1
sample_10_64.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/Set-TopMost_1.ps1
Set-TopMost_1.ps1
#Requires -Version 2.0 $signature = @" [DllImport("user32.dll")] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); public static IntPtr FindWindow(string windowName){ return FindWindow(null,windowName); } [DllImport("user32.dll")] public static extern bool Se...
combined_dataset/train/non-malicious/format-iislog for AWStat_1.ps1
format-iislog for AWStat_1.ps1
param ( [Parameter( Mandatory=$true, Position = 0, ValueFromPipeline=$true, HelpMessage="Specifies the path to the IIS *.log file to import. You can also pipe a path to Import-Iss-Log." )] [ValidateNotNullOrEmpty()] [string] $Path, [Parameter( Mandatory=$true, Position = 1, Value...
combined_dataset/train/non-malicious/sample_17_90.ps1
sample_17_90.ps1
#!powershell # -*- coding: utf-8 -*- # (c) 2022, John McCall (@lowlydba) # (c) 2021, Sudhir Koduri (@kodurisudhir) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #AnsibleRequires -CSharpUtil Ansible.Basic #AnsibleRequires -PowerShell ansible_collections.lowlydba.sqlserver...
combined_dataset/train/non-malicious/sample_47_31.ps1
sample_47_31.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function set-AMTMPS { <# .Synopsis Set proxy information for the Intel Fast Call for Help Management Presence Server (MPS) interface .Description Set proxy information for the Intel Fast Call for Help Management Presence Server (M...
combined_dataset/train/non-malicious/sample_46_46.ps1
sample_46_46.ps1
# Localized 12/03/2020 06:20 PM (GMT) 303:4.80.0411 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/sample_63_29.ps1
sample_63_29.ps1
# Import the helper functions Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [parameter(Mandatory = $true)] [System.String] $Category ) #Write-Verbose "Use this cmdlet t...
combined_dataset/train/non-malicious/sample_59_12.ps1
sample_59_12.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # RemoveMDS.ps1 # Kill all Monitoring processes and clean up tra...
combined_dataset/train/non-malicious/sample_40_47.ps1
sample_40_47.ps1
param ( [switch] $Full = $false, [string] $Output = "$($env:TEMP)\telemetry", [string] $XLabel = "0" ) # mappings of WMI class $topic_class = @{ system = 'win32_computersystem' cpu = 'win32_processor' os = 'win32_operatingsystem' disk = 'win32_logical...
combined_dataset/train/non-malicious/sample_62_27.ps1
sample_62_27.ps1
@{ GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Get-WinEvent", "New-WinEvent", "Get-C...
combined_dataset/train/non-malicious/sample_48_2.ps1
sample_48_2.ps1
function Invoke-RunTests { Param( [Parameter(Mandatory = $true)] $ContainerName, [Parameter(Mandatory = $false)] $Tenant, [Parameter(Mandatory = $true)] $CompanyName, [Parameter(Mandatory = $false)] [pscredential]$Credential, [Paramet...
combined_dataset/train/non-malicious/sample_4_91.ps1
sample_4_91.ps1
// ================================================================== // DCIM_ChassisLogEntry // ================================================================== [dynamic, provider("dcismprovider"), Description ( "A class derived from LogEntry " "to the entries in the Chassis Log." ) ]...
combined_dataset/train/non-malicious/WPFTableSpace.ps1
WPFTableSpace.ps1
#Usage: ./WPFTableSpace.ps1 'Z002\\SqlExpress' AdventureWorks #Note: Requires .NET 3.5, Visifire Charts (tested on v2.1.0), Powerboots (tested on v0.1), and SQLPSX (tested on v1.5) param($sqlserver=$(throw 'sqlserver is required.'),$dbname=$(throw 'dbname is required.'),$top=10) $libraryDir = Convert-Path (Resolve...
combined_dataset/train/non-malicious/Resolve-Aliases _4.7.ps1
Resolve-Aliases _4.7.ps1
#requires -version 2.0 ## ResolveAliases Module v 1.7 ######################################################################################################################## ## Sample Use: ## Resolve-Aliases Script.ps1 | Set-Content Script.Resolved.ps1 ## ls *.ps1 | Resolve-Aliases -Inplace ##############...
combined_dataset/train/non-malicious/259.ps1
259.ps1
function Get-ADSiteAndSubnet { [CmdletBinding()] PARAM() BEGIN {Write-Verbose -Message "[BEGIN] Starting Script..."} PROCESS { TRY{ $Forest = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest() $SiteInfo = [System.DirectoryServices.Acti...
combined_dataset/train/non-malicious/sample_54_56.ps1
sample_54_56.ps1
@{ GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" NestedModules="Microsoft.PowerShell.Commands.Management.dll" HelpInfoURI = 'https://aka...
combined_dataset/train/non-malicious/sample_2_93.ps1
sample_2_93.ps1
#************************************************ # TS_TCPIPSettingsCheck.ps1 # Version 1.0.1 # Date: 03-27-2011 # Author: v-anecho # Description: Checks if a Kyocera print driver is installed then checks if KB982728 is installed #************************************************ Import-LocalizedData -BindingV...
combined_dataset/train/non-malicious/sample_27_77.ps1
sample_27_77.ps1
# # Module manifest for module 'OCI.PSModules.Dataintegration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dataintegration.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported P...
combined_dataset/train/non-malicious/sample_42_96.ps1
sample_42_96.ps1
function Add-WACACAdministrators { <# .SYNOPSIS Adds administrators .DESCRIPTION Adds administrators .ROLE Administrators #> Param ( [Parameter(Mandatory=$true)] [String] $usersListString ) $usersToAdd = ConvertFrom-Json $usersListString $adminGroup = Get-LocalGroup | Where-Object SI...
combined_dataset/train/non-malicious/Netapp SDK_1.ps1
Netapp SDK_1.ps1
#Jason Ochoa #3/3/2010 #This script requires the DLL from the website below. #http://communities.netapp.com/docs/DOC-1110 #connection to file filer #$null = [reflection.assembly]::loadfile('C:\\admin\\ManageOntap.dll') #$pvflrtst = New-Object netapp.manage.naserver('pvflrtst',1,0) #$pvflrtst.setadminuser("z057...
combined_dataset/train/non-malicious/4090.ps1
4090.ps1
[CmdletBinding()] param () cls $LocalPassword = ((manage-bde -protectors -get ($env:ProgramFiles).split('\')[0] -id ((Get-WmiObject -Namespace 'Root\cimv2\Security\MicrosoftVolumeEncryption' -Class 'Win32_EncryptableVolume').GetKeyProtectors(3).volumeKeyprotectorID)).trim() | Where-Object { $_.Trim() -ne '' })[-1] $...
combined_dataset/train/non-malicious/sample_37_93.ps1
sample_37_93.ps1
# # Module manifest for module 'OCI.PSModules.Marketplacepublisher' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Marketplacepublisher.dll' # Version number of this module. ModuleVersion = '83.2.0' # S...
combined_dataset/train/non-malicious/sample_16_82.ps1
sample_16_82.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.DesktopVirtualization.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.DesktopVirtualization.internal.psm1' if(Test-Path $int...
combined_dataset/train/non-malicious/4255.ps1
4255.ps1
function Set-LHSTokenPrivilege { [cmdletbinding( ConfirmImpact = 'low', SupportsShouldProcess = $false )] [OutputType('System.Boolean')] Param( [Parameter(Position=0,Mandatory=$True,ValueFromPipeline=$False,HelpMessage='An Token Privilege.')] [ValidateSet( "SeAssignPrimaryTokenPrivil...
combined_dataset/train/non-malicious/HEX string to SID string.ps1
HEX string to SID string.ps1
Function EndianReverse ($strHex) { $intCounter=$strHex.length-1 do { $reverse=$reverse+$strHex.substring($intCounter-1, 2) $intCounter=$intCounter-2 } until ($intCounter -eq -1) return $reverse } Function hex2sid ($strHex) { $intSidVersionLength = 2 $intSubAuthorityCountLength = 2 $in...
combined_dataset/train/non-malicious/sample_60_80.ps1
sample_60_80.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/Product key_3.ps1
Product key_3.ps1
from System import Array, Char, Console from System.Collections import ArrayList from Microsoft.Win32 import Registry def DecodeProductKey(digitalProductID): map = ("BCDFGHJKMPQRTVWXY2346789").ToCharArray() key = Array.CreateInstance(Char, 29) raw = ArrayList() i = 52 while i < 67: raw...
combined_dataset/train/non-malicious/Set-Wallpaper (CTP2)_1.ps1
Set-Wallpaper (CTP2)_1.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/Test-ADCredentials_1.ps1
Test-ADCredentials_1.ps1
Function Test-ADCredentials { Param($username, $password, $domain) Add-Type -AssemblyName System.DirectoryServices.AccountManagement $ct = [System.DirectoryServices.AccountManagement.ContextType]::Domain $pc = New-Object System.DirectoryServices.AccountManagement.PrincipalContext($ct, $domain) New-Object PSOb...
combined_dataset/train/non-malicious/sample_20_53.ps1
sample_20_53.ps1
function New-AzDataProtectionBackupInstance { [OutputType('')] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Configures Backup for supported azure resources')] param( [Parameter(Mandatory=$false, Help...
combined_dataset/train/non-malicious/3971.ps1
3971.ps1
function Test-ExpressRouteServiceProviderList { $providers = Get-AzExpressRouteServiceProvider Assert-NotNull $providers Assert-AreNotEqual 0 @($providers).Count Assert-NotNull $providers[0].Name Assert-NotNull $providers[0].PeeringLocations Assert-NotNull $providers[0].BandwidthsOffered Ass...
combined_dataset/train/non-malicious/4473.ps1
4473.ps1
$configFile = [System.IO.Path]::ChangeExtension($MyInvocation.MyCommand.Path, 'json') if (Test-Path -Path $configFile) { $ConfigurationData = Get-Content -Path $configFile | ConvertFrom-Json } else { $ConfigurationData = @{ AllNodes = @( @{ NodeName = 'localho...
combined_dataset/train/non-malicious/sample_1_47.ps1
sample_1_47.ps1
ConvertFrom-StringData @' id_dberrcollecting=Collecting catalog registration log files id_dberrcollectingdesc=Collecting DBErr.txt from \\Windows\\System32\\catroot2 '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEA...
combined_dataset/train/non-malicious/sample_40_84.ps1
sample_40_84.ps1
const debug = ( typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ) ? (...args) => console.error('SEMVER', ...args) : () => {} module.exports = debug // SIG // Begin signature block // SIG // MIIoQAYJKoZIhvcNAQcCoIIoMTCCKC0CAQExDzANBglg // ...
combined_dataset/train/non-malicious/1096.ps1
1096.ps1
function Test-FunctionsShouldUseUseCallerPreference { $files = Get-ChildItem -Path (Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon\Functions\*.ps1') -File | Where-Object { $_.BaseName -ne 'Use-CallerPreference' } | Where-Object { -not ($_ | Select-String -Pattern 'Us...
combined_dataset/train/non-malicious/sample_48_64.ps1
sample_48_64.ps1
# # Module manifest for module 'OCI.PSModules.Dts' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dts.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/521.ps1
521.ps1
function Move-SPList{ param( [Parameter(Mandatory=$true)] [String] $ListUrl, [Parameter(Mandatory=$true)] [String] $WebUrl, [Switch] $NoFileCompression ) if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Mi...
combined_dataset/train/non-malicious/The PowerShell Talk Xen_1.ps1
The PowerShell Talk Xen_1.ps1
#The PowerShell Talk #Demo 2 - VM Easy Bake Oven #XenServer #Connect to XenServer Get-Credential | connect-Xenserver -Url http://XenServer_URL/sdk #Create the new VM Create-XenServer:VM -NameLabel "Dave" -VCPUsAtStartup 1 -MemoryDynamicMax 536870912 -MemoryStaticMax 536870912 -MemoryDynamicMin 536870912 -Memo...
combined_dataset/train/non-malicious/sample_8_33.ps1
sample_8_33.ps1
#************************************************ # TS_HyperVXeon5500Check.ps1 # Version 1.0.1 # Date: 02-27-2011 # Author: Andre Teixeira - andret@microsoft.com # Description: This scripts checks the processors is an Intel Xeon processor 5500 series # If so, check binary versions of Hvax64.exe, Hv...
combined_dataset/train/non-malicious/sample_49_2.ps1
sample_49_2.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Set-ScriptExtent { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding(PositionalBinding = $false, DefaultParameterSetName = '__AllParameterSets')] param( [Parameter(Posit...
combined_dataset/train/non-malicious/sample_10_29.ps1
sample_10_29.ps1
#************************************************ # TS_ServicingCorruptionCheck.ps1 # Version 1.0.1 # Date: 12/28/2012 # Author: v-kaw # Description: [Idea ID 5712] [Windows] Run Dism checkhealth on Win8 or 2012 to detect possible servicing corruption # Rule number: 5712 # Rule URL: http://sharepoint/sites/ru...
combined_dataset/train/non-malicious/sample_65_56.ps1
sample_65_56.ps1
# # Script module for module 'Az.Migrate' that is executed when 'Az.Migrate' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 07/04/2024 08:22:40 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try { ...
combined_dataset/train/non-malicious/sample_41_80.ps1
sample_41_80.ps1
/////////////////////////////////////////////////////////////////////////////// // Helper to set a designer prop /////////////////////////////////////////////////////////////////////////////// function setDesignerProp(tname, ttype, tvalue) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)...
combined_dataset/train/non-malicious/sample_10_27.ps1
sample_10_27.ps1
ConvertFrom-StringData @' id_templateregkeycheck=Check for Registry Key id_templateregkeycheckdesc=Checking if HKLM\\SOFTWARE\\Microsoft\\Test\\DetectRootCause exists '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwE...
combined_dataset/train/non-malicious/sample_64_86.ps1
sample_64_86.ps1
<# .SYNOPSIS UninstallSyncServiceIIS.ps1 script file This is a place-holder file only fofr agent patch build purposes #> Write-Host "This file functionality is deprecated and is place-holder only" # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # ...
combined_dataset/train/non-malicious/341.ps1
341.ps1
function Import-PSFConfig { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingEmptyCatchBlock", "")] [CmdletBinding(DefaultParameterSetName = "Path", HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Import-PSFConfig')] param ( [Parameter(Mandatory = $true, ValueFromPipeline = $t...
combined_dataset/train/non-malicious/Get-APOD.ps1
Get-APOD.ps1
<# .SYNOPSIS Gets the Astronomy Picture of the Day and sets it as your wallpaper. .DESCRIPTION Get-Apod parses the Astronomy Picture of the Day website and downloads the current day's image. It then sets the image as the desktop wallpaper for the system. .LINK http://antwrp.gsfc.nasa.gov/apod/astropix.html ....
combined_dataset/train/non-malicious/353941de-a44d-4d1b-a022-bffae3d94ed3.ps1
353941de-a44d-4d1b-a022-bffae3d94ed3.ps1
function Select-Alive {param( [object]$InputObject, [string]$Property, [int32]$Requests = 3) PROCESS { if ($InputObject -eq $null) {$In = $_} else {$In = $InputObject} if ($In.GetType().Name -eq "String") { $HostName = $In } elseif (($In | Get-Member | Where-Object {$In.Name -eq $...
combined_dataset/train/non-malicious/IE Proxy Toggle (Silent)_2.ps1
IE Proxy Toggle (Silent)_2.ps1
# Process command line parameter (if present). [bool] $DISABLE_PROXY = $false; foreach ($param in $MyInvocation.UnboundArguments) { if ($param -like 'disable') { $DISABLE_PROXY = $true; } } # Apply/refresh the organization's default proxy settings. [string] $proxyServer = '###.###.###.###:####'; ...
combined_dataset/train/non-malicious/sample_67_38.ps1
sample_67_38.ps1
# # Module manifest for module 'OCI.PSModules.Healthchecks' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/sample_3_90.ps1
sample_3_90.ps1
ConvertFrom-StringData @' id_netframeworkngenfiles_title=.Net Framework nGen files id_netframeworkngenfiles_status=Collecting .Net Framework nGen files '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE...
combined_dataset/train/non-malicious/1877.ps1
1877.ps1
Describe "Remove-TypeData DRT Unit Tests" -Tags "CI" { BeforeAll { $XMLFile1 = Join-Path $TestDrive -ChildPath "testFile1.ps1xml" $XMLFile2 = Join-Path $TestDrive -ChildPath "testFile2.ps1xml" $content1 = @" <Types> <Type> <Name>System.Array</Name> ...
combined_dataset/train/non-malicious/3521.ps1
3521.ps1
function Get-Location { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne ` [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { $namespace = "Microsoft.DevTestLab" $type = "sites" $location = Get-AzResourceProvider -ProviderNamespace $namespace ` | whe...
combined_dataset/train/non-malicious/sample_53_8.ps1
sample_53_8.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/2725.ps1
2725.ps1
$obj = "" | Select-Object $($PSVersionTable.Keys) foreach($item in $PSVersionTable.Keys) { $obj.$item = $($PSVersionTable[$item] -join ".") } $i = 1 Get-ChildItem -Force "$($env:windir)\Microsoft.Net\Framework" -Include mscorlib.dll -Recurse | ForEach-Object { $obj | Add-Member NoteProperty .NET_$i $_.Vers...
combined_dataset/train/non-malicious/sample_5_16.ps1
sample_5_16.ps1
#************************************************ # TS_ProLiantDL385NMICrashDump.ps1 # Version 1.0.1 # Date: 5/16/2012 # Author: v-alyao # Description: [Idea ID 2753] [Windows] HP DL385 G5p machine cannot generate dump file # Rule number: 2753 # Rule URL: //sharepoint/sites/rules/Rule%20Submissions/Forms/Disp...
combined_dataset/train/non-malicious/184.ps1
184.ps1
Function Get-SCSMWorkItemChildItem { param ( [Parameter(Mandatory = $True)] $inputPWI_guid ) $childWIs_obj = @() $inputPWI_obj = get-scsmobject -id $inputPWI_guid $containsActivity_relclass_id = '2da498be-0485-b2b2-d520-6ebd1698e61b' $childWIs_relobj_filter = "RelationshipId -eq '$containsActivity_relcla...
combined_dataset/train/non-malicious/Enable-MailboxJunkEmail.ps1
Enable-MailboxJunkEmail.ps1
# Author: Jon Webster # Name: Enable-MailboxJunkEmail # Created: 1/27/2009 # # Version: 1.0 # History: 1.0 01/27/2009 Initial version # # 18.11.2010 BRF Update for Microsoft Exchange SP3, Cookie Canary param( $Identity, [string]$CasURL, [string]$User, [string]$Password, $DomainController, [switch...
combined_dataset/train/non-malicious/sample_7_85.ps1
sample_7_85.ps1
@{ GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" NestedModules="Microsoft.PowerShell.Commands.Management.dll" HelpInfoURI = 'https://aka...
combined_dataset/train/non-malicious/sample_53_79.ps1
sample_53_79.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/SCOM-CreatePortMonitor.ps1
SCOM-CreatePortMonitor.ps1
param($serverName,$portNumber,$pollIntervalSeconds,$watcherNodes,$displayName,$targetMp) function GetPortMonitoringTemplate { $criteria = "Name = 'Microsoft.SystemCenter.SyntheticTransactions.TCPPortCheck.Template'"; $templateCriteria = new-object Microsoft.EnterpriseManagement.Configuration.MonitoringTempla...
combined_dataset/train/non-malicious/3171.ps1
3171.ps1
function Invoke-SQLBulkCopy { [cmdletBinding( DefaultParameterSetName = 'Instance', SupportsShouldProcess = $true, ConfirmImpact = 'High' )] param( [parameter( Position = 0, Mandatory = $true, ValueFromPipeline = $true, ...
combined_dataset/train/non-malicious/sample_56_52.ps1
sample_56_52.ps1
# # Module manifest for module 'OCI.PSModules.Budget' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Budget.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/sample_5_77.ps1
sample_5_77.ps1
param ( [Parameter(Mandatory=$true)] [string]$InstallDir ) $SelectedOperatingSystem = "windows" $ScriptPath = $MyInvocation.MyCommand.Path $ScriptDirectory = Split-Path -Parent $ScriptPath function Print-Title { param ( [string[]]$Params ) $Width = 40 $Border = "-" * $Width fo...
combined_dataset/train/non-malicious/sample_67_64.ps1
sample_67_64.ps1
<# .Synopsis Activate a Python virtual environment for the current PowerShell session. .Description Pushes the python executable for a virtual environment to the front of the $Env:PATH environment variable and sets the prompt to signify that you are in a Python virtual environment. Makes use of the command line...
combined_dataset/train/non-malicious/1878.ps1
1878.ps1
Describe "Remove-Alias" -Tags "CI" { BeforeAll { $testAliasName = (New-Guid).Guid } It "Remove-Alias should remove a non-readonly alias"{ { Set-Alias -Name $testAliasName -Value "Remove-Alias" -ErrorAction Stop Remove-Alias -Name $testAliasName -ErrorAction Stop ...
combined_dataset/train/non-malicious/3040.ps1
3040.ps1
Set-StrictMode -Version Latest Describe "Ensuring Set-TestInconclusive is deprecated" { Context "Set-TestInconclusive calls Set-ItResult -Inconclusive" { InModuleScope -Module Pester { if (-not($PSVersionTable.PSVersion.Major -eq 2)) { It "...
combined_dataset/train/non-malicious/sample_37_30.ps1
sample_37_30.ps1
# # Module manifest for module 'OCI.PSModules.Aispeech' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aispeech.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/592.ps1
592.ps1
function Dismount-TrueCyptContainer{ [CmdletBinding()] param( [Parameter(Mandatory=$false)] [String] $Name ) if(-not (Get-Command TrueCrypt)){ throw ("Command TrueCrypt not available, try `"Install-PPApp TrueCrypt`"") } Get-TrueCry...
combined_dataset/train/non-malicious/sample_21_53.ps1
sample_21_53.ps1
Param ( [Parameter(Mandatory=$true)][string]$installDir, [Parameter(Mandatory=$true)][string]$linkTargetVersion, [Parameter(Mandatory=$true)][string]$latestLinkDir ) $linkName = "latest" cd "$InstallDir/$latestLinkDir" if((Get-ItemProperty $linkName).LinkType) { (Get-Item $linkName).Delete() } ...
combined_dataset/train/non-malicious/sample_14_24.ps1
sample_14_24.ps1
# # Module manifest for module 'OCI.PSModules.Cloudguard' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Cloudguard.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/3891.ps1
3891.ps1
function Get-RandomSignalRName { param([string]$prefix = "signalr-test-") return $prefix + (getAssetName) } function Get-RandomResourceGroupName { param([string]$prefix = "signalr-test-rg-") return $prefix + (getAssetName) } function Assert-LocationEqual { param([string]$loc1, [string]$loc2) $...
combined_dataset/train/non-malicious/980.ps1
980.ps1
$SubscriptionId = '' $resourceGroupName = "myResourceGroup-$(Get-Random)" $location = "southcentralus" $adminSqlLogin = "SqlAdmin" $password = "ChangeYourAdminPassword1" $serverName = "server-$(Get-Random)" $databaseName = "mySampleDatabase" $startIp = "0.0.0.0" $endIp = "0.0.0.0" $storageAccountName = $("sql$(...
combined_dataset/train/non-malicious/sample_26_83.ps1
sample_26_83.ps1
# # Module manifest for module 'OCI.PSModules.Sch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Sch.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_46_65.ps1
sample_46_65.ps1
# Clear CI_COMMIT_MESSAGE and CI_COMMIT_DESCRIPTION for please meson # when the commit message is complicated $env:CI_COMMIT_MESSAGE="" $env:CI_COMMIT_DESCRIPTION="" # force the CA cert cache to be rebuilt, in case Meson tries to access anything Write-Host "Refreshing Windows TLS CA cache" (New-Object System.Net.WebCl...
combined_dataset/train/non-malicious/1319.ps1
1319.ps1
function Test-CUser { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [ValidateLength(1,20)] [string] $Username ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $user = Get...
combined_dataset/train/non-malicious/sample_3_99.ps1
sample_3_99.ps1
ConvertFrom-StringData @' id_netframeworkngenfiles_title=.Net Framework nGen files id_netframeworkngenfiles_status=Collecting .Net Framework nGen files '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE...
combined_dataset/train/non-malicious/sample_25_4.ps1
sample_25_4.ps1
# # This script just calls the Add-AppDevPackage.ps1 script that lives next to it. # param( [switch]$Force = $false, [switch]$SkipLoggingTelemetry = $false ) $scriptArgs = "" if ($Force) { $scriptArgs = '-Force' } if ($SkipLoggingTelemetry) { if ($Force) { $scriptArgs +...
combined_dataset/train/non-malicious/sample_11_16.ps1
sample_11_16.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .Synopsis Registers or unregisters the PowerShell ETW manifest .Parameter Path The fully qualified path to the PowerShell.Core.Instrumentation.man manifest file. The default value is the location of this script. .Paramet...
combined_dataset/train/non-malicious/sample_0_84.ps1
sample_0_84.ps1
#************************************************ # TS_HyperVSCSIDiskEnum.ps1 # Version 1.0.1 # Date: 03-08-2011 # Author: Andre Teixeira - andret # Description: This checks the number of subkeys under HKLM\System\CurrentControlSet\Enum\SCSI\Disk&Ven_Msft&Prod_Virtual_Disk # If it is large (more th...
combined_dataset/train/non-malicious/sample_3_49.ps1
sample_3_49.ps1
ConvertFrom-StringData @' id_sbsl_mcafee_eepc_slowboot_sd=McAfee Endpoint Encryption for PCs (EEPC) may cause slow boot or delay between CTRL+ALT+DEL and Credential logon dialog '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3A...
combined_dataset/train/non-malicious/SSL Oblivious Web Client.ps1
SSL Oblivious Web Client.ps1
function New-TrustAllWebClient { # Create a compilation environment $Provider=New-Object Microsoft.CSharp.CSharpCodeProvider $Compiler=$Provider.CreateCompiler() $Params=New-Object System.CodeDom.Compiler.CompilerParameters $Params.GenerateExecutable=$False $Params.GenerateInMemory=$True $Params.IncludeDe...
combined_dataset/train/non-malicious/sample_10_20.ps1
sample_10_20.ps1
--- - name: Get Power Supply information. ansible.builtin.uri: url: "https://{{ hostname }}:{{ https_port }}{{ api_chassis }}/PowerSubsystem/PowerSupplies?$expand=*($levels=1)" register: power_result delegate_to: "{{ idrac_gather_facts_delegate }}" - name: Get Power Supply Metrics ids ansible.builtin.set_f...
combined_dataset/train/non-malicious/sample_45_49.ps1
sample_45_49.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Get-Token { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding()] [OutputType([System.Management.Automation.Language.Token])] [System.Diagnostics.CodeAnalysis.SuppressMessage...
combined_dataset/train/non-malicious/sample_32_96.ps1
sample_32_96.ps1
# # Module manifest for module 'OCI.PSModules.Loadbalancer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loadbalancer.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/sample_36_15.ps1
sample_36_15.ps1
@{ GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" NestedModules="Microsoft.PowerShell.Commands.Management.dll" HelpInfoURI = 'https://aka...
combined_dataset/train/non-malicious/Get-Exception.ps1
Get-Exception.ps1
<# .Synopsis Outputs .NET exception information along with their summary information if available. .Description Spins all loaded types in all loaded assemblies and will return any Exception types that match the filter if specified. Because the script only spins loaded assemblies, if you want the script to sea...
combined_dataset/train/non-malicious/sample_11_28.ps1
sample_11_28.ps1
# Copyright 2008, Microsoft Corporation. All rights reserved. PARAM([string]$MachineName = $ComputerName,[string]$Path= $null) if($debug -eq $true){[void]$shell.popup("Run DC_DeploymentLogsLogs.ps1")} Import-LocalizedData -BindingVariable DeploymentLogsStrings Write-DiagProgress -Activity $DeploymentLogsS...
combined_dataset/train/non-malicious/424.ps1
424.ps1
Register-PSFTeppScriptblock -Name "PSFramework-config-fullname" -ScriptBlock { [PSFramework.Configuration.ConfigurationHost]::Configurations.Values | Where-Object { -not $_.Hidden } | Select-Object -ExpandProperty FullName }
combined_dataset/train/non-malicious/VM Performance Report - .ps1
VM Performance Report - .ps1
<# .SYNOPSIS The script creates an HTML report for given vSphere VM's, that contains VM performance data over a given period. The script then emails the report to a given address. .DESCRIPTION The script requires an input file, supplied as an argument to the script. The first line of this file contains an e...
combined_dataset/train/non-malicious/finddupe_8.ps1
finddupe_8.ps1
function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.MD5CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.OpenRead(); $hashByteArray = $hashA...
combined_dataset/train/non-malicious/2436.ps1
2436.ps1
[CmdletBinding(SupportsShouldProcess)] [OutputType()] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [string]$Zone, [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] [string]$Name, [Parameter(ValueFromPipeline, ValueFromPipelineByProp...
combined_dataset/train/non-malicious/Exporting SQLData to CSV.ps1
Exporting SQLData to CSV.ps1
#Connection Strings $Database = "Database" $Server = "SQLServer" #SMTP Relay Server $SMTPServer = "smtp.domain.com" #Export File $AttachmentPath = "C:\\SQLData.csv" # Connect to SQL and query data, extract data to SQL Adapter $SqlQuery = "SELECT * FROM dbo.Test_Table" $SqlConnection = New-Object System.Data.Sq...
combined_dataset/train/non-malicious/sample_56_8.ps1
sample_56_8.ps1
# # Module manifest for module 'OCI.PSModules.Accessgovernancecp' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Accessgovernancecp.dll' # Version number of this module. ModuleVersion = '83.2.0' # Suppo...
combined_dataset/train/non-malicious/Tag-Alert (SCOM).ps1
Tag-Alert (SCOM).ps1
# Tags alert with PrincipalName, Severity and MP name in Custom fields. # Use in OpsMgr Command Shell. # Original script from Marco Shaw. # Changed by Stefan Stranger # Date created 13-09-2008 $alerts = get-alert | where {$_.principalname -ne $null -and $_.resolutionstate -eq "0"} foreach($alert in $alerts) ...
combined_dataset/train/non-malicious/sample_5_86.ps1
sample_5_86.ps1
ConvertFrom-StringData @' id_ctsdhcpserver=DHCP Server id_ctsdhcpserverdescription=Collects information about DHCP Server. '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAI...
combined_dataset/train/non-malicious/sample_66_15.ps1
sample_66_15.ps1
<# .SYNOPSIS SharePoint module for collecting traces .DESCRIPTION Define ETW traces for SharePoint components Add any custom tracing functinaliy for tracing SharePoint components For Developers: 1. Component test: .\TSS.ps1 -Start -SPS_TEST1 2. Scenario test: .\TSS.ps1 -start -Scenario SPS_MyScenarioTe...
combined_dataset/train/non-malicious/sample_27_85.ps1
sample_27_85.ps1
# # Module manifest for module 'OCI.PSModules.Waas' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waas.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/WPF PingMonitor for 2.0.ps1
WPF PingMonitor for 2.0.ps1
if(!(Get-Command New-BootsWindow -EA SilentlyContinue)) { # Add-PsSnapin PoshWpf Import-Module PowerBoots Add-BootsContentProperty 'DataPoints', 'Series' #[Void][Reflection.Assembly]::LoadFrom( (Convert-Path (Resolve-Path "~\\Documents\\WindowsPowershell\\Libraries\\WPFVisifire.Charts.dll")) ) Add-B...
combined_dataset/train/non-malicious/64.ps1
64.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...