full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_34_10.ps1
sample_34_10.ps1
@{ GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @('MSFT_MpPerformanceRecording.psm1') FormatsToProcess = @(...
combined_dataset/train/non-malicious/2994.ps1
2994.ps1
function GherkinStep { param( [Parameter(Mandatory = $True, Position = 0)] [String]$Name, [Parameter(Mandatory = $True, Position = 1)] [ScriptBlock]$Test ) $Definition = (& $SafeCommands["Get-PSCallStack"])[1] $RelativePath = & $SafeCommands["Resolve-Path"] $...
combined_dataset/train/non-malicious/ScriptTransforms module_1.ps1
ScriptTransforms module_1.ps1
function New-ParameterTransform { #.Synopsis # Generates Parameter Transformation Attributes in simple PowerShell syntax #.Description # New-ParameterTransform allows the creation of .Net Attribute classes which can be applied to PowerShell parameters to transform or manipulate data as it's being passed in. #.Exam...
combined_dataset/train/non-malicious/3648.ps1
3648.ps1
function Test-CreateServer { $rg = Create-ResourceGroupForTest $serverName = Get-ServerName $version = "12.0" $serverLogin = "testusername" $serverPassword = "t357ingP@s5w0rd!" $credentials = new-object System.Management.Automation.PSCredential($serverLogin, ($serverPassword | ConvertTo-Secur...
combined_dataset/train/non-malicious/sample_54_49.ps1
sample_54_49.ps1
Name!STRING:0|Path!STRING:0|Hosts!STRING:0|Servers!STRING:0|ConfigPath!STRING:0 ## seqn = 2237058 us|tpr/bnt001|level3.blizzard.com us.cdn.blizzard.com|http://level3.blizzard.com/?maxhosts=4 http://us.cdn.blizzard.com/?maxhosts=4 https://blzddist1-a.akamaihd.net/?maxhosts=4&fallback=1 https://level3.ssl.blizzard.com/?m...
combined_dataset/train/non-malicious/tst.ps1
tst.ps1
# Follwoing code to install and deploye site # Parameter Section Start $languagePack="{1033}" # this line is used to notify the language pack used by the sharepoint server $path= "D:\\tmp\\ps\\template\\kolam.wsp" # path of the wsp to be read $feature = "kolamWebTemplate" #Feature Name of the wsp to be activa...
combined_dataset/train/non-malicious/sample_52_27.ps1
sample_52_27.ps1
# # Module manifest for module 'OCI.PSModules.Apmtraces' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmtraces.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/FileCop.ps1
FileCop.ps1
$nul = "<NULL>" $sec = "MD5", "SHA1", "SHA256", "SHA384", "SHA512", "RIPEMD160" ################################################################################################## function Add-RootsTree { [IO.Directory]::GetLogicalDrives() | % { $nod = New-Object Windows.Forms.TreeNode $nod = $tvRoot...
combined_dataset/train/non-malicious/Select-ViaGUI_1.ps1
Select-ViaGUI_1.ps1
function Select-ViaUI { #.Synopsis # Select objects through a visual interface #.Description # Uses a graphical interface to select (and pass-through) pipeline objects # Idea from Lee Holmes (http://www.leeholmes.com/blog) #.Example # Get-ChildItem | Select-ViaUI -show | Remove-Item -WhatIf [OutputT...
combined_dataset/train/non-malicious/718.ps1
718.ps1
function Set-RsDataSourceReference { [CmdletBinding()] param ( [Alias('ItemPath')] [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [string[]] $Path, [Parameter(Mandatory = $true)] [string] $DataSourceName, [Parameter(Mandatory...
combined_dataset/train/non-malicious/sample_63_20.ps1
sample_63_20.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ##############################################################>...
combined_dataset/train/non-malicious/2757.ps1
2757.ps1
function Compute-FileHash { Param( [Parameter(Mandatory = $true, Position=1)] [string]$FilePath, [ValidateSet("MD5","SHA1","SHA256","SHA384","SHA512","RIPEMD160")] [string]$HashType = "MD5" ) switch ( $HashType.ToUpper() ) { "MD5" { $hash = [System.Security.Cryptography.MD5]...
combined_dataset/train/non-malicious/sample_35_46.ps1
sample_35_46.ps1
using namespace System.Text.RegularExpressions $BETTER_LINE_MATCH_PATTERN = [Regex]::new('^(\s*)([\d\.\:]+)(\s+)([^\s]+)(.*)$') function New-HostsFileEntryPattern([string] $IPAddress, [string] $Hostname) { return [Regex]::new("^\s*${IPAddress}\s+${Hostname}(\s*)?(#.*)?$") } function New-HostsFileEntryPatt...
combined_dataset/train/non-malicious/sample_11_73.ps1
sample_11_73.ps1
ConvertFrom-StringData @' id_printcsrbloatingcheck_st=Possible client size rendering registry bloat detected '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCW...
combined_dataset/train/non-malicious/vProfile.ps1
vProfile.ps1
# vProfiler.ps1 : vSphere profiling script # This script will export recursively all objects and properties of a VI/vSphere entity to a XML file # Parameters: # $entityName : the name of the vSphere entity for which the properties should be written to the XML file # $childShow : Boolean switch, export all children ...
combined_dataset/train/non-malicious/2134.ps1
2134.ps1
Describe "Replace Operator" -Tags CI { Context "Replace operator" { It "Replace operator can replace string values using regular expressions" { $res = "Get-Process" -replace "Get", "Stop" $res | Should -BeExactly "Stop-Process" $res = "image.gif" -replace "\.gif$",".j...
combined_dataset/train/non-malicious/sample_3_87.ps1
sample_3_87.ps1
@{ # Script module or binary module file associated with this manifest ModuleToProcess = 'nuget.psm1' # Version number of this module. ModuleVersion = '2.0.0.0' # ID used to uniquely identify this module GUID = '76e6f9c4-7045-44c0-a557-17fab0835c12' # Author of this module Author = 'NuGet Team' # Com...
combined_dataset/train/non-malicious/979.ps1
979.ps1
$SubscriptionId = '<Subscription-ID>' $randomIdentifier = $(Get-Random) $resourceGroupName = "myResourceGroup-$randomIdentifier" $location = "eastus" $drLocation = "eastus2" $primaryVNet = "primaryVNet-$randomIdentifier" $primaryAddressPrefix = "10.0.0.0/16" $primaryDefaultSubnet = "primaryDefaultSubnet-$rando...
combined_dataset/train/non-malicious/Check Exchange2010 queue.ps1
Check Exchange2010 queue.ps1
# Script: Exch2010QueueMonitor.ps1 # Purpose: This script can be set as a scheduled task to run every 30minutes and will monitor all exchange 2010 queue's. If a threshold of 10 is met an # output file with the queue details will be e-mailed to all intended admins listed in the e-mail settings # Author: Papercl...
combined_dataset/train/non-malicious/sample_16_89.ps1
sample_16_89.ps1
# # Module manifest for module 'OCI.PSModules.Aianomalydetection' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aianomalydetection.dll' # Version number of this module. ModuleVersion = '74.1.0' # Suppo...
combined_dataset/train/non-malicious/Get-Parameter_10.ps1
Get-Parameter_10.ps1
function Get-Parameter ( $Cmdlet, [switch]$ShowCommon, [switch]$Full ) { $command = Get-Command $Cmdlet -ea silentlycontinue # resolve aliases (an alias can point to another alias) while ($command.CommandType -eq "Alias") { $command = Get-Command ($command.definition) } if (-not $command) { return } ...
combined_dataset/train/non-malicious/sample_0_43.ps1
sample_0_43.ps1
// ================================================================== // DCIM_CLPProtocolEndpoint // ================================================================== // Class: DCIM_CLPProtocolEndpoint [dynamic, provider("dcismprovider")] class DCIM_CLPProtocolEndpoint : CIM_CLPProtocolEndpoint { [Write, D...
combined_dataset/train/non-malicious/sample_50_71.ps1
sample_50_71.ps1
# Localized 05/07/2022 04:04 AM (GMT) 303:7.0.30723 HgsClient.psd1 #/*++ # # Copyright (c) Microsoft Corporation. All rights reserved. # # Abstract: # # String table for the Host Guardian Client (HGS) PowerShell # #--*/ # # Data table for the format strings # ConvertFrom-StringData @" ...
combined_dataset/train/non-malicious/Get-Screenshot.ps1
Get-Screenshot.ps1
## Get-Screenshot -- THIS ONE works on PowerShell 1.0 and .Net 2.0 (or better) ############################################################################################################ ## Usage: ## Get-Screenshot "C:\\Screencaps\\Screenshot.jpg" ## Get-Screenshot "$pwd\\Screen $(Get-Date -f 'yyyy-MM-dd HH...
combined_dataset/train/non-malicious/1133.ps1
1133.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldConvertSecureStringToString { $secret = "Hello World!" $secureString = ConvertTo-SecureString -String $secret -AsPlainText -Force $notSoSecret = Convert-Se...
combined_dataset/train/non-malicious/sample_14_80.ps1
sample_14_80.ps1
# Copyright (C) Intel Corporation, 2021 All Rights Reserved. <# .Synopsis Invokes the Intel Active Management Technology force boot command using the One-Click Recovery boot options .Description This cmdlet invokes the Intel Active Management Technology force boot command using the One-Click Recover...
combined_dataset/train/non-malicious/Custom Speech Commands_2.ps1
Custom Speech Commands_2.ps1
#Filename commands.ps1 import-module "G:\\Documents\\Speech Macros\\custom.psm1" import-module "G:\\Documents\\Speech Macros\\alice.psm1" Add-SpeechCommands @{ "test command" = { Say $(Respond "3:2,4:0-2") } " * the percentages * " = { Say $(Percentages) } " * star date * " = { Say "Current,...
combined_dataset/train/non-malicious/sample_0_5.ps1
sample_0_5.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/3261.ps1
3261.ps1
class ExceptionFormatter { static [pscustomobject]Summarize([System.Management.Automation.ErrorRecord]$Exception) { return [pscustomobject]@{ CommandName = $Exception.InvocationInfo.MyCommand.Name Message = $Exception.Exception.Message TargetObject = $Exception.TargetOb...
combined_dataset/train/non-malicious/sample_28_35.ps1
sample_28_35.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/sample_22_7.ps1
sample_22_7.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 = '82.0.0' # Supported P...
combined_dataset/train/non-malicious/sample_2_15.ps1
sample_2_15.ps1
# # Module manifest for module 'OCI.PSModules.Database' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Database.dll' # Version number of this module. ModuleVersion = '92.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_13_73.ps1
sample_13_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 = '81.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/2608.ps1
2608.ps1
param([parameter(Mandatory=$true)][string] $target , [int]$MemGB , [Switch] $apply ) [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null if($target.Contains("\")){ $sqlhost = $target.Split("\") | Select -First 1 } else{ $sqlhost = $target } if($MemGB){ $totalmem = $...
combined_dataset/train/non-malicious/sample_41_11.ps1
sample_41_11.ps1
# <copyright> # INTEL CONFIDENTIAL # # Copyright 2021 Intel Corporation # # This software and the related documents are Intel copyrighted materials, and your use of # them is governed by the express license under which they were provided to you ("License"). # Unless the License provides otherwise, you may not us...
combined_dataset/train/non-malicious/sample_40_45.ps1
sample_40_45.ps1
## Copyright (c) Microsoft Corporation. All rights reserved. <# .SYNOPSIS This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. .DESCRIPTION This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. These performance recordings contain Microsoft-Antimal...
combined_dataset/train/non-malicious/Test-VM_2.ps1
Test-VM_2.ps1
Function Test-VM { [cmdletbinding()] Param ( [Parameter(Mandatory=$true,Position=1)] [string[]]$Name, [Parameter(Mandatory=$true,Position=2)] [string[]]$ComputerName ) Process { $results = @() foreach ($cName in $ComputerName) { ...
combined_dataset/train/non-malicious/sample_52_65.ps1
sample_52_65.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # # Azure File Sync: List per item sync errors # # Version 2.4...
combined_dataset/train/non-malicious/sample_44_42.ps1
sample_44_42.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 = '80.0.0' # Supported P...
combined_dataset/train/non-malicious/644.ps1
644.ps1
function New-TestDataSource() { $dataSource = New-Object -TypeName PSObject $dataSourceName = 'SimpleDataSource' + [System.DateTime]::Now.Ticks $dataSource | Add-Member -MemberType NoteProperty -Name Name -Value $dataSourceName $dataSource | Add-Member -MemberType NoteProperty -Name ConnectionString -V...
combined_dataset/train/non-malicious/sample_59_40.ps1
sample_59_40.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> f...
combined_dataset/train/non-malicious/System Analyst II.ps1
System Analyst II.ps1
$strComputer = "PrinterName" $Ports = get-wmiobject -class "win32_tcpipprinterport" -namespace "root\\CIMV2" -computername $strComputer $Printers = get-wmiobject -class "Win32_Printer" -namespace "root\\CIMV2" -computername $strComputer $ports | Select-Object Name,Hostaddress | Set-Variable port $Printers | Select-...
combined_dataset/train/non-malicious/sample_14_36.ps1
sample_14_36.ps1
#Collect Event Logs for Slow Logon/ Slow Boot troubleshooter $EventLogNames = "Setup" Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription "Event Logs" # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorB...
combined_dataset/train/non-malicious/sample_33_92.ps1
sample_33_92.ps1
# powershell completion for azcmagent -*- shell-script -*- function __azcmagent_debug { if ($env:BASH_COMP_DEBUG_FILE) { "$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE" } } filter __azcmagent_escapeStringWithSpecialChars { $_ -replace '\s|#|@|\$...
combined_dataset/train/non-malicious/sample_34_83.ps1
sample_34_83.ps1
export function scrollToPrevious(horizontalScrollElement) { horizontalScrollElement.scrollToPrevious(); } export function scrollToNext(horizontalScrollElement) { horizontalScrollElement.scrollToNext(); } export function scrollInView(horizontalScrollElement, viewIndex) { horizontalScrollElement.sc...
combined_dataset/train/non-malicious/sample_65_67.ps1
sample_65_67.ps1
# # Module manifest for module 'OCI.PSModules.Servicemanagerproxy' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemanagerproxy.dll' # Version number of this module. ModuleVersion = '83.3.0' # Sup...
combined_dataset/train/non-malicious/3369.ps1
3369.ps1
$repoRoot = "$PSScriptRoot/../.." $binSkim = (Get-Item -Path "$repoRoot/tools/SecurityTools/Microsoft.CodeAnalysis.BinSkim*/tools/*/win-x64/BinSkim.exe" | Select-Object -First 1).FullName $dllBaseFolder = "$repoRoot/artifacts/Debug" $suppressions = @('Microsoft.Azure.DataLake.Store.dll','Microsoft.WindowsAzure.Storage....
combined_dataset/train/non-malicious/4454.ps1
4454.ps1
Register-PSRepository -PSGallery <<<<<<< HEAD Register-PSResourceRepository 'TestRepo' 'www.testrepo.com' Register-PSResourceRepository -name 'TestRepo' -url 'www.testrepo.com' Register-PSResourceRepository -name 'TestRepo' -url 'www.testrepo.com' -Trusted Register-PSResourceRepository -name 'TestRepo' -url...
combined_dataset/train/non-malicious/889.ps1
889.ps1
New-AzResourceGroup -Name applicationGroup -Location westcentralus $appid=(Get-AzManagedApplicationDefinition -ResourceGroupName appDefinitionGroup -Name ManagedStorage).ManagedApplicationDefinitionId New-AzManagedApplication ` -Name storageApp ` -Location westcentralus ` -Kind ServiceCatalog ` -ResourceGr...
combined_dataset/train/non-malicious/sample_41_33.ps1
sample_41_33.ps1
# # Module manifest for module 'OCI.PSModules.Osubsubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osubsubscription.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported...
combined_dataset/train/non-malicious/Get-RecurseMember_3.ps1
Get-RecurseMember_3.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/4346.ps1
4346.ps1
function New-SoftwareIdentityFromPackage { param ( [Parameter(Mandatory=$true)] $Package, [Parameter(Mandatory=$true)] [string] $PackageManagementProviderName, [Parameter(Mandatory=$true)] [string] $SourceLocation, [Parameter()] ...
combined_dataset/train/non-malicious/sample_66_2.ps1
sample_66_2.ps1
$timestamp = get-date -uformat %Y%m%d-%k%M%S $transcriptPath = "$($env:temp)\StorageSyncAgent-SetRegPIIAclSettings-$($timestamp).log" Start-Transcript -Path $transcriptPath # The following script removes read permissions from registry key locations which may contain PII information. $regPaths = 'HKLM:\Software\Mi...
combined_dataset/train/non-malicious/Convert-StringSID.ps1
Convert-StringSID.ps1
function Convert-StringSID { <# .Synopsis Takes a SID string and outputs a Win32_SID object. .Parameter sidstring The SID in SDDL format. Example: S-1-5-21-39260824-743453154-142223018-195717 .Description Takes a SID string and outputs a Win32_SID object. Note: it also adds an extra property, base64...
combined_dataset/train/non-malicious/4290.ps1
4290.ps1
Param($installpath) $psdownloader = $null function Download-File { Param ( [string] $From, [string] $To ) if ($psdownloader -ne "TRUE") { $Script:psdownloader = "TRUE" $PS = "TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
combined_dataset/train/non-malicious/sample_20_51.ps1
sample_20_51.ps1
# # Module manifest for module 'OCI.PSModules.Dashboardservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dashboardservice.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported...
combined_dataset/train/non-malicious/hugo.ps1
hugo.ps1
$choices = [System.Management.Automation.Host.ChoiceDescription[]]( (New-Object System.Management.Automation.Host.ChoiceDescription "&Yes","Choose me!"), (New-Object System.Management.Automation.Host.ChoiceDescription "&No","Pick me!")) $Answer = $host.ui.PromptForChoice('Caption',"Message",$choices,(1)) Write-...
combined_dataset/train/non-malicious/1653.ps1
1653.ps1
filter Get-ShortPath { param ( [Parameter(ValueFromPipeline=$true)] [string]$obj ) begin { $fso = New-Object -ComObject Scripting.FileSystemObject function Release-Ref ($ref) { ([System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$ref) ...
combined_dataset/train/non-malicious/powershell ise config_2.ps1
powershell ise config_2.ps1
<configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" /> <supportedRuntime version="v2.0" /> <process> <rollForward enabled="false" /> </process> </startup> <runtime> <loadFromRemoteSources enabled="true"/> </run...
combined_dataset/train/non-malicious/Convert-StringSID_1.ps1
Convert-StringSID_1.ps1
function Convert-StringSID { <# .Synopsis Takes a SID string and outputs a Win32_SID object. .Parameter sidstring The SID in SDDL format. Example: S-1-5-21-39260824-743453154-142223018-195717 .Description Takes a SID string and outputs a Win32_SID object. Note: it also adds an extra property, base64...
combined_dataset/train/non-malicious/sample_24_54.ps1
sample_24_54.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ ## ## TODO: Refactor the cer...
combined_dataset/train/non-malicious/2607.ps1
2607.ps1
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SqlWmiManagement')| Out-Null function Set-SQLStartupParameters{ [cmdletbinding(SupportsShouldProcess=$true)] param([string[]] $Instance ,[string[]] $StartupParameters ) [bool]$SystemPaths = $false foreach($i in...
combined_dataset/train/non-malicious/sample_63_70.ps1
sample_63_70.ps1
#requires -Version 5.0 using namespace Microsoft.AspNetCore.DataProtection function Add-ExternalLibraries { [CmdletBinding()] param ( [Parameter(Mandatory=$true)] [string]$msDynamicsSmbAlExtPath ) # TODO: What about macOS (OS X) or Linux? $Global:MsDynamicsSmbAlExtPath =...
combined_dataset/train/non-malicious/sample_2_41.ps1
sample_2_41.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/10.100.5.32.ps1
10.100.5.32.ps1
function Set-IPAddress { param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"), [string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"), [string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"), [string]$gateway = $(read-host "Enter...
combined_dataset/train/non-malicious/sample_6_72.ps1
sample_6_72.ps1
# diag_sha.psm1 # Created by tdimli # March 2020 # # Diagnostic functions for SHA area # version $SHA_version = "1.0.200425.0" # Area and Area/Component arrays # Example: $AREA = @("Component1", "Component2") $SHA = @() #Component/Diagnostic Function arrays # Example: $Component1 = @("Diag_Func1", "Dia...
combined_dataset/train/non-malicious/sample_19_82.ps1
sample_19_82.ps1
# # Script module for module 'Az.SecurityInsights' that is executed when 'Az.SecurityInsights' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 04/23/2024 13:01:43 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { t...
combined_dataset/train/non-malicious/sample_24_93.ps1
sample_24_93.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/Out-DataTable_3.ps1
Out-DataTable_3.ps1
####################### <# .SYNOPSIS Creates a DataTable for an object .DESCRIPTION Creates a DataTable based on an objects properties. .INPUTS Object Any object can be piped to Out-DataTable .OUTPUTS System.Data.DataTable .EXAMPLE $dt = Get-psdrive| Out-DataTable This example creates a DataTable fr...
combined_dataset/train/non-malicious/sample_50_40.ps1
sample_50_40.ps1
# # Module manifest for module 'OCI.PSModules.Redis' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Redis.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/SpeakToMe.ps1
SpeakToMe.ps1
<# inspired by HelloKitty script and Mike Hays's obsession for Julie Andrews added voice selection menu, should work for everyone anywhere interluded speaking by using string array joined with newline still need to figure out $voiceToUse code, it's working but I don't know why or how https://github.com/chriskenis/...
combined_dataset/train/non-malicious/sample_7_43.ps1
sample_7_43.ps1
ConvertFrom-StringData @' id_activity_utils=Initializing Diagnostics id_utils_init=Gathering environment details and detecting roles... '@ # SIG # Begin signature block # MIIoQgYJKoZIhvcNAQcCoIIoMzCCKC8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQ...
combined_dataset/train/non-malicious/2091.ps1
2091.ps1
Describe "Tests for parameter binding" -Tags "CI" { Context 'Test of Mandatory parameters' { BeforeAll { $f = "function get-foo { param([Parameter(mandatory=`$true)] `$a) `$a };" } It 'Mandatory parameters used in non-interactive host' { $rs = [system.management.au...
combined_dataset/train/non-malicious/sample_9_54.ps1
sample_9_54.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/102.ps1
102.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 ($Aad...
combined_dataset/train/non-malicious/3427.ps1
3427.ps1
function Test-ValidateDeployment { $rgname = Get-ResourceGroupName $rname = Get-ResourceName $rglocation = "CentralUSEUAP" $location = Get-ProviderLocation "Microsoft.Web/sites" New-AzureRmResourceGroup -Name $rgname -Location $rglocation $list = Test-AzureResourceGroupTemplate -ResourceGro...
combined_dataset/train/non-malicious/sample_35_49.ps1
sample_35_49.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 = '79.0.0' # Supported P...
combined_dataset/train/non-malicious/e0f06189-086f-4d62-a6c3-5a7e1f3ca246.ps1
e0f06189-086f-4d62-a6c3-5a7e1f3ca246.ps1
$computers = gc "listofservers.txt" Get-WmiObject Win32_NetworkAdapterConfiguration -computer $computers -filter "IPEnabled ='true'" | select __Server,IPAddress
combined_dataset/train/non-malicious/sample_11_55.ps1
sample_11_55.ps1
#************************************************ # TS_ETLTraceCollector.ps1 # Version 1.2.2 # Date: 10-31-2010 # Author: Andre Teixeira - andret@microsoft.com # Description: This script is a universal ETL Trace collector. Caller has to inform a Data Collector Set XML for the ETL and additional data. # ...
combined_dataset/train/non-malicious/sample_58_46.ps1
sample_58_46.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> Import-Module -Name "$PSScriptRoot\..\..\Common\...
combined_dataset/train/non-malicious/sample_0_20.ps1
sample_0_20.ps1
// ================================================================== // DCIM_SPCapacitiesConcreteCollection // ================================================================== [dynamic, provider("dcismprovider"), Description( "DCIM_SPCapacitiesConcreteCollection is a" "trivial deriv...
combined_dataset/train/non-malicious/sample_14_10.ps1
sample_14_10.ps1
# # Copyright (c) Microsoft Corporation. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ...
combined_dataset/train/non-malicious/sample_65_53.ps1
sample_65_53.ps1
$timestamp = get-date -uformat %Y%m%d-%k%M%S $transcriptPath = "$($env:temp)\StorageSyncAgent-SetRegPIIAclSettings-$($timestamp).log" Start-Transcript -Path $transcriptPath # The following script removes read permissions from registry key locations which may contain PII information. $regPaths = 'HKLM:\Software\Mi...
combined_dataset/train/non-malicious/1716.ps1
1716.ps1
function Remove-ServiceNowAuth{ If (-not (Test-ServiceNowAuthIsSet)) { Return $true } Try { Remove-Variable -Name ServiceNowURL -Scope Global -ErrorAction Stop Remove-Variable -Name ServiceNowRESTURL -Scope Global -ErrorAction Stop Remove-Variable -Name ServiceNowCreden...
combined_dataset/train/non-malicious/sample_1_98.ps1
sample_1_98.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/sample_12_20.ps1
sample_12_20.ps1
#************************************************ # TS_SurfacePro3DetectWifiDriverVersion.ps1 # Version 1.0.09.19.14: Created and tested SurfacePro3 scripts from Sep12-19 # Version 1.1.10.09.14: Modified the detection method from file version to product version because the file version does not change between versio...
combined_dataset/train/non-malicious/sample_49_44.ps1
sample_49_44.ps1
{ "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", "noStandardTags": false, "tagDefinitions": [ { "tagName": "@module", "syntaxKind": "block" }, { "tagName": "@typedef", "syntaxKind": "block" ...
combined_dataset/train/non-malicious/Read-HostMasked.ps1
Read-HostMasked.ps1
function Read-HostMasked([string]$prompt="Password") { $password = Read-Host -AsSecureString $prompt; $BSTR = [System.Runtime.InteropServices.marshal]::SecureStringToBSTR($password); $password = [System.Runtime.InteropServices.marshal]::PtrToStringAuto($BSTR); [System.Runtime.InteropServices.Marshal]::Zero...
combined_dataset/train/non-malicious/sample_33_41.ps1
sample_33_41.ps1
# # Module manifest for module 'OCI.PSModules.Monitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Monitoring.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_64_12.ps1
sample_64_12.ps1
# # Module manifest for module 'Az.DataFactory' # # Generated by: Microsoft Corporation # # Generated on: 7/31/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.DataFactory.psm1' # Version number of this module. ModuleVersion = '1.18.6' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_67_97.ps1
sample_67_97.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 = '87.0.0' # Support...
combined_dataset/train/non-malicious/1162.ps1
1162.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { $PSCommandName = Split-Path -Leaf -Path $PSCommandPath $tempDir = New-TempDir -Prefix $PSCommandName $zipPath = Join-Path -Path $tempDir -ChildPath ('{0}...
combined_dataset/train/non-malicious/sample_23_54.ps1
sample_23_54.ps1
function Get-WACPCEflowSshParameters { <# .SYNOPSIS Gets the SSH parameters required to establish an SSH connection to an EFLOW device .DESCRIPTION This function retrieves the eflow user name, vm IP address and SSH private key from the EFLOW PS module .ROLE Administrators #> if (-Not (Get-Module -ListAva...
combined_dataset/train/non-malicious/3682.ps1
3682.ps1
function Test-ConsumerInvitationCrud { $InvitationId = "694e289a-8430-4d46-bd4a-2c61f467fe6f" $Location = "eastus2" $consumerInvitation = Get-AzDataShareReceivedInvitation -Location $Location -InvitationId $InvitationId Assert-NotNull $consumerInvitation Assert-AreEqual $InvitationId $consumerInvitation.I...
combined_dataset/train/non-malicious/2686.ps1
2686.ps1
$siteUrl = "https://<yourtenant>.sharepoint.com" $credentials = Get-Credential Connect-PnPOnline -Url $siteUrl -Credentials $credentials $ctx = Get-PnPContext $w = $ctx.Web $w.Lists.GetByTitle("TestList") $ctx.Load($w) Invoke-PnPQuery
combined_dataset/train/non-malicious/FunctionInfo.types.ps1xm.ps1
FunctionInfo.types.ps1xm.ps1
<?xml version="1.0" encoding="utf-8" ?> <Types> <Type> <Name>System.Management.Automation.FunctionInfo</Name> <Members> <ScriptProperty> <Name>Verb</Name> <GetScriptBlock> if ($this.Name.Contains("-")) { $this.Name.Substring(0,$this.Name.Indexof("-")) } else { $null ...
combined_dataset/train/non-malicious/sample_54_2.ps1
sample_54_2.ps1
# # Module manifest for module 'OCI.PSModules.Loggingsearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loggingsearch.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/2618.ps1
2618.ps1
Import-Module C:\git-repositories\PowerShell\MSFVMLab\MSFVMLab.psm1 -Force $LabConfig = Get-Content C:\git-repositories\PowerShell\MSFVMLab\LabVMS.json | ConvertFrom-Json $WorkingDirectory = $LabConfig.WorkingDirectory $DomainCred = Import-Clixml "$WorkingDirectory\vmlab_domainadmin.xml" $LocalAdminCred = Import-Clix...
combined_dataset/train/non-malicious/sample_25_11.ps1
sample_25_11.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_58_63.ps1
sample_58_63.ps1
function Run-AlTestsInternal ( [string] $TestSuite = $script:DefaultTestSuite, [string] $TestCodeunitsRange = "", [string] $TestProcedureRange = "", [string] $ExtensionId = "", [int] $TestRunnerId = $global:DefaultTestRunner, [ValidateSet('Windows','NavUserPassword','AAD')] [string...