full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/3549.ps1
3549.ps1
$resourceGroupName = "RecoveryServicesBackupTestRg"; $resourceName = "PsTestRsVault"; $policyName = "PsTestPolicy"; $defaultPolicyName = "DefaultPolicy"; $DefaultSnapshotDays = 2; $UpdatedSnapShotDays = 5; $oldResourceGroupName = "shracrg" $oldVaultName = "shracsql" $oldPolicyName = "iaasvmretentionchec...
combined_dataset/train/non-malicious/New-XVM_3.ps1
New-XVM_3.ps1
#Examples <# New-XVM -Name "WS2012-TestServer01" -SwitchName "Switch(192.168.2.0/24)" -VhdType NoVHD New-XVM -Name "WS2012-TestServer02" -SwitchName "Switch(192.168.2.0/24)" -VhdType ExistingVHD -VhdPath 'D:\\vhds\\WS2012-TestServer02.vhdx' New-XVM -Name "WS2012-TestServer03" -SwitchName "Switch(192.168.2.0/24)" ...
combined_dataset/train/non-malicious/4126.ps1
4126.ps1
param ( [string]$WindowsRepository, [string]$BIOSPassword, [switch]$BIOS, [switch]$Drivers, [switch]$Applications, [string]$WinPERepository ) function Get-Architecture { [CmdletBinding()][OutputType([string])] param () $OSArchitecture = (Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArch...
combined_dataset/train/non-malicious/TabExpansion for V2CTP_2.ps1
TabExpansion for V2CTP_2.ps1
## Tab-Completion ################# ## For V2CTP3. ## This won't work on V1 and V2CTP and V2CTP2. ## Please dot souce this script file. ## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list. ## ## What this can do is: ## ## [datetime]::n<tab> ## [datetime]::now.d...
combined_dataset/train/non-malicious/sample_22_33.ps1
sample_22_33.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/1125.ps1
1125.ps1
& (Join-Path -Path $PSScriptRoot 'Initialize-CarbonTest.ps1' -Resolve) function Assert-HostsFileContains { param( [Parameter(ParameterSetName='ExactLine')] $Line, [Parameter(ParameterSetName='ConstructLine')] [Net.IPAddress] $IPAddress, [Parameter(Parame...
combined_dataset/train/non-malicious/sample_39_70.ps1
sample_39_70.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ##################################################################################################### # # Registers the WinRM endpoint for this instance of PowerShell. # # If the parameters '-PowerShellHome' were specified, it means that t...
combined_dataset/train/non-malicious/94.ps1
94.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_49_86.ps1
sample_49_86.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 = '80.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/Find files not containig.ps1
Find files not containig.ps1
# Find all files which does not contains the text in $Pattern function ssHasNot( [string] $Path="*.txt" ,[string] $pattern="" ) { $has=[string]@(get-childitem $path | ss $pattern | foreach {$_.Path}) get-childitem $path| where {$has.Contains($_.FullName) -eq $false} }
combined_dataset/train/non-malicious/Simplest animation.ps1
Simplest animation.ps1
[int]$x = 0 [int]$y = 0 [int]$cX = 200 [int]$cY = 200 [int]$rad = 100 [int]$grad = 0 [float]$kfc = 0.5 $tabPag1_OnPaint= { $tmrTim2.Enabled = $false $g = $tabPag1.CreateGraphics() $pen = New-Object Drawing.Pen([Drawing.Brushes]::Red) $g.DrawRectangle($pen, [Convert]::ToInt32($cX - 100), [Convert]...
combined_dataset/train/non-malicious/sample_37_22.ps1
sample_37_22.ps1
# # Module manifest for module 'OCI.PSModules.Globallydistributeddatabase' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Globallydistributeddatabase.dll' # Version number of this module. ModuleVersion =...
combined_dataset/train/non-malicious/format-iislog.ps1
format-iislog.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/Get- ExchangeMBStore.ps1
Get- ExchangeMBStore.ps1
Param ( [Parameter(Position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$true)] [alias("Name","ComputerName")]$Computer=@("xcserver01") ) process{ $XCinfo = GetXCDatabases $Computer $XCMaintInfo = GetMBStoreMaintenance $Computer foreach ($DB in $XCinfo){ try{ $DB.WhiteSpace = $XCMaintInfo[$D...
combined_dataset/train/non-malicious/sample_63_67.ps1
sample_63_67.ps1
# # Module manifest for module 'OCI.PSModules.Capacitymanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Capacitymanagement.dll' # Version number of this module. ModuleVersion = '85.1.0' # Suppo...
combined_dataset/train/non-malicious/sample_53_42.ps1
sample_53_42.ps1
# # Module manifest for module 'OCI.PSModules.Ocicontrolcenter' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ocicontrolcenter.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported...
combined_dataset/train/non-malicious/sample_61_30.ps1
sample_61_30.ps1
# # Module manifest for module 'OCI.PSModules.Functions' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Functions.dll' # Version number of this module. ModuleVersion = '90.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/3787.ps1
3787.ps1
Param( [Parameter(Mandatory = $true, HelpMessage="Name of the resource group to which the KeyVault belongs to. A new resource group with this name will be created if one doesn't exist")] [ValidateNotNullOrEmpty()] [string]$resourceGroupName, [Parameter(Mandatory = $true, HelpMess...
combined_dataset/train/non-malicious/sample_46_7.ps1
sample_46_7.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/Get-WMIVersions_2.ps1
Get-WMIVersions_2.ps1
#Requires -Version 2 param ( $Credential, $ComputerName ) # The official way to detect .NET versions is to look at their known location on the hard drive as per # this article: http://msdn.microsoft.com/en-us/kb/kb00318785.aspx # thanks to David M (http://twitter.com/makovec) for the WQL $query = "select name...
combined_dataset/train/non-malicious/sample_12_77.ps1
sample_12_77.ps1
##---------------------------------------------------------------------------- ## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved. ##---------------------------------------------------------------------------- # Import string constants . ./StringConstants.ps1 # Import shared functions and var...
combined_dataset/train/non-malicious/sample_8_7.ps1
sample_8_7.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", "Get-PfxCertific...
combined_dataset/train/non-malicious/sample_35_75.ps1
sample_35_75.ps1
(self.webpackChunkshell_app=self.webpackChunkshell_app||[]).push([[179,429],{4174:(W,F,d)=>{"use strict";d.d(F,{X:()=>f});var u=d(8714);let f=(()=>{class s{static themeStorageKey="msft.sme.shell-assetManager-theme";static defaultTheme="light";static darkTheme="dark";static assets;static get theme(){const c=MsftSme.Loca...
combined_dataset/train/non-malicious/sample_63_68.ps1
sample_63_68.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_4_48.ps1
sample_4_48.ps1
# Copyright ?2010, Microsoft Corporation. All rights reserved. # You may use this code and information and create derivative works of it, # provided that the following conditions are met: # 1. This code and information and any derivative works may only be used for # troubleshooting a) Windows and b) products for ...
combined_dataset/train/non-malicious/1259.ps1
1259.ps1
function Format-CADSearchFilterValue { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $String ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $string = $string.Repl...
combined_dataset/train/non-malicious/sample_65_31.ps1
sample_65_31.ps1
$ServerCertificateName = "CN=ServiceFabricServerCert" $ClientCertificateName = "CN=ServiceFabricClientCert" function IsSecurityX509([string]$ClusterConfigFilePath) { $jsonConfig = Get-Content $ClusterConfigFilePath -Raw | ConvertFrom-Json $properties = $jsonConfig.properties if ($properties -ne $Nul...
combined_dataset/train/non-malicious/833.ps1
833.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/Get-WebFile _1.1.ps1
Get-WebFile _1.1.ps1
## Get-WebFile.ps1 (aka wget for PowerShell) ############################################################################################################## ## Downloads a file or page from the web ## History: ## v3.1 - Unwrap the filename when it has quotes around it ## v3 - rewritten completely using HttpWebReq...
combined_dataset/train/non-malicious/sample_43_26.ps1
sample_43_26.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 = '77.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/901.ps1
901.ps1
$gitdirectory="<Replace with path to local Git repo>" $webappname="mywebapp$(Get-Random)" cd $gitdirectory New-AzWebApp -Name $webappname git push azure master
combined_dataset/train/non-malicious/404.ps1
404.ps1
if (-not [PSFramework.Configuration.ConfigurationHost]::ImportFromRegistryDone) { $config_hash = Read-PsfConfigPersisted -Scope 127 foreach ($value in $config_hash.Values) { try { if (-not $value.KeepPersisted) { Set-PSFConfig -FullName $value.FullName -Value $value.Value -EnableException } else { Set-...
combined_dataset/train/non-malicious/3819.ps1
3819.ps1
function Test-NewAzureRmVhdVMWithValidDiskFile { $rgname = Get-ComputeTestResourceName try { [string]$loc = Get-ComputeVMLocation; $loc = $loc.Replace(' ', ''); New-AzResourceGroup -Name $rgname -Location $loc -Force; [string]$file = ...
combined_dataset/train/non-malicious/sample_34_87.ps1
sample_34_87.ps1
########################################################################################## # <copyright file="Microsoft.EnterpriseManagement.OperationsManager.ClientShell.NonInteractiveStartup.ps1" company="Microsoft"> # Copyright (c) Microsoft Corporation. All rights reserved. # </copyright> # <summary>Micros...
combined_dataset/train/non-malicious/1408.ps1
1408.ps1
function Uninstall-CMsmqMessageQueue { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $Name, [Switch] $Private ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSC...
combined_dataset/train/non-malicious/sample_27_60.ps1
sample_27_60.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/3862.ps1
3862.ps1
function Test-NewExchangeConnectionV4V6 { $kind = isDirect $false; $loc = "Los Angeles" $peeringLocation = getPeeringLocation $kind $loc; $facilityId = $peeringLocation[0].PeeringDBFacilityId Write-Debug "Creating Connection at $facilityId" $md5 = getHash $md5 = $md5.ToString() Write-Debug "Cr...
combined_dataset/train/non-malicious/sample_11_70.ps1
sample_11_70.ps1
ConvertFrom-StringData @' id_appliedsectemploutput=Applied Security Templates id_appliedsectemplobtaining=Gathering applied security templates '@ # SIG # Begin signature block # MIIoVAYJKoZIhvcNAQcCoIIoRTCCKEECAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG #...
combined_dataset/train/non-malicious/2040.ps1
2040.ps1
Describe "Credential tests" -Tags "CI" { It "Explicit cast for an empty credential returns null" { [PSCredential]::Empty.GetNetworkCredential() | Should -BeNullOrEmpty } }
combined_dataset/train/non-malicious/sample_6_54.ps1
sample_6_54.ps1
[ dynamic, provider("dcismprovider"), Association, Description ( "DCIM_MetricDefForME is a derivation of CIM_MetricDefForME " "and represents an association that ties a DCIM_BaseMetricDefinition " "to a CIM_ManagedElement to define metrics for the latter." ) ] class DCIM_MetricDefForME : C...
combined_dataset/train/non-malicious/sample_0_97.ps1
sample_0_97.ps1
#************************************************ # TS_RegistrySizeLimitCheck.ps1 # Version 1.0 # Date: 12-21-2011 # Author: v-anecho # Description: The RegistrySizeLimit entry exists in the registry. This may cause the computer to stop responding as well as log Event ID 333's in the System Event Log. #**********...
combined_dataset/train/non-malicious/sample_48_89.ps1
sample_48_89.ps1
param ( [Parameter(Mandatory = $true)] [PSObject] $Session, [Parameter(Mandatory = $true)] [string] $WindowsRegistryKeyPath ) Invoke-Command -Session $Session -ArgumentList $WindowsRegistryKeyPath -ScriptBlock { param($WindowsRegistryKeyPath) try { $returnArrayObject = @(...
combined_dataset/train/non-malicious/sample_18_10.ps1
sample_18_10.ps1
@{ GUID="{Fb6cc51d-c096-4b38-b78d-0fed6277096a}" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" RootModule="Microsoft.Management.Infrastructure.CimCmdlets" RequiredAssembli...
combined_dataset/train/non-malicious/sample_40_76.ps1
sample_40_76.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Advisor.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.Advisor.Module]::Instance # Export nothing to clear implicit exports ...
combined_dataset/train/non-malicious/sample_25_33.ps1
sample_25_33.ps1
######################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # Localized PackageManagement.Resources.psd1 # ######################################################################################### ConvertFrom-StringDa...
combined_dataset/train/non-malicious/sample_25_93.ps1
sample_25_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 Licen...
combined_dataset/train/non-malicious/612.ps1
612.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "https://1.eu.dl.wireshark.org/win64/Wireshark-win64-1.10.5.exe" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" } $Configs | ForEach-Object{ try{ $_.Result = ...
combined_dataset/train/non-malicious/sample_46_89.ps1
sample_46_89.ps1
function Clear-NearbyShareInstallation { # Remove shortcuts in start menu for all users Write-Host 'Started to remove shortcuts ...' $profiles = Get-WmiObject -Class Win32_UserProfile foreach ($profile in $profiles) { if ($profile.Special) { continue } $userStartMenuPath = Join-Pat...
combined_dataset/train/non-malicious/4296.ps1
4296.ps1
if($IsWindows -eq $false) { return } Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue $Script:RepositoryName = 'Local' $SourceLocation = "$PSScriptRoot\PSGalleryTestRepo" $Script:RegisteredLocalRepo = $...
combined_dataset/train/non-malicious/sample_35_14.ps1
sample_35_14.ps1
# # Module manifest for module 'OCI.PSModules.Functions' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Functions.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_49_8.ps1
sample_49_8.ps1
5PrintAllTranslations 限制不能与 IgnoreTranslations 限制一起使用。8无法将计算列 "%{ccon_column/}" 添加到混合表 "%{ccon_table/}"。请删除计算列。D不能将用于聚合的 "alternateOf" 列添加到混合表 "%{ccon_table/}"。请删除 "alternateOf" 列。p不能创建用于聚合的 "alternateOf" 列,该聚合引用混合表 "%{ccon_baseTable/}" 作为其 BaseTable。请在 DirectQuery 模式下引用基表或删除 "alternateOf" 列。C无法在表 "%{ccon_table/}" 的 D...
combined_dataset/train/non-malicious/PS2WCF_6.ps1
PS2WCF_6.ps1
<# .SYNOPSIS Functions to call WCF Services With PowerShell. .NOTES Version 1.2 11.02.2012 Requires Powershell v2 and .NET 3.5 Original version by Christian Glessner Blog: http://www.iLoveSharePoint.com Twitter: http://twitter.com/cglessner Codeplex: http://codeplex.com/iLoveSharePoint PowerS...
combined_dataset/train/non-malicious/sample_62_57.ps1
sample_62_57.ps1
# # Module manifest for module 'OCI.PSModules.Opensearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opensearch.dll' # Version number of this module. ModuleVersion = '90.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_52_69.ps1
sample_52_69.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.apa...
combined_dataset/train/non-malicious/sample_21_69.ps1
sample_21_69.ps1
@{ GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @( 'MSFT_MpComputerStatus.cdxml', 'MSFT_Mp...
combined_dataset/train/non-malicious/USB Script backup_3.ps1
USB Script backup_3.ps1
<# .SYNOPSIS Backup-ToUSB.ps1 (Version 2.2, 9 Jan 2012) .DESCRIPTION This script will backup recently changed *.ps1,*.psm1,*.psd1 files from any selected folder (default is $pwd) to any number of inserted USB devices, on which an archive folder 'PSarchive' will be created if it does not already exist. As a U...
combined_dataset/train/non-malicious/1945.ps1
1945.ps1
Describe "Export-FormatData" -Tags "CI" { BeforeAll { $fd = Get-FormatData $testOutput = Join-Path -Path $TestDrive -ChildPath "outputfile" } AfterEach { Remove-Item $testOutput -Force -ErrorAction SilentlyContinue } It "Can export all types" { try { ...
combined_dataset/train/non-malicious/sample_57_87.ps1
sample_57_87.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 = '83.3.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/2521.ps1
2521.ps1
Param( $Clients = "" , $TableName = "" , $DropIndexStatement = "" , $IndexName = "" ) $UnusedIndexesQuery = "sel_SQLIndexesUnusedByDatabase" function Run-Query() { param ( $SqlQuery, $SqlServer, $SqlCatalog ) $SqlConnection = New-Object System.Data.SqlClient.SqlConnection("Data Sour...
combined_dataset/train/non-malicious/3348.ps1
3348.ps1
function About { [PoshBot.BotCommand( Permissions = 'view' )] [cmdletbinding()] param( [parameter(Mandatory)] $Bot ) $path = "$PSScriptRoot/../../../PoshBot.psd1" $manifest = Import-PowerShellDataFile -Path $path $ver = $manifest.ModuleVersion $msg = @...
combined_dataset/train/non-malicious/Get-AclMisconfiguration..ps1
Get-AclMisconfiguration..ps1
##############################################################################\n##\n## Get-AclMisconfiguration\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\n...
combined_dataset/train/non-malicious/sample_43_10.ps1
sample_43_10.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\sucrase@3.35.0\node_modules\sucrase\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\sucrase@...
combined_dataset/train/non-malicious/sample_37_7.ps1
sample_37_7.ps1
@{ GUID="eb74e8da-9ae2-482a-a648-e96550fb8733" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="© Microsoft Corporation. All rights reserved." Description='PowerShell module for working with ZIP archives.' ModuleVersion="1.2.5" PowerShellVersion="3.0" FunctionsToExport = @('Compress...
combined_dataset/train/non-malicious/2563.ps1
2563.ps1
Function Get-LocalDomainController($objectDomain) { return ([System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite()).Servers | Where-Object { $_.Domain.Name -eq $objectDomain } | ForEach-Object { $_.Name } | Select-Object -first 1 } Function Get-ObjectADDomain($distinguishedName) { ret...
combined_dataset/train/non-malicious/Out-Balloon.ps1
Out-Balloon.ps1
<# .Synopsis Makes a baloon tip in the notification area .Description With just a few arguments, it is easy to make some text appear in a little balloon. You can specify an icon file (*.ico) with the -icon argument, if you don't then the embedded ! icon is used. It's blue. out-b...
combined_dataset/train/non-malicious/sample_64_81.ps1
sample_64_81.ps1
# # Module manifest for module 'OCI.PSModules.Functions' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Functions.dll' # Version number of this module. ModuleVersion = '85.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/New Switch and Portgroup.ps1
New Switch and Portgroup.ps1
get-vc vcservername Get-VMHost | New-VirtualSwitch -Name SwitchName Get-VMHost | Get-VirtualSwitch -Name SwitchName | New-VirtualPortGroup -Name portgroupname -VLANID vlan_number
combined_dataset/train/non-malicious/188.ps1
188.ps1
function New-SCCMDeviceVariable { [cmdletbinding()] PARAM ( [parameter(Mandatory = $true)] [Alias('SiteServer')] [System.String]$ComputerName, [parameter(Mandatory = $true)] [System.String]$SiteCode, [Alias("RunAs")] [System.Management.Automation.Cr...
combined_dataset/train/non-malicious/297.ps1
297.ps1
function Test-PSFParameterBinding { [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Test-PSFParameterBinding')] Param ( [Parameter(Mandatory = $true, Position = 0)] [string[]] $ParameterName, [Alias('Reverse')] [switch] $Not, [switch] $And, [Validat...
combined_dataset/train/non-malicious/sample_4_98.ps1
sample_4_98.ps1
ConvertFrom-StringData @' id_veritasvxiobadconfigflags_sd=VXIO device has a bad state flag and this may cause shadown copies of Veritas volumes to fail. '@ # SIG # Begin signature block # MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE...
combined_dataset/train/non-malicious/1027.ps1
1027.ps1
$ApplicationPackagePath = "C:\Users\sfuser\documents\visual studio 2017\Projects\Voting\Voting\pkg\Debug" $ApplicationName = "fabric:/Voting" $ApplicationTypeName = "VotingType" $ApplicationTypeVersion = "1.3.0" $imageStoreConnectionString = "fabric:ImageStore" $CopyPackageTimeoutSec = 600 $CompressPackage = $false ...
combined_dataset/train/non-malicious/1802.ps1
1802.ps1
Describe "Control Service cmdlet tests" -Tags "Feature","RequireAdminOnWindows" { BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() if ( -not $IsWindows ) { $PSDefaultParameterValues["it:skip"] = $true } } AfterAll { $global:PSDefaultParameterValues = $origi...
combined_dataset/train/non-malicious/538.ps1
538.ps1
function Add-SPOUserFieldtoList { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string] $listTitle, [Parameter(Mandatory=$true, Position=2)] [string] $fieldName ) $newField = "<Field Type='UserMulti' DisplayName='$fieldName' Name='$fieldName' StaticName='$fieldName' UserSel...
combined_dataset/train/non-malicious/Write-DataTable_3.ps1
Write-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-Alias | Out-DataTable This example creates a DataTable fro...
combined_dataset/train/non-malicious/2854.ps1
2854.ps1
function Task { [CmdletBinding(DefaultParameterSetName = 'Normal')] param( [Parameter(Mandatory = $true, Position = 0)] [string]$name, [Parameter(Position = 1)] [scriptblock]$action = $null, [Parameter(Position = 2)] [scriptblock]$preaction = $null, ...
combined_dataset/train/non-malicious/sample_18_58.ps1
sample_18_58.ps1
# -------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All Rights Reserved. # Microsoft Corporation (or based on where you live, one of its affiliates) licenses this sample code for your internal testing purposes only. # Microsoft provides the following sample cod...
combined_dataset/train/non-malicious/sample_48_37.ps1
sample_48_37.ps1
# Localized 05/11/2024 04:06 AM (GMT) 303:7.2.30118 CL_LocalizationData.psd1 ConvertFrom-StringData @' ###PSLOC Troubleshoot_Title=Troubleshooting Troubleshoot_DetectDVDDevice=Checking DVD device ... Troubleshoot_DetectDVDvideoDecoder=Checking video decoder for DVD playback ... Troubleshoot_DetectDVDAudioDecoder...
combined_dataset/train/non-malicious/Get-DomainPasswordPolicy.ps1
Get-DomainPasswordPolicy.ps1
function Get-DomainPasswordPolicy { $domain = [ADSI]"WinNT://$env:userdomain" $Name = @{Name="DomainName";Expression={$_.Name}} $MinPassLen = @{Name="Minimum Password Length (Chars)";Expression={$_.MinPasswordLength}} $MinPassAge = @{Name="Minimum Password Age (Days)";Expression={$_.MinPasswordAge.value/86...
combined_dataset/train/non-malicious/1309.ps1
1309.ps1
function Get-CPathProvider { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Path ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $pathQualifier = Split-Path -Qualifier $Pa...
combined_dataset/train/non-malicious/sample_38_28.ps1
sample_38_28.ps1
# # Module manifest for module 'OCI.PSModules.Datascience' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datascience.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/Custom Accelerators CTP3.ps1
Custom Accelerators CTP3.ps1
#requires -version 2.0 ## Custom Accelerators for PowerShell 2 (CTP3) #################################################################################################### ## A script module for CTP3 which allows the user to create their own custom type accelerators. ## Thanks to "Oisin Grehan for the discovery":ht...
combined_dataset/train/non-malicious/2199.ps1
2199.ps1
[CmdletBinding()] param( [parameter(Mandatory=$true)] [string]$SiteServer, [parameter(Mandatory=$true)] [string]$SiteCode ) function Load-Form { $Form.Controls.AddRange(@($SBStatus, $CBAuto, $CBManual, $DGVAuto, $DGVManual, $ButtonStart, $ButtonClear, $ButtonAuto, $ButtonManual, $RTBInput, $OutputBox, $GBOutputBox...
combined_dataset/train/non-malicious/8c4d244d-22ac-4bfe-8ddf-c0a5ee0b552c.ps1
8c4d244d-22ac-4bfe-8ddf-c0a5ee0b552c.ps1
function out-default() { [CmdletBinding()] param( [Parameter(ValueFromPipeline=$true)] [System.Management.Automation.PSObject] ${InputObject}) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer) -and $outBuffer -gt 1024) ...
combined_dataset/train/non-malicious/Invoke-RemoteExpression..ps1
Invoke-RemoteExpression..ps1
##############################################################################\n##\n## Invoke-RemoteExpression\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\n...
combined_dataset/train/non-malicious/sample_43_42.ps1
sample_43_42.ps1
# # Module manifest for module 'OCI.PSModules.Operatoraccesscontrol' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Operatoraccesscontrol.dll' # Version number of this module. ModuleVersion = '80.0.0' #...
combined_dataset/train/non-malicious/743.ps1
743.ps1
[CmdletBinding()] param ( [string]$Path, [string]$Version = 'master' ) $localpath = $(Join-Path -Path (Split-Path -Path $profile) -ChildPath '\Modules\ReportingServicesTools') try { if ($Path.length -eq 0) { if ($PSCommandPath.Length -gt 0) { $path = Split-Path $PSCommandPa...
combined_dataset/train/non-malicious/sample_45_37.ps1
sample_45_37.ps1
import { BundledLanguageInfo, DynamicImportLanguageRegistration } from '@shikijs/core'; declare const bundledLanguagesInfo: BundledLanguageInfo[]; declare const bundledLanguagesBase: { [k: string]: DynamicImportLanguageRegistration; }; declare const bundledLanguagesAlias: { [k: string]: DynamicImportLanguageRe...
combined_dataset/train/non-malicious/2978.ps1
2978.ps1
$VerbosePreference = 'Continue' $ErrorActionPreference = 'Stop' $baseDir = $PSScriptRoot try { $buildDir = "$baseDir\build\psgallery\Pester" $null = New-Item -Path $buildDir -ItemType Directory -Verbose Write-Verbose "Copying release files to build folder '$buildDir'" Copy-Item $baseDir\Pester.ps?1 ...
combined_dataset/train/non-malicious/sample_65_18.ps1
sample_65_18.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/3697.ps1
3697.ps1
function Get-ResourceGroupName { return getAssetName } function Get-ResourceName { return getAssetName } function TestSetup-CreateResourceGroup { $resourceGroupName = getAssetName $rglocation = Get-Location "Microsoft.Resources" "resourceGroups" "West US" $resourceGroup = New-AzRe...
combined_dataset/train/non-malicious/Custom Speech Commands.ps1
Custom Speech Commands.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 "Curren...
combined_dataset/train/non-malicious/Send-HTMLFormattedEmail_3.ps1
Send-HTMLFormattedEmail_3.ps1
#------------------------------------------------- # Send-HTMLFormattedEmail #------------------------------------------------- # Usage: Used to send an HTML Formatted Email that is based on an XSLT template. #------------------------------------------------- function Send-HTMLFormattedEmail{ param ( [string]...
combined_dataset/train/non-malicious/sample_42_13.ps1
sample_42_13.ps1
# # Module manifest for module 'OCI.PSModules.Apmcontrolplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmcontrolplane.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported P...
combined_dataset/train/non-malicious/forever.ps1
forever.ps1
forever
combined_dataset/train/non-malicious/sample_45_40.ps1
sample_45_40.ps1
# # Module manifest for module 'OCI.PSModules.Networkloadbalancer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Networkloadbalancer.dll' # Version number of this module. ModuleVersion = '82.0.0' # Sup...
combined_dataset/train/non-malicious/2410.ps1
2410.ps1
[CmdletBinding()] [OutputType([bool])] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [ValidatePattern('.*\.ps1$')] [string]$ScriptFilePath, [string]$ScriptParameters, [Parameter(Mandatory)] [string]$LocalScriptFolderPath, [Parameter(Mandatory)] [hashtable]$TaskTrig...
combined_dataset/train/non-malicious/sample_10_28.ps1
sample_10_28.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 = '75.1.0' # Sup...
combined_dataset/train/non-malicious/sample_30_86.ps1
sample_30_86.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/3027.ps1
3027.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "the In statement" { Setup -Dir "test_path" It "executes a command in that directory" { In "$TestDrive" -Execute { "" | Out-File "test_file" } "$TestDrive\test_file" | Should -Exist } It "update...
combined_dataset/train/non-malicious/3039.ps1
3039.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "Should -BeTrue" { Context "Basic functionality" { It "given true it passes" { $true | Should -BeTrue } It "given truthy it passes" { 1 | Should -BeTrue } ...