full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/ShowUI Text Converter.ps1
ShowUI Text Converter.ps1
#Import-Module showui $Windowparam = @{ Width = 500 Height = 400 Title = 'Fun Text Converter' Background = '#C4CBD8' WindowStartupLocation = 'CenterScreen' AsJob = $True } #Create Window New-Window @Windowparam { New-Grid -Rows *,Auto,*,Auto -Children { New-TextBox -Row...
combined_dataset/train/non-malicious/3592.ps1
3592.ps1
function Get-AzureRmSecurityAutoProvisioningSetting-SubscriptionScope { $autoProvisioningSettings = Get-AzSecurityAutoProvisioningSetting Validate-AutoProvisioningSettings $autoProvisioningSettings } function Get-AzureRmSecurityAutoProvisioningSetting-SubscriptionLevelResource { $autoProvision...
combined_dataset/train/non-malicious/4100.ps1
4100.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()][string]$FilePath ) function Get-Architecture { [CmdletBinding()][OutputType([string])] param () $OSArchitecture = (Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture).OSArchitecture Return $OSArchitecture } function Get-RelativeP...
combined_dataset/train/non-malicious/1920.ps1
1920.ps1
Describe "Get-Runspace cmdlet tests" -Tag "CI" { BeforeAll { $CurrentRunspace = $ExecutionContext.Host.Runspace $ExpectedInstanceId = $CurrentRunspace.InstanceId $ExpectedId = $currentRunspace.Id } It "Get-Runspace should return the current runspace" { $runspace = get-runsp...
combined_dataset/train/non-malicious/Get-App.ps1
Get-App.ps1
## Get-App ## Attempt to resolve the path to an executable using Get-Command and the AppPaths registry key ################################################################################################## ## Example Usage: ## Get-App Notepad ## Finds notepad.exe using Get-Command ## Get-App pbrush ...
combined_dataset/train/non-malicious/sample_2_7.ps1
sample_2_7.ps1
# *********************************************************************************************************** # Version 1.0 # Date: 01-24-2014 # Author: Vinay Pamnani - vinpa@microsoft.com # Description: Collects data from SMS Provider # *****************************************************************************...
combined_dataset/train/non-malicious/1199.ps1
1199.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) -ForDsc $credential = New-Credential -User 'CarbonDscTestUser' -Password ([Guid]::NewGuid().ToString()) $sid = Resolve-CIdentity -Name $credential.UserName | Select-Object -ExpandProperty 'Sid' $tempDir = $null $taskForUser =...
combined_dataset/train/non-malicious/2604.ps1
2604.ps1
New-ModuleManifest -Path .\RestoreAutomation.psd1 -Author 'Michael S. Fal' ` -CompanyName 'Creative Commons License - Attribution/Non-Commercial (https://creativecommons.org/licenses/by-nc/3.0/)' ` -RequiredAssemblies @('Microsoft.SqlServer.SMO') ` -FunctionsToExport @('New-Restore','Sync-DBUsers','Copy-Logins') ` ...
combined_dataset/train/non-malicious/624.ps1
624.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" } $Configs | ForEach-Object{ try{ ...
combined_dataset/train/non-malicious/2331.ps1
2331.ps1
describe 'Get-DhcpLease' { mock 'Get-DhcpServerv4Scope' { [pscustomobject]@{ 'ScopeId' = '10.10.10.0' } } mock 'Get-DhcpServerv4Lease' { return $null } mock 'Get-DhcpServerInDc' { @( [pscustomobject]@{ 'DNSName' = 'SRV1' } [pscustomobject]@{ 'DNSName' = 'SRV2' } ) } it 'queries all DHCP ser...
combined_dataset/train/non-malicious/Get-WebSite.ps1
Get-WebSite.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/sample_24_4.ps1
sample_24_4.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.EventHub.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.EventHub.internal.psm1' if(Test-Path $internalModulePath) { $n...
combined_dataset/train/non-malicious/sample_22_24.ps1
sample_22_24.ps1
##------------------------------------------------------------------ ## <copyright file="Enable-StandaloneObservability.ps1" company="Microsoft"> ## Copyright (C) Microsoft. All rights reserved. ## </copyright> ##------------------------------------------------------------------ Param ( [Parameter(Mand...
combined_dataset/train/non-malicious/3850.ps1
3850.ps1
function Test-StorageAccount { $rgname = Get-StorageManagementTestResourceName; try { $stoname = 'sto' + $rgname; $stotype = 'Standard_GRS'; $loc = Get-ProviderLocation ResourceManagement; $kind = 'BlobStorage' $accessTier = 'Cool' ...
combined_dataset/train/non-malicious/PS2WCF_5.ps1
PS2WCF_5.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/2551.ps1
2551.ps1
[reflection.assembly]::LoadwithPartialName("Microsoft.SQLServer.SMO") | out-Null [boolean]$defaulted = $false if ($args[0] -ne $null) { $server = $args[0] } else { $server = "default_server" $defaulted = $true } if ($args[1] -ne $null) { $filename = $args[1] } else { $filen...
combined_dataset/train/non-malicious/sample_27_93.ps1
sample_27_93.ps1
# # Module manifest for module 'OCI.PSModules.Osubusage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osubusage.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/3144.ps1
3144.ps1
$Result = New-Object -TypeName PSObject Add-Member -InputObject $Result -MemberType NoteProperty -Name Parameter1 -Value Result1 Add-Member -InputObject $Result -MemberType NoteProperty -Name Parameter2 -Value Result2 return $Result $Results = @() foreach($Line in $Lines) { $Result = New-Object -TypeName PSOb...
combined_dataset/train/non-malicious/sample_21_55.ps1
sample_21_55.ps1
<RunRuleResults><Header reportDate="18.12.2023." reportTime="13:34" savedToDirectory="C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20231218_133413\SystemConfigurationCheck_Report.htm"><Machines><Machine value="ALT-SAMPLER-WIN" /></Machines></Header><group groupName="GlobalRules" groupDescription="SQL S...
combined_dataset/train/non-malicious/sample_46_0.ps1
sample_46_0.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....
combined_dataset/train/non-malicious/291.ps1
291.ps1
function Get-PSFTaskEngineCache { [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFTaskEngineCache')] Param ( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $Module, [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $...
combined_dataset/train/non-malicious/sample_66_87.ps1
sample_66_87.ps1
# # Module manifest for module 'OCI.PSModules.Dataflow' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dataflow.dll' # Version number of this module. ModuleVersion = '85.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/Set Logfile lines.ps1
Set Logfile lines.ps1
################################################################################ # This script will maintain the PS Transcript file at a fixed length and can be # used to prevent such files, etc, from becoming too large. It is best placed in # the $profile. Defaults to 10000 lines. Parameters allow use for other fi...
combined_dataset/train/non-malicious/Split-TextToLines Demo_2.ps1
Split-TextToLines Demo_2.ps1
# Variables $viserver = Read-Host "Enter VI server name" $cluster = Read-Host "Enter Cluster name" $vmhelper = Read-Host "Enter VM_HELPER name" Write-Host "Connecting to $viserver..." Connect-VIServer $viserver -WarningAction:SilentlyContinue # Get VM Hosts $vmhosts = Get-Cluster $cluster -ErrorAction:Silent...
combined_dataset/train/non-malicious/sample_55_96.ps1
sample_55_96.ps1
# # Module manifest for module 'OCI.PSModules.Apigateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apigateway.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_28_99.ps1
sample_28_99.ps1
/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-------------...
combined_dataset/train/non-malicious/sample_36_78.ps1
sample_36_78.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_8_34.ps1
sample_8_34.ps1
# Sample diagnostic function # # Wrapped in a region same name as function name # Change the name and code as needed # # You can test your diagnostic function by running xray in developer mode, e.g.: # .\xray.ps1 -Diagnostic net_dnscli_KB4562541_sample -DevMode #region net_dnscli_KB4562541_sample <# Compone...
combined_dataset/train/non-malicious/736.ps1
736.ps1
function New-RsScheduleXml { [cmdletbinding(SupportsShouldProcess=$true, ConfirmImpact='Low', DefaultParameterSetName='Once')] [OutputType(‘System.String’)] param ( [Parameter(ParameterSetName='Minute')] [Switch] $Minute, [Parameter(ParameterSetNam...
combined_dataset/train/non-malicious/sample_63_41.ps1
sample_63_41.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 = '83.3.0' # Supported PSEdition...
combined_dataset/train/non-malicious/2395.ps1
2395.ps1
[CmdletBinding()] [OutputType([bool])] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [ValidatePattern('.*\.ps1$')] [string]$ScriptFilePath, [string]$ScriptParameters, [Parameter(Mandatory)] [string]$LocalScriptFolderPath, [Parameter(Mandatory)] [hashtable]$TaskTri...
combined_dataset/train/non-malicious/sample_57_47.ps1
sample_57_47.ps1
# Localized 05/30/2024 04:59 PM (GMT) 303:4.80.0411 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=&Ja PromptNoString=&Nein BundleFound=Bundle gefunden: {0} PackageFound=Paket gefunden: {0} EncryptedBundleFound=Verschlüsseltes Bundle gefunden: {0} EncryptedPackag...
combined_dataset/train/non-malicious/sample_41_95.ps1
sample_41_95.ps1
# # Script module for module 'Az.Kusto' that is executed when 'Az.Kusto' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 04/23/2024 13:01:41 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try { if ...
combined_dataset/train/non-malicious/sample_65_69.ps1
sample_65_69.ps1
# # Module manifest for module 'OCI.PSModules.Datacatalog' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datacatalog.dll' # Version number of this module. ModuleVersion = '89.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_7_67.ps1
sample_7_67.ps1
#************************************************ # TS_TelnetSystemAccount.ps1 # Version 1.0.1 # Date: 5/9/2012 # Author: v-blchen # Description: [Idea ID 2695] [Windows] Check the Log On account for the Telnet service to verify it's not using the Local System account # Rule number: 2695 # Rule URL: //sharepo...
combined_dataset/train/non-malicious/sample_52_90.ps1
sample_52_90.ps1
function New-AzWvdMsixPackage_PackageAlias { [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20230905.IMsixPackage')] [CmdletBinding( PositionalBinding = $false, ConfirmImpact = 'Medium')] param( [Parameter()] [Alias('AzureRMContext', 'AzureCredential')...
combined_dataset/train/non-malicious/Set vSphere CDP LinkDisc.ps1
Set vSphere CDP LinkDisc.ps1
function set-vSwitchLinkDiscovery { Param ( #Switch to enable vSwitch Discovery On [Parameter(Mandatory=$true,ValueFromPipeline=$true)]$vSwitchName #Host on which the vSwitch Resides ,[Parameter(Mandatory=$true,HelpMessage="")][string]$VMBackupDestination, ) #Param #Va...
combined_dataset/train/non-malicious/01dbc242-a783-4249-9862-3fbf3231f7b6.ps1
01dbc242-a783-4249-9862-3fbf3231f7b6.ps1
# Code to auto update the Address policy, GAL, OAB and storage groups and mailbox databases of an Exchange 2007 server by John McLear # This code is good for hosting providers or people who wish to use lots of storage groups and mailbox databases. # # Thanks to Joel Bennett (Jaykul) for general scripting help and t...
combined_dataset/train/non-malicious/643.ps1
643.ps1
function Get-DatabaseName() { $wmiObject = New-RsConfigurationSettingObject -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext return $wmiObject.DatabaseName } function Get-CredentialType() { $wmiObject = New-RsConfigurationSettingObject -ReportServerInstance PBIRS -ReportServerVersion SQLServ...
combined_dataset/train/non-malicious/sample_11_43.ps1
sample_11_43.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/1974.ps1
1974.ps1
function Test-UnblockFile { { Get-Content -Path $testfilepath -Stream Zone.Identifier -ErrorAction Stop | Out-Null } | Should -Throw -ErrorId "GetContentReaderFileNotFoundError,Microsoft.PowerShell.Commands.GetContentCommand" } Describe "Unblock-File" -Tags "CI" { BeforeAll { if ( ! $IsWindo...
combined_dataset/train/non-malicious/sample_7_0.ps1
sample_7_0.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_9_7.ps1
sample_9_7.ps1
#************************************************ # RC_HTTPRedirectionTSGateway.ps1 # Version 1.0 # Date: 5-1-2012 # Author: davidcop # Description: Checks for HTTP redirection on either the /rpc virtual directory or the web site that host the /rpc virtual directory #**********************************************...
combined_dataset/train/non-malicious/Get-InstalledProgram_v_4.ps1
Get-InstalledProgram_v_4.ps1
function Get-InstalledProgram() { param ( [String[]]$Computer, $User ) ############################################################################################# if ($User) {$Connection = Get-Credential -Credential $User} ########################################################################################...
combined_dataset/train/non-malicious/sample_31_11.ps1
sample_31_11.ps1
# Instructions: select the entire file and hit F8 to # load the extensions. To see the list of registered # extensions and run them, hit Ctrl+Shift+P, type 'addi' # and run the "Show additional commands from PowerShell modules" # command. A quick pick list will appear with all 3 # extensions registered. Selecti...
combined_dataset/train/non-malicious/sample_17_74.ps1
sample_17_74.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\nanoid@3.3.7\node_modules\nanoid\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\nanoid@3.3....
combined_dataset/train/non-malicious/sample_9_35.ps1
sample_9_35.ps1
# diag_dnd.psm1 # Created by tdimli # March 2020 # # Diagnostic functions for DND area # version $DND_version = "1.0.240710.0" # Area and Area/Component arrays $DND = @("xray_dnd_pnp", "xray_dnd_powermgmt") #Component/Diagnostic Function arrays $xray_dnd_pnp = @("dnd_pnp_KB5017275") $xray_dnd_powermgmt...
combined_dataset/train/non-malicious/Set-Domain_4.ps1
Set-Domain_4.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-Domain -domain MyDomain -credential `$cred`n" if ($help...
combined_dataset/train/non-malicious/sample_15_3.ps1
sample_15_3.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ###########################################################...
combined_dataset/train/non-malicious/sample_7_26.ps1
sample_7_26.ps1
ConvertFrom-StringData @' id_adapterkb980486check=Checking 6to4 and physical adapters id_adapterkb980486checkdesc=Checking the number of 6to4 and physical adapters (KB 980486) '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3Ag...
combined_dataset/train/non-malicious/Get-Tail.ps1
Get-Tail.ps1
# Name: Get-Tail.ps1 # Author: William Stacey # Created: 02/22/2007 # Description: Gets the last N lines of a file. Does scan from end-of-file so works on large files. Also has a loop flag that prompts for refresh. function Get-Tail([string]$path = $(throw "Path name must be specified."), [int]$count = 10, [bool...
combined_dataset/train/non-malicious/1902.ps1
1902.ps1
Describe "Get-Command Feature tests" -Tag Feature { Context "-UseFuzzyMatch tests" { It "Should match cmdlets" { $cmds = Get-Command get-hlp -UseFuzzyMatch $cmds.Count | Should -BeGreaterThan 0 $cmds[0].Name | Should -BeExactly 'Get-Help' -Because "This should be close...
combined_dataset/train/non-malicious/sample_32_21.ps1
sample_32_21.ps1
# # Module manifest for module 'OCI.PSModules.Fusionapps' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Fusionapps.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_56_96.ps1
sample_56_96.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/sample_51_90.ps1
sample_51_90.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/sample_67_43.ps1
sample_67_43.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_27_97.ps1
sample_27_97.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/4284.ps1
4284.ps1
Function Get-ComputerInfo { [CmdletBinding()] param( [Parameter(Position = 0,ValueFromPipeline = $true)] [Alias('CN','Computer')] [String[]]$ComputerName = "$env:COMPUTERNAME" ) Begin { $i = 0 $TempErrAct = $ErrorActionPreference $Error...
combined_dataset/train/non-malicious/Copy-MAGig_1.ps1
Copy-MAGig_1.ps1
function Copy-MAGig { param( [string]$src, [string]$dest, $exclude, [int]$width = 100, # used with the -log switch to format the log, [int]$ident = 2, # dito [switch]$log, # if -verbose had a nice format and its output cou...
combined_dataset/train/non-malicious/1931a71c-ecb0-4b18-85ba-635d4034e7a1.ps1
1931a71c-ecb0-4b18-85ba-635d4034e7a1.ps1
PARAM( $location=$(throw "Make sure to specify a location for old machines to be imported") ) $oldVM = Get-ChildItem "$location\\*.xml" foreach($vm in $oldVM) { $vmGuid = [System.IO.Path]::GetFileNameWithoutExtension($vm.Name) Invoke-Command -ScriptBlock {cmd /c "Mklink `"C:\\ProgramData\\Microsoft\\Windows...
combined_dataset/train/non-malicious/sample_36_98.ps1
sample_36_98.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Out-CurrentFile { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding()] param( [Switch]$AsNewFile, [Parameter(ValueFromPipeline, Mandatory = $true)] $...
combined_dataset/train/non-malicious/sample_54_27.ps1
sample_54_27.ps1
# # Module manifest for module 'OCI.PSModules.Ons' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ons.dll' # Version number of this module. ModuleVersion = '85.2.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/273.ps1
273.ps1
Function Get-SCSMUserManager { Param ( $input_affectedUser_id ) $managerOfAffectedUser_obj = $null $affectedUser_obj = get-scsmobject -id $input_affectedUser_id $userManagesUser_relclass_id = '4a807c65-6a1f-15b2-bdf3-e967e58c254a' $managerOfAffectedUser_relobjs = Get-SCSMRela...
combined_dataset/train/non-malicious/542.ps1
542.ps1
function Open-SPORootsite { Open-SPOSite -relativeUrl "/" }
combined_dataset/train/non-malicious/4144.ps1
4144.ps1
[CmdletBinding()] param () function Get-Architecture { [CmdletBinding()][OutputType([string])] param () $OSArchitecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture $OSArchitecture = $OSArchitecture.OSArchitecture Return $OSArchitecture } function Get-MSIInformation { ...
combined_dataset/train/non-malicious/4471.ps1
4471.ps1
$script:dscResourceFriendlyName = 'PSRepository' $script:dcsResourceName = "MSFT_$($script:dscResourceFriendlyName)" $configurationFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dcsResourceName).config.ps1" . $configurationFile Describe "$($script:dcsResourceName)_Integration" { $configurationName ...
combined_dataset/train/non-malicious/sample_48_45.ps1
sample_48_45.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/sample_33_10.ps1
sample_33_10.ps1
<# .SYNOPSIS SyncServiceIIS.ps1 script file This is a place-holder file only for agent patch build purposes #> Write-Host "This file functionality is deprecated and is place-holder only" # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3Ag...
combined_dataset/train/non-malicious/sample_42_9.ps1
sample_42_9.ps1
# # Module manifest for module 'OCI.PSModules.Fusionapps' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Fusionapps.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_9_17.ps1
sample_9_17.ps1
#************************************************ # TS_SymantecIPSCheck.ps1 # Version 1.0.0 # Date: 10-17-2012 # Author: Brian Prince - brianpr@microsoft.com # Description: This script checks if Symantec Intrusion Prevention System (IPS) is installed. # IPS is not recommended on high traffic (300+ Mbps of net...
combined_dataset/train/non-malicious/sample_47_24.ps1
sample_47_24.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/sample_63_45.ps1
sample_63_45.ps1
# # Module manifest for module 'MEDSHelper' # # Generated by: ksarens # # Generated on: 10/8/2021 # @{ # Script module or binary module file associated with this manifest. #RootModule = 'MDEHelper' # Version number of this module. ModuleVersion = '1.0.20.0' # Supported PSEditions # CompatiblePSEdit...
combined_dataset/train/non-malicious/3553.ps1
3553.ps1
$containerName = "pstestwlvm1bca8" $resourceGroupName = "pstestwlRG1bca8" $vaultName = "pstestwlRSV1bca8" $resourceId = "/subscriptions/da364f0f-307b-41c9-9d47-b7413ec45535/resourceGroups/pstestwlRG1bca8/providers/Microsoft.Compute/virtualMachines/pstestwlvm1bca8" $policyName = "HourlyLogBackup" functio...
combined_dataset/train/non-malicious/sample_29_42.ps1
sample_29_42.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. param( [ValidateSet('Hang', 'Fail')] $TestHook ) $waitTimeoutSeconds = 300 switch ($TestHook) { 'Hang' { $waitTimeoutSeconds = 10 $jobScript = { Start-Sleep -Seconds 600 } } 'Fail' { $jo...
combined_dataset/train/non-malicious/2026.ps1
2026.ps1
Describe "TestImplicitRemotingBatching hook should correctly batch simple remote command pipelines" -Tag 'Feature','RequireAdminOnWindows' { BeforeAll { if (! $isWindows) { return } function ThrowSetupError { param ( [string] $errorMessage, [...
combined_dataset/train/non-malicious/sample_28_34.ps1
sample_28_34.ps1
# Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 <# .Synopsis Build script for Packer. .Description Build script for Packer for all supported platforms and architectures. By default the following OSs and architectures are targeted. OS: * linux * darwin * wind...
combined_dataset/train/non-malicious/2082.ps1
2082.ps1
Describe 'Attributes Test' -Tags "CI" { BeforeAll { $dummyAttributesSource = @' using System.Management.Automation; namespace Dummy { public class DoubleStringTransformationAttribute : ArgumentTransformationAttribute { public override object Transform(EngineIntrinsics engineIntrinsics, ob...
combined_dataset/train/non-malicious/3400.ps1
3400.ps1
$PLACEHOLDER = "PLACEHOLDER1@" function Get-ComputeTestResourceName { $stack = Get-PSCallStack $testName = $null; foreach ($frame in $stack) { if ($frame.Command.StartsWith("Test-", "CurrentCultureIgnoreCase")) { $testName = $frame.Command; } } ...
combined_dataset/train/non-malicious/sample_60_67.ps1
sample_60_67.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 = '86.2.0' # Supported P...
combined_dataset/train/non-malicious/sample_47_39.ps1
sample_47_39.ps1
# # Module manifest for module 'Az.DnsResolver' # # Generated by: Microsoft Corporation # # Generated on: 5/16/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.DnsResolver.psm1' # Version number of this module. ModuleVersion = '1.0.0' # Supported PSEdit...
combined_dataset/train/non-malicious/Profile Function.ps1
Profile Function.ps1
######################################################## # This function will prompt the user asking if they want # to start a transcript file. It will loop until the user # types y or n. If the user selects y, the script will # check to see if the transcript exists. If it doesn't # it is created. If it does, the ...
combined_dataset/train/non-malicious/701.ps1
701.ps1
function New-RsRestSession { [cmdletbinding()] param ( [string] $ReportPortalUri = ([Microsoft.ReportingServicesTools.ConnectionHost]::ReportPortalUri), [ValidateSet("v1.0", "v2.0")] [string] $RestApiVersion = "v2.0", [Alias('Credentials')] ...
combined_dataset/train/non-malicious/sample_12_86.ps1
sample_12_86.ps1
# 2023-02-24 WalterE mod Trap #we# $startTime_AutoAdd = Get-Date trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" } Write-Host -Background...
combined_dataset/train/non-malicious/sample_45_55.ps1
sample_45_55.ps1
# # Module manifest for module 'OCI.PSModules.Announcementsservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Announcementsservice.dll' # Version number of this module. ModuleVersion = '74.1.0' # S...
combined_dataset/train/non-malicious/sample_67_6.ps1
sample_67_6.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux builds of Node # are installed in the same directory $exe=".exe" } $ret=0 if (Test-Path "$basedir/node$exe") { # Suppor...
combined_dataset/train/non-malicious/sample_21_45.ps1
sample_21_45.ps1
# # Module manifest for module 'OCI.PSModules.Lockbox' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Lockbox.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/sample_39_5.ps1
sample_39_5.ps1
# # Module manifest for module 'OCI.PSModules.Artifacts' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Artifacts.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/Update-VmFromTemplate.ps.ps1
Update-VmFromTemplate.ps.ps1
<# .SYNOPSIS Create a new VM from an imported template .DESCRIPTION This script will modify a VM on Hyper-V R2 that has been imported from an exported VM. The current release of the HyperV module does not support the proper Import method, so I don't implement that bit in t...
combined_dataset/train/non-malicious/sample_12_89.ps1
sample_12_89.ps1
# Downloading specified D3D runtime # Touch this file needs update both WINDOWS_X64_BUILD_TAG WINDOWS_X64_TEST_TAG # This file needs run in administrator mode $ProgressPreference = "SilentlyContinue" $depsInstallPath="C:\mesa-deps" Write-Host "Downloading DirectX 12 Agility SDK at:" Get-Date Invoke-WebRequest -Uri h...
combined_dataset/train/non-malicious/Two ways get random pass.ps1
Two ways get random pass.ps1
#ugly way function Get-RandomPassword { [CmdletBinding()] param( [Parameter(Mandatory=$false)] [int]$PasswordLength = "7" ) $rnd = New-Object Random $chr = @(33..125) for ($i = 0; $i -lt $PasswordLength; $i++) { $pas += [char]$chr[$rnd.Next(0, [int]$chr.Length)] } return $p...
combined_dataset/train/non-malicious/SearchZIP.psm1 .ps1
SearchZIP.psm1 .ps1
function SearchZIPfiles { <# .SYNOPSIS Search for (filename) strings inside compressed ZIP or RAR files. .DESCRIPTION In any directory containing a large number of ZIP/RAR compressed Web Page files this procedure will search each individual file name for simple text strings, listing both the source RAR/ZIP fi...
combined_dataset/train/non-malicious/UIAutomation 1.6.ps1
UIAutomation 1.6.ps1
## UI Automation v 1.6 -- REQUIRES the Reflection module (current version: http://poshcode.org/2480 ) ## # WASP 2.0 is getting closer, but this is just a preview: # -- a lot of the commands have weird names still because they're being generated ignorantly # -- eg: Invoke-Toggle.Toggle and Invoke-Invoke.Invoke ...
combined_dataset/train/non-malicious/sample_5_56.ps1
sample_5_56.ps1
ConvertFrom-StringData @' id_sccm_activity_wuainfo=Gathering Windows Update Agent Information id_sccm_wuainfo_wua=Obtaining Windows Update Agent Configuration id_sccm_wuainfo_softdist=Obtaining Directory Listing of SoftwareDistribution Directory id_sccm_wuainfo_filever=Obtaining Versions of WUA Related DLLs id_scc...
combined_dataset/train/non-malicious/4273.ps1
4273.ps1
function Invoke-HostEnum { [CmdletBinding()] Param( [Switch]$All, [Switch]$Local, [Switch]$Domain, [Switch]$Quick, [Switch]$Privesc, [Switch]$HTMLReport ) $ErrorActionPreference = "SilentlyContinue" If ($All) {$Local = $True; $Doma...
combined_dataset/train/non-malicious/3790.ps1
3790.ps1
function Test-VirtualMachineScaleSet { Test-VirtualMachineScaleSet-Common $false } function Test-VirtualMachineScaleSet-ManagedDisks { Test-VirtualMachineScaleSet-Common $true } function Test-VirtualMachineScaleSet-Common($IsManaged) { $rgname = Get-ComputeTestResourceName try ...
combined_dataset/train/non-malicious/Get-Password.ps1
Get-Password.ps1
# ---------------------------------------------------------------------------------------------- # Get-Password PowerShell Script # # Author: John T Childers III # Originally Written: 7/5/2011 # ***Important**** # Make sure to store this in a directory in that is a part of the path # so that it you...
combined_dataset/train/non-malicious/2668.ps1
2668.ps1
$csv_SiteList = ".\input\sites.csv" $csv_siteheaders = 'Url' $date = Get-Date $date = $date.ToString("yyyymmddhhss") $file_name = $date + 'LinkMatches.csv' $creation_path = ".\PowerShell\GetLinks" $List = "SitePages" $headers = "Site Title|Page Title|Page Url|Href Tag" $ofs = "`n" $delim = '|...
combined_dataset/train/non-malicious/Roll-Dice_2.ps1
Roll-Dice_2.ps1
# Roll-Dice.ps1 # Cody Bunch # ProfessionalVMware.com Begin { $rand = New-Object System.Random $dice = $rand.next(1,4) } Process { if ( $_ -isnot [VMware.VimAutomation.Types.Snapshot] ) { continue } if ($dice -gt 1) { $_ | Remove-Snapshot -Confirm:$false Write-Host "OH NOES! Snapshot $_ Has been...
combined_dataset/train/non-malicious/3918.ps1
3918.ps1
function Test-ListReservationSummariesMonthlyWithOrderId { $reservationSummaries = Get-AzConsumptionReservationSummary -Grain monthly -ReservationOrderId ca69259e-bd4f-45c3-bf28-3f353f9cce9b Assert-NotNull $reservationSummaries Foreach($reservationSummary in $reservationSummaries) { Asser...
combined_dataset/train/non-malicious/4301.ps1
4301.ps1
Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue $RepositoryName = 'PSGallery' $SourceLocation = 'https://www.poshtestgallery.com/api/v2' $SourceLocation2 = 'https://www.poshtestgallery.com/api/v2/' $PublishLocation = 'https://www.poshtestgallery.com/api/v2/package' $ScriptSourceLo...