full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_27_71.ps1
sample_27_71.ps1
@{ IncludeRules=@('PSProvideCommentHelp', 'PSAvoidUsingWriteHost') } # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDhIygaFe...
combined_dataset/train/non-malicious/ACE.psm1.ps1
ACE.psm1.ps1
####################### function Get-ACEConnection { param($ConnectionString) $conn = new-object System.Data.OleDb.OleDbConnection($ConnectionString) $conn.open() $conn } #Get-ACEConnection ####################### function Get-ACETable { param($Connection) ...
combined_dataset/train/non-malicious/sample_28_7.ps1
sample_28_7.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("embedMedia", "bool", true); } else { command.get...
combined_dataset/train/non-malicious/Compare-DataSources.ps1
Compare-DataSources.ps1
#Define DPMHosts [CmdletBinding()] param([string]$PrimaryDPMHost, [string]$SecondaryDPMHost); Write-Verbose "Compare-DataSources.ps1 written by Shai Perednik sperednik@deloitte.com" Write-Verbose "Primary DPM Host: $PrimaryDPMHost" Write-Verbose "Secondary DPM Host: $SecondaryDPMHost" #Load DPM Snaping Write...
combined_dataset/train/non-malicious/sample_54_28.ps1
sample_54_28.ps1
# # Module manifest for module 'OCI.PSModules.Integration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Integration.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_39_65.ps1
sample_39_65.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apach...
combined_dataset/train/non-malicious/686.ps1
686.ps1
function Set-PbiRsUrlReservation { [cmdletbinding()] param ( [string] $ReportServerVirtualDirectory = "ReportServer", [string] $PortalVirtualDirectory="Reports", [Alias('SqlServerInstance')] [string] $ReportServerInstance...
combined_dataset/train/non-malicious/sample_32_99.ps1
sample_32_99.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/2898.ps1
2898.ps1
BuildTearDown { throw "forced error" } Task default -depends Compile,Test,Deploy Task Compile { "Compiling;" } Task Test -depends Compile { "Testing;" } Task Deploy -depends Test { "Deploying;" }
combined_dataset/train/non-malicious/2687.ps1
2687.ps1
$source = $PSScriptRoot; $programFilesFolder = [environment]::getfolderpath("ProgramFilesX86"); $PnPRoot = "$programFilesFolder\OfficeDevPnP"; $ModuleHome = "$PnPRoot\PowerShell\Modules\SharePoint.PowerShell.Commands" New-Item -Path $ModuleHome -ItemType Directory -Force Write-Host "Copying files from $source to $...
combined_dataset/train/non-malicious/sample_57_63.ps1
sample_57_63.ps1
# # Module manifest for module 'OCI.PSModules.Oda' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Oda.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/1261.ps1
1261.ps1
function Resolve-CPathCase { [CmdletBinding()] param( [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)] [string] [Alias('FullName')] $Path ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $Executi...
combined_dataset/train/non-malicious/Password Generator Form.ps1
Password Generator Form.ps1
Function Create-Password { #How many characters in the password [int]$passwordlength = 14 ##Make sure that number of characters below are not greater than $passwordlength!! #Minimum Upper Case characters in password [int]$min_upper = 3 ...
combined_dataset/train/non-malicious/sample_26_72.ps1
sample_26_72.ps1
# # Module manifest for module 'Microsoft.SME.WindowsUpdate' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.WindowsUpdate.psm1' # Version number of this module. ModuleVersion = '4.9.2' # Supported PSEditions # CompatiblePSEditions = @() # ID use...
combined_dataset/train/non-malicious/sample_3_62.ps1
sample_3_62.ps1
#************************************************ # TS_RemoteDesktopLServerKB2512845.ps1 # Version 1.0.1 # Date: 5/15/2012 # Author: v-kaw # Description: [Idea ID 2285] [Windows] Windows Server 2003 TS Licensing server does not renew new versions of TS Per Device CALs # Rule number: 2285 # Rule URL: //sharepo...
combined_dataset/train/non-malicious/sample_30_54.ps1
sample_30_54.ps1
# # Module manifest for module 'OCI.PSModules.Devops' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Devops.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/sample_22_72.ps1
sample_22_72.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 = '77.0.0' # Supported P...
combined_dataset/train/non-malicious/Build-TFSProjects.ps1
Build-TFSProjects.ps1
#------------------------------------------------------------------------- # Script that will: # 1. Create a workspace. Workspacce Name: _Root # 2. Get the latest code from repository #------------------------------------------------------------------------- Param( [switch] $CSRWEB, [switch]...
combined_dataset/train/non-malicious/3963.ps1
3963.ps1
function Check-CmdletReturnType { param($cmdletName, $cmdletReturn) $cmdletData = Get-Command $cmdletName Assert-NotNull $cmdletData [array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") } [array]...
combined_dataset/train/non-malicious/Select-Random v2.1.ps1
Select-Random v2.1.ps1
# --------------------------------------------------------------------------- ### <Script> ### <Author> ### Joel "Jaykul" Bennett ### </Author> ### <Description> ### Selects a random element from the collection either passed as a parameter or input via the pipeline. ### If the collection is passed in as an argum...
combined_dataset/train/non-malicious/sample_12_82.ps1
sample_12_82.ps1
@{ ModuleVersion = '7.0.1' GUID = '3859ddf6-1713-4701-adf3-477aeaa06333' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Microsoft® Corporation. All rights reserved." NestedModules="Newtonsoft.Json.dll" } # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDz...
combined_dataset/train/non-malicious/3613.ps1
3613.ps1
function Test-NewAzureRmAlertRuleWebhook { try { Assert-Throws { New-AzAlertRuleWebhook } "Cannot process command because of one or more missing mandatory parameters: ServiceUri." $actual = New-AzAlertRuleWebhook 'http://hello.com' Assert-AreEqual $actual.ServiceUri 'http://...
combined_dataset/train/non-malicious/2425.ps1
2425.ps1
$serversOuPath = 'OU=Servers,DC=powerlab,DC=local' $servers = Get-ADComputer -SearchBase $serversOuPath -Filter * | Select-Object -ExpandProperty Name $Header = @" <style> table { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; border-collapse: collapse; width: 100%; } th...
combined_dataset/train/non-malicious/Invoke-SqlCmd_2.ps1
Invoke-SqlCmd_2.ps1
function Invoke-Sqlcmd2 { param( [string]$ServerInstance, [string]$Database, [string]$Query, [Int32]$QueryTimeout=30 ) $conn=new-object System.Data.SqlClient.SQLConnection $conn.ConnectionString="Server={0};Database={1};Integrated Security=True" -f $ServerInstance,$Database ...
combined_dataset/train/non-malicious/1287.ps1
1287.ps1
function Get-CIisSecurityAuthentication { [CmdletBinding()] [OutputType([Microsoft.Web.Administration.ConfigurationSection])] param( [Parameter(Mandatory=$true)] [string] $SiteName, [Alias('Path')] [string] $VirtualPath = '', ...
combined_dataset/train/non-malicious/sample_67_46.ps1
sample_67_46.ps1
# diag_ads.psm1 # Created by tdimli # March 2020 # # Diagnostic functions for ADS area # version $ADS_version = "1.0.240717.0" # Area and Area/Component arrays $ADS = @("xray_ADS_Auth", "xray_ADS_gpo") #Component/Diagnostic Function arrays $xray_ADS_Auth = @("net_rpc_KB2506972") $xray_ADS_gpo = @("ads_...
combined_dataset/train/non-malicious/sample_5_44.ps1
sample_5_44.ps1
#************************************************ # DC_Setup_Addons.ps1 # Version 1.1 # Date: 2009-2019 # Author: Walter Eder (waltere@microsoft.com) # Description: Collects additional Setup information. # Called from: TS_AutoAddCommands_Setup.ps1 #******************************************************* Param...
combined_dataset/train/non-malicious/sample_30_71.ps1
sample_30_71.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/Time-Stamp.ps1
Time-Stamp.ps1
function Time-Stamp { return [System.DateTime]::Now.ToString("yyyy.MM.dd hh:mm:ss"); } New-Alias -Name ts -Value Time-Stamp;
combined_dataset/train/non-malicious/1820.ps1
1820.ps1
Describe "Hierarchical paths" -Tags "CI" { BeforeAll { $data = "Hello World" Setup -File testFile.txt -Content $data } It "should work with Join-Path " { $testPath = Join-Path $TestDrive testFile.txt Get-Content $testPath | Should -BeExactly $data } It "should wor...
combined_dataset/train/non-malicious/sample_30_3.ps1
sample_30_3.ps1
# # Module manifest for module 'OCI.PSModules.Jmsjavadownloads' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported...
combined_dataset/train/non-malicious/Compare-Property.ps1
Compare-Property.ps1
##############################################################################\n##\n## Compare-Property\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\nCompare...
combined_dataset/train/non-malicious/sample_35_58.ps1
sample_35_58.ps1
. "$PSScriptRoot/api.ps1" . "$PSScriptRoot/../php/api.ps1" function SetEnv { param ( $name, $value ) return "`$env:$name = `'$value`'`n" } $scheduledTasksFile = Get-Full-Path("Custom/scheduled-tasks/scheduled-tasks.json") $scheduledTasks = (Get-Content $scheduledTasksFile -Encoding UTF8 |...
combined_dataset/train/non-malicious/1411.ps1
1411.ps1
function Get-CGroup { [CmdletBinding()] [OutputType([DirectoryServices.AccountManagement.GroupPrincipal])] param( [string]$Name ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState Write-Timing ('Get-CGrou...
combined_dataset/train/non-malicious/1843.ps1
1843.ps1
$helperSource = @" using System; using System.Globalization; using System.Runtime.InteropServices; using System.Text; public class TestCounterHelper { private const long PDH_MORE_DATA = 0x800007D2L; private const int PDH_MAX_COUNTER_NAME = 1024; private const int PDH_MAX_COUNTER_P...
combined_dataset/train/non-malicious/test_3.ps1
test_3.ps1
[CmdletBinding()] param() "This file is in the $PSScriptRoot folder."
combined_dataset/train/non-malicious/2422.ps1
2422.ps1
[CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [ValidateScript({Test-Connection -ComputerName $_ -Quiet -Count 1})] [string]$Computername, [ValidateScript({ Test-Connection -ComputerName $_ -Quiet -Count 1 })] [string]$SiteServer = 'CONFIGMANAGER' ) begin...
combined_dataset/train/non-malicious/sample_23_2.ps1
sample_23_2.ps1
# # Module manifest for module 'OCI.PSModules.Datasafe' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datasafe.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/719.ps1
719.ps1
function Remove-RsSubscription { [CmdletBinding(SupportsShouldProcess = $True, ConfirmImpact = 'High')] param ( [Parameter(ParameterSetName='MutipleSubscriptions', Mandatory=$True, ValueFromPipeline=$True)] [object[]] $Subscription, [Parameter(ParameterSetName='SingleSu...
combined_dataset/train/non-malicious/sample_1_92.ps1
sample_1_92.ps1
# Load Reporting Utilities #_#$debug = $false # Load Common Library: . ./utils_cts.ps1 <# Load the SQL Common Library . ./utils_DSD.ps1 #SQL . ./TS_RemoteSetup.ps1 #Cluster,HyperV,Remote . ./utils_Exchange.ps1 #> trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.Script...
combined_dataset/train/non-malicious/985.ps1
985.ps1
Param( [parameter(Mandatory=$true)] $CsvFilePath ) $ErrorActionPreference = "Stop" $scriptsPath = $PSScriptRoot if ($PSScriptRoot -eq "") { $scriptsPath = "." } . "$scriptsPath\asr_logger.ps1" . "$scriptsPath\asr_common.ps1" . "$scriptsPath\asr_csv_processor.ps1" Function ProcessItemImpl($processor, $cs...
combined_dataset/train/non-malicious/sample_16_34.ps1
sample_16_34.ps1
#************************************************ # TS_SkypeFailureForMissingKB2703761Check.ps1 # Version 1.0.1 # Date: 3/13/2013 # Author: v-blchen # Description: [Idea ID 7499] [Windows] Win8:APP - Skype fails to start # Rule number: 7499 # Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/Disp...
combined_dataset/train/non-malicious/3895.ps1
3895.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) { ...
combined_dataset/train/non-malicious/sample_66_45.ps1
sample_66_45.ps1
@{ GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" FunctionsToExport = @() CmdletsToExport = "Get-Acl", "Set-Acl", "G...
combined_dataset/train/non-malicious/1380.ps1
1380.ps1
function Resolve-CIdentityName { [CmdletBinding(DefaultParameterSetName='ByName')] [OutputType([string])] param( [Parameter(Mandatory=$true,ParameterSetName='ByName',Position=0)] [string] $Name, [Parameter(Mandatory=$true,ParameterSetName='BySid')] ...
combined_dataset/train/non-malicious/Get-ADNonExpPass.ps1
Get-ADNonExpPass.ps1
param ($LDAPPath = "", [switch]$Help) if ($Help) { "" Write-Host "Usage: .\\Get-ADNonExpPass.ps1 <LDAPPath>" -foregroundcolor Yellow Write-Host "Ex: .\\Get-ADNonExpPass.ps1 'LDAP://ou=users,dc=domain,dc=com'" -foregroundcolor Yellow "" break } #UAC Flag in Hex #http://support.microsoft.com/kb/30514...
combined_dataset/train/non-malicious/sample_33_34.ps1
sample_33_34.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 = '79.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_15_24.ps1
sample_15_24.ps1
ConvertFrom-StringData @' id_kb2475761title=Checking Event Logs id_kb2475761description=Checking event logs for known issues. '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIB...
combined_dataset/train/non-malicious/4370.ps1
4370.ps1
function Get-RequiresString { [CmdletBinding()] Param ( [Parameter()] [Object[]] $RequiredModules ) Process { if($RequiredModules) { $RequiredModuleStrings = @() foreach($requiredModuleObject in $RequiredModules) { ...
combined_dataset/train/non-malicious/Get-OLEDBData_2.ps1
Get-OLEDBData_2.ps1
########################################################################### # Get-OLEDBData # -------------------------------------------- # Description: This function is used to retrieve data via an OLEDB data # connection. # # Inputs: $connectstring - Connection String. # $sql ...
combined_dataset/train/non-malicious/ConvertTo-DN_1.ps1
ConvertTo-DN_1.ps1
#Author: Glenn Sizemore glnsize@get-admin.com # #Purpose: Convert a DN to a Canonical name, and back again. # #Example: PS > ConvertFrom-Canonical 'get-admin.local/test/test1/Sizemore, Glenn E' # CN=Sizemore\\, Glenn E,OU=test1,OU=test,DC=getadmin,DC=local # PS > ConvertFrom-DN 'CN=Sizemore\\, Glenn E,OU=t...
combined_dataset/train/non-malicious/sample_55_34.ps1
sample_55_34.ps1
@{ GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" CmdletsToExport = @( 'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al...
combined_dataset/train/non-malicious/Get-MacAddressOui.ps1
Get-MacAddressOui.ps1
function Get-MacAddressOui { <# .SYNOPSIS Gets a MAC address OUI (Organizationally Unique Identifier). .DESCRIPTION The Get-MacAddressOui function retrieves the MAC address OUI reference list maintained by the IEEE standards website and returns the name of the company to which the MAC address OUI is ass...
combined_dataset/train/non-malicious/2790.ps1
2790.ps1
if (Get-Command logparser.exe) { $lpquery = @" SELECT COUNT(Protocol, LocalAddress, ForeignAddress, State, ConPId, Component, Process) as ct, Protocol, LocalAddress, ForeignAddress, State, ConPid, Componen...
combined_dataset/train/non-malicious/chkhash_21.ps1
chkhash_21.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/2415.ps1
2415.ps1
function Get-DPContent { [CmdletBinding()] [OutputType([PSObject[]])] Param ( [Parameter(Mandatory = $true, ValueFromPipeline, ValueFromPipelineByPropertyName)] [string[]]$DPname, [Parameter()] [ValidateSet("Package", "Application", "ImagePackage", "BootImagePackage", "DriverPackage"...
combined_dataset/train/non-malicious/sample_31_80.ps1
sample_31_80.ps1
# # Module manifest for module 'OCI.PSModules.Loganalytics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loganalytics.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/4004.ps1
4004.ps1
function Test-E2ECertificates { $resourceGroupName = "to-delete-01" $automationAccountName = "fbs-aa-01" $thumprint = "3a7dfabed24f7443e79e815239c51826042737dc" $thumbprint2 = "38dae807ad6fb1f42bde1658b5abec85ace5615e" $Password = ConvertTo-SecureString -String "Password" -AsPlainText...
combined_dataset/train/non-malicious/73.ps1
73.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/sample_40_69.ps1
sample_40_69.ps1
# # Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker' # # Generated by: Microsoft Corporation # # Generated on: 19/01/2022 # @{ # Script module or binary module file associated with this manifest. RootModule = '' # Version number of this module. ModuleVersion = '1.2100.2531...
combined_dataset/train/non-malicious/CertMgmt pack_3.ps1
CertMgmt pack_3.ps1
##################################################################### # CertMgmtPack.ps1 # Version 0.51 # # Digital certificate management pack # # Vadims Podans (c) 2009 # http://www.sysadmins.lv/ ##################################################################### #requires -Version 2.0 function Import-C...
combined_dataset/train/non-malicious/1366.ps1
1366.ps1
function Disable-CIEEnhancedSecurityConfiguration { [CmdletBinding(SupportsShouldProcess=$true)] param( ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $adminPath = "SOFTWARE\Microsoft\Active Setup\Installed Components\{A...
combined_dataset/train/non-malicious/4423.ps1
4423.ps1
function Publish-Script { [CmdletBinding(SupportsShouldProcess = $true, PositionalBinding = $false, DefaultParameterSetName = 'PathParameterSet', HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=619788')] Param ( [Parameter(Mandatory = $true, ValueFromPipel...
combined_dataset/train/non-malicious/1584.ps1
1584.ps1
function New-MrCimSession { [CmdletBinding()] param( [Parameter(ValueFromPipeline)] [ValidateNotNullorEmpty()] [string[]]$ComputerName = $env:COMPUTERNAME, [System.Management.Automation.Credential()]$Credential = [System.Management.Automation.PSCredential]::Empty ) B...
combined_dataset/train/non-malicious/3555.ps1
3555.ps1
$containerName = "pstestwlvm1bca8" $resourceGroupName = "pstestwlRG1bca8" $vaultName = "pstestwlRSV1bca8" $resourceId = "/subscriptions/da364f0f-307b-41c9-9d47-b7413ec45535/resourceGroups/pstestwlRG1bca8/providers/Microsoft.Compute/virtualMachines/pstestwlvm1bca8" $policyName = "HourlyLogBackup" $instance...
combined_dataset/train/non-malicious/sample_27_39.ps1
sample_27_39.ps1
# # Module manifest for module 'OCI.PSModules.Managementagent' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Managementagent.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported P...
combined_dataset/train/non-malicious/3496.ps1
3496.ps1
function Test-LocationCompleter { $resourceTypes = @("Microsoft.Batch/operations") $locations = [Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters.LocationCompleterAttribute]::FindLocations($resourceTypes, -1) $expectedResourceType = (Get-AzResourceProvider -ProviderNamespace "Microso...
combined_dataset/train/non-malicious/4482.ps1
4482.ps1
configuration PSModule_InstallModuleAllowClobberConfig { param ( [Parameter()] [System.String[]] $NodeName = 'localhost', [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [System.String] $ModuleName ) Import-DscResource -ModuleName ...
combined_dataset/train/non-malicious/4396.ps1
4396.ps1
function Copy-ScriptFile { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $SourcePath, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $DestinationPath, ...
combined_dataset/train/non-malicious/1301.ps1
1301.ps1
function Get-CMsi { [CmdletBinding()] [OutputType('Carbon.Msi.MsiInfo')] param ( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] [Alias('FullName')] [string[]] $Path ) begin { Set-StrictMode -...
combined_dataset/train/non-malicious/sample_37_77.ps1
sample_37_77.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Microsoft.PowerShell.Utility\Import-LocalizedData -BindingVariable Strings -FileName Strings -ErrorAction Ignore Microsoft.PowerShell.Management\Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 | ForEach-Object { . $PSItem.FullName } ...
combined_dataset/train/non-malicious/3142.ps1
3142.ps1
$Result = [pscustomobject] @{ Result1 = $Result1 Result2 = $Result2 } Return $Result [System.Collections.ArrayList]$Results = @() foreach($Item in $Items) { $Result = [pscustomobject] @{ Result1 = $Item.Result1 Result2 = $Item.Result2 } [void]$Results.Add($Result) } Return $...
combined_dataset/train/non-malicious/Aero Glass PowerShell.ps1
Aero Glass PowerShell.ps1
#requires -version 2 param([switch]$Disable) add-type -namespace Hacks -name Aero -memberdefinition @" [StructLayout(LayoutKind.Sequential)] public struct MARGINS { public int left; public int right; public int top; public int bottom; } [DllImport("d...
combined_dataset/train/non-malicious/Convert Raw SID to SID_1.ps1
Convert Raw SID to SID_1.ps1
#For intel concerning how to convert raw hex SID to Standard SID got to #http://blogs.msdn.com/b/oldnewthing/archive/2004/03/15/89753.aspx #to convert Hex to Dec function Convert-HEXtoDEC { param($HEX) ForEach ($value in $HEX) { [string][Convert]::ToInt32($value,16) } } #to reassort decimal values to co...
combined_dataset/train/non-malicious/sample_7_28.ps1
sample_7_28.ps1
#************************************************ # DC_Bluetooth-Component.ps1 # Version 1.0: Created # Date: 2020 # Author: Walter Eder (waltere@microsoft.com) # Description: Collects information about the Bluetooth Component. #******************************************************* Trap [Exception] { # ...
combined_dataset/train/non-malicious/Start-ProcessAsUser.ps1
Start-ProcessAsUser.ps1
##############################################################################\n##\n## Start-ProcessAsUser\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\nLaun...
combined_dataset/train/non-malicious/Get-WebSite_7.ps1
Get-WebSite_7.ps1
function Get-WebSite { <# .SYNOPSIS Retrieves information about a website. .DESCRIPTION Retrieves information about a website. .PARAMETER Url URL of the website to test access to. .PARAMETER UseDefaultCredentials Use the currently authenticated user's credentials .PARAMETER Proxy Us...
combined_dataset/train/non-malicious/3228.ps1
3228.ps1
$outputDir = Join-Path -Path $ENV:BHProjectPath -ChildPath 'out' $outputModDir = Join-Path -Path $outputDir -ChildPath $env:BHProjectName $manifest = Import-PowerShellDataFile -Path $env:BHPSModuleManifest $outputModVerDir = Join-Path -Path $outputModDir -ChildPath $manifest.ModuleVersion $commands = Get-Comman...
combined_dataset/train/non-malicious/1112.ps1
1112.ps1
$siteName = 'Anonymous Authentication' $sitePort = 4387 $webConfigPath = Join-Path $TestDir web.config function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { Uninstall-IisWebsite $siteName Install-IisWebsite -Na...
combined_dataset/train/non-malicious/2030.ps1
2030.ps1
Describe "Nullable Boolean DCR Tests" -Tags "CI" { BeforeAll { function ParserTestFunction { param([bool]$First) $PSBoundParameters } function parsertest-bool2 { [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory = ...
combined_dataset/train/non-malicious/ExecutePowerShell.cmd.ps1
ExecutePowerShell.cmd.ps1
:: <# copy %0 %0.ps1 PowerShell.exe -ExecutionPolicy Unrestricted -NoProfile -Command "$ErrorActionPreference = 'SilentlyContinue'; . %0.ps1; Remove-Item %0.ps1" exit :: #> $ErrorActionPreference = 'Continue' ### Your PowerShell script goes below here. ### I've put a couple of lines as an example ... ls | sor...
combined_dataset/train/non-malicious/sample_10_31.ps1
sample_10_31.ps1
@{ GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Get-Credential", "Get-ExecutionPolicy", "Set-E...
combined_dataset/train/non-malicious/sample_14_96.ps1
sample_14_96.ps1
# # Module manifest for module 'OCI.PSModules.Usage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Usage.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_3_73.ps1
sample_3_73.ps1
#************************************************ # TS_IPv6Check.ps1 # Version 1.0 # Date: 5-1-2012 # Author: davidcop # Description: Checks for nics with IPv6 unchecked and the disabledcomponents registry value does not exist #************************************************ #_# update for Win10 if ((($OSVe...
combined_dataset/train/non-malicious/616.ps1
616.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "https://download-installer.cdn.mozilla.net/pub/firefox/releases/27.0.1/win32/de/Firefox%20Setup%20Stub%2027.0.1.exe" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" } $Conf...
combined_dataset/train/non-malicious/sample_57_36.ps1
sample_57_36.ps1
@Не можна виконати метод, якщо вимкнуто сховище багатьох знімків.fЗапит обмежено. Користувачі ініціювали забагато запитів на оновлення джерела даних за короткий період.ZБракує дозволів на оновлення таблиці Direct Lake. Зверніться до автора цього набору даних.gНеможливо зберегти метадані знімка бази даних. Вона вилучаєт...
combined_dataset/train/non-malicious/Get-User_4.ps1
Get-User_4.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/sample_6_43.ps1
sample_6_43.ps1
# $ConfigXMLPath = $Path ### Do not remove this param line # 2023-02-20 WalterE mod Trap #we# trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $...
combined_dataset/train/non-malicious/sample_37_37.ps1
sample_37_37.ps1
$ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest $script:GCInstallPath = "$PSScriptRoot\..\..\.." $script:GCBinariesFolderName = "GC" $script:GCBinariesPath = Join-Path $script:GCInstallPath $script:GCBinariesFolderName $script:CleanupExePath = Join-Path $script:GCBinariesPath "em_extension_cleanup...
combined_dataset/train/non-malicious/Set-Domain_2.ps1
Set-Domain_2.ps1
function Set-Domain { param( [switch]$help, [string]$domain=$(read-host "Please specify the domain to join"), [System.Management.Automation.PSCredential]$credential = $(Get-Crdential) ) $usage = "`$cred = get-credential `n" $usage += "Set-AvaDomain -domain corp.avanade.org -credential `$cred`n" ...
combined_dataset/train/non-malicious/sample_21_59.ps1
sample_21_59.ps1
#************************************************ # TS_DetectRootSize.ps1 # Version 1.0.1 # Date: 1/15/2013 # Author: Tspring # Description: [Idea ID 6816] [Windows] Detect Certificate Root Store Size Problems # Rule number: 6816 # Rule URL: "http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.aspx?...
combined_dataset/train/non-malicious/sample_30_6.ps1
sample_30_6.ps1
# # Script module for module 'Az.EventGrid' that is executed when 'Az.EventGrid' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 05/16/2024 06:33:07 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try { ...
combined_dataset/train/non-malicious/Migrate UserFolder_1.ps1
Migrate UserFolder_1.ps1
param( $RootFolder = "\\\\domain.local\\users", $NewRootFolder = "\\\\domain.local\\users2", $LogFolder = "c:\\Projects\\HomeDirs", $NewSubFolders = @("Documents","Favorites","Desktop","Links","Contacts","BlaBla"), [switch]$SetACL ) $UserFolders = gci -Path $RootFolder | ?{$_.PSIsContainer} $UserFolders | forea...
combined_dataset/train/non-malicious/2916.ps1
2916.ps1
properties { $x = 42 } task default -depends 'TaskAFromModuleA' task 'TaskAFromModuleA' -FromModule TaskModuleA -depends TaskAFromModuleB task 'TaskAFromModuleB' -Frommodule TaskModuleB -minimumVersion 0.2.0 -depends xxx -continueOnError task xxx { throw 'oops' } task 'TaskbFromModuleA' -FromModule TaskMo...
combined_dataset/train/non-malicious/sample_62_49.ps1
sample_62_49.ps1
# ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Licen...
combined_dataset/train/non-malicious/sample_57_2.ps1
sample_57_2.ps1
# # Module manifest for module 'OCI.PSModules.Fleetsoftwareupdate' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Fleetsoftwareupdate.dll' # Version number of this module. ModuleVersion = '85.1.0' # Sup...
combined_dataset/train/non-malicious/sample_5_95.ps1
sample_5_95.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 = '93.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/Test-WebDAV_2.ps1
Test-WebDAV_2.ps1
function Test-WebDav () { param ( $Url = "$( throw 'URL parameter is required.')" ) $xhttp = New-Object -ComObject msxml2.xmlhttp $xhttp.open("OPTIONS", $url, $false) $xhttp.send() if ( $xhttp.getResponseHeader("DAV") ) { $true } else { $false } }
combined_dataset/train/non-malicious/sample_25_52.ps1
sample_25_52.ps1
# # Module manifest for module 'OCI.PSModules.Waa' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waa.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/485.ps1
485.ps1
function Remove-EnvironmentVariableValue{ [CmdletBinding()] param( [Parameter(Mandatory=$true)] [String] $Name, [Parameter(Mandatory=$true)] [String] $Value, [Parameter(Mandatory=$true)] [String] $Target, [Switch] $Clear ) [Environme...