full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/New-Struct.ps1
New-Struct.ps1
## New-Struct ## Creates a Struct class and emits it into memory ## The Struct includes a constructor which takes the parameters in order... ## ## Usage: ## # Assuming you have a csv file with no header and columns: artist,name,length ## New-Struct Song @{ ## Artist=[string]; ## Name=[string]; ...
combined_dataset/train/non-malicious/sample_38_74.ps1
sample_38_74.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; // services.debug.trace(tname + "=" + val); } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("snap",...
combined_dataset/train/non-malicious/sample_47_80.ps1
sample_47_80.ps1
# # Module manifest for module 'OCI.PSModules.Usageapi' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Usageapi.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_9_95.ps1
sample_9_95.ps1
ConvertFrom-StringData @' id_fileacl=Determining file ACL's '@ # SIG # Begin signature block # MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA6VsPfmmzM00am # qvD0ITk80rX9ws5...
combined_dataset/train/non-malicious/1591.ps1
1591.ps1
if ((get-host).Version.Major -ge 4){ $XmlQuery = [xml]@' <QueryList> <Query Id="0" Path="System"> <Select Path="System">*[System[Provider[@Name='disk'] and TimeCreated[timediff(@SystemTime) &lt;= 86400000]]]</Select> </Query> </QueryList> '@ $LogOutput = Get-WinEvent -FilterXml $XmlQuery -ErrorAction SilentlyCo...
combined_dataset/train/non-malicious/sample_25_17.ps1
sample_25_17.ps1
# Stops Docker Desktop # Sets container type to windows or linux # Restarts Docker Desktop # Logins to Docker Hub with credentials param( [string]$user, [string]$pswd, [string]$container="windows" ) # Stop docker Write-Information -MessageData "Stopping docker desktop" -InformationAction Continu...
combined_dataset/train/non-malicious/sample_48_28.ps1
sample_48_28.ps1
# # Module manifest for module 'Microsoft.SME.AppsAndFeatures' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.AppsAndFeatures.psm1' # Version number of this module. ModuleVersion = '4.10.0' # Supported PSEditions # CompatiblePSEditions = @() # I...
combined_dataset/train/non-malicious/UIAutomation Simple.ps1
UIAutomation Simple.ps1
[Reflection.Assembly]::Load("UIAutomationClient, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") [Reflection.Assembly]::Load("UIAutomationTypes, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") function Select-Window { PARAM( [string]$Text="*", [switch]$Recurse, [Syst...
combined_dataset/train/non-malicious/sample_63_91.ps1
sample_63_91.ps1
# # Module manifest for module 'OCI.PSModules.Servicemesh' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemesh.dll' # Version number of this module. ModuleVersion = '86.2.0' # Supported PSEdition...
combined_dataset/train/non-malicious/1197.ps1
1197.ps1
$userDomain = $env:USERDNSDOMAIN $computerDomain = Get-WmiObject 'Win32_ComputerSystem' | Select-Object -ExpandProperty Domain if( (Get-Service -Name MSMQ -ErrorAction SilentlyContinue) -and $userDomain -eq $computerDomain ) { $publicQueueName = $null $privateQueueName = $null function Start-...
combined_dataset/train/non-malicious/2560.ps1
2560.ps1
param( $SQLServer = 'PSQLRPT24' , $Database = 'PA_DMart' , $StartDate = (Get-Date) , $EndDAte = (Get-Date) ) Import-Module SqlServer Import-Module Pscx $Queries = "sel_DMartComponentLogByClient ", "sel_DMartComponentLogByTaskName", "sel_DMartCDC_DataComponentLogByClient", "sel_DMartCDC_DataComponentLogByTa...
combined_dataset/train/non-malicious/sample_26_50.ps1
sample_26_50.ps1
<# ------ Input Prompts ------ #> $fields = @( New-Object "System.Management.Automation.Host.FieldDescription" "Input" New-Object "System.Management.Automation.Host.FieldDescription" "Input List" ) $fields[1].SetParameterType([int[]]) $host.UI.Prompt("Caption", "Message", $fields) Get-Credential G...
combined_dataset/train/non-malicious/Get-BracketContent.ps1
Get-BracketContent.ps1
function global:Get-BracketContent { PARAM ( [string[]] $txtInput = $(Throw "Please provide input string(s)!") , [string] $patternString = '<.*>' , [switch] $caseSensitive = $false ) # Store the pattern in a variable we can change depending on caseSensitive option. Leave original pattern there to u...
combined_dataset/train/non-malicious/3953.ps1
3953.ps1
function Test-GetAvailableDelegationsList { $location = Get-ProviderLocation ResourceManagement try { $results = Get-AzAvailableServiceDelegation -Location $location; Assert-NotNull $results; } finally { Clean-ResourceGroup $rgname } }
combined_dataset/train/non-malicious/sample_34_47.ps1
sample_34_47.ps1
# # Script module for module 'PSScriptAnalyzer' # Set-StrictMode -Version Latest # Set up some helper variables to make it easier to work with the module $PSModule = $ExecutionContext.SessionState.Module $PSModuleRoot = $PSModule.ModuleBase # Import the appropriate nested binary module based on the current PowerShell...
combined_dataset/train/non-malicious/sample_59_26.ps1
sample_59_26.ps1
# # Copyright (c) Microsoft Corporation. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ...
combined_dataset/train/non-malicious/sample_65_50.ps1
sample_65_50.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/Out-HTMLTable.ps1
Out-HTMLTable.ps1
<# .SYNOPSIS Takes input objects, and outputs a sortable HTML table .DESCRIPTION The function requires at least 2 parameters, an input object and a path where the result is to be output to. The function will output 3 files, a css file that determines the way the result is formatted, a javascript file ...
combined_dataset/train/non-malicious/sample_41_89.ps1
sample_41_89.ps1
[This article is subject to change.] 16 2) Run the following cmdlets to connect to your account and download catalog files as block blobs from the storage account, saving them to a local folder, like C:\catalog\blobs, where you will run the Utility. Connect-AzAccount Set-AzContext -Subscription "SubscriptionName" $...
combined_dataset/train/non-malicious/sample_64_62.ps1
sample_64_62.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 = '89.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/1018.ps1
1018.ps1
param ( [Parameter(Mandatory=$true, HelpMessage="The name of the DevTest Lab to update")] [string] $DevTestLabName, [Parameter(Mandatory=$true, HelpMessage="The array of Marketplace Image names to enable")] [Array] $ImagesToAdd ) function Get-Lab { $lab = Find-AzResource -ResourceType 'Microsoft....
combined_dataset/train/non-malicious/sample_67_28.ps1
sample_67_28.ps1
function Show-TableData { param ( [Parameter(Mandatory = $true)] [string]$TableName, [Parameter(Mandatory = $false)] $LaunchConfig ) $ServiceUrl = Get-ServiceUrl -Method GetTableIDFromName -LaunchConfig $LaunchConfig $Credential = Get-ALTestRunnerCredential ...
combined_dataset/train/non-malicious/2123.ps1
2123.ps1
Describe "Requires tests" -Tags "CI" { Context "Parser error" { $testcases = @( @{command = " @{command = " @{command = " @{command = " @{command = " @{command =...
combined_dataset/train/non-malicious/3502.ps1
3502.ps1
function Clean-ResourceGroup($rgname) { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { Remove-AzResourceGroup -Name $rgname -Force } } function Retry-IfException { param([ScriptBlock] $script,...
combined_dataset/train/non-malicious/Watch-SG2011LeaderBoard.ps1
Watch-SG2011LeaderBoard.ps1
#requires -Version 2.0 <# .Synopsis Script that will produce table of leaders in a give category. .Description Just some fun with regex/ xml. :) It will grab SG 2011 Leader Board for a given category. Than parse the string, convert it into XML, create custom ...
combined_dataset/train/non-malicious/4117.ps1
4117.ps1
Function UninstallOldApplication($Description) { Set-Variable -Name AppName -Scope Local -Force Set-Variable -Name Arguments -Scope Local -Force Set-Variable -Name Code -Scope Local -Force Set-Variable -Name GUID -Scope Local -Force Set-Variable -Name Output -Scope Local ...
combined_dataset/train/non-malicious/sample_1_11.ps1
sample_1_11.ps1
[ dynamic, provider("dcismprovider"), Association, Description ("SystemComponent can be associated by a ComputerSystem." "This relationship is made explicit by the SystemComponent association." ) ] class DCIM_SystemComponent : CIM_SystemComponent { [ Aggregate, Description ("The pa...
combined_dataset/train/non-malicious/RunAsAdmin Tool.ps1
RunAsAdmin Tool.ps1
<# DOWNLOAD THE DEPLOY PACKAGE FROM http://techjeeper.com/?page_id=112 for all the pieces to make this work. Author: Cody Dean (aka TechJeeper) Date: 3-16-2013 RunAsAdmin uses (and includes) the following tools: PowerShell Community Extensions SysInternals PsExec PSTerminalServices Make-ps1exewrapper.ps...
combined_dataset/train/non-malicious/1207.ps1
1207.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) Describe 'Grant-ServicePermission' { BeforeEach { $username = 'CarbonGrantSrvcPerms' $password = 'a1b2c3d4 Install-User -Username $username -Password $password -Description 'Account for testi...
combined_dataset/train/non-malicious/4042.ps1
4042.ps1
function Test-CustomDomainGetRemoveWithRunningEndpoint { $endpointName = "testAkamaiEP" $hostName = "testAkamai.dustydog.us" $customDomainName = getAssetName $profileName = getAssetName $resourceGroup = TestSetup-CreateResourceGroup $resourceLocation = "EastUS" $profile...
combined_dataset/train/non-malicious/sample_66_16.ps1
sample_66_16.ps1
@Не можна виконати метод, якщо вимкнуто сховище багатьох знімків.fЗапит обмежено. Користувачі ініціювали забагато запитів на оновлення джерела даних за короткий період.ZБракує дозволів на оновлення таблиці Direct Lake. Зверніться до автора цього набору даних.gНеможливо зберегти метадані знімка бази даних. Вона вилучаєт...
combined_dataset/train/non-malicious/sample_56_29.ps1
sample_56_29.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ # Loads all Service Fabric SD...
combined_dataset/train/non-malicious/Send-Growl _2.0.ps1
Send-Growl _2.0.ps1
## This is the first version of a Growl module (just dot-source to use in PowerShell 1.0) ## v 1.0 supports a very simple notice, and no callbacks ## v 2.0 supports registering multiple message types ## supports callbacks ## v 2.1 redesigned to be a module used from apps, rather than it's own "PowerGrowler" a...
combined_dataset/train/non-malicious/3667.ps1
3667.ps1
function Test-CreateAgent { $location = Get-Location "Microsoft.Sql" "operations" "West US 2" $rg1 = Create-ResourceGroupForTest $s1 = Create-ServerForTest $rg1 $location $db1 = Create-DatabaseForTest $s1 $db2 = Create-DatabaseForTest $s1 $db3 = Create-DatabaseForTest $s1 ...
combined_dataset/train/non-malicious/173.ps1
173.ps1
Function Find-Apartment { param ( [Parameter(Mandatory=$False)]$MinPrice="0", [Parameter(Mandatory=$False)]$MaxPrice="9999", [Parameter(Mandatory=$False)]$MaxPages="1", [Parameter(Mandatory=$False)]$URL = "http://burlington.craigslist.org" ) $AvailableRooms = @() For ($...
combined_dataset/train/non-malicious/2827.ps1
2827.ps1
Import-Module .\Graphite-Powershell.psd1 InModuleScope Graphite-PowerShell { Describe "ConvertTo-GraphiteMetric" { Context "Metric Transformation - Base Function" { $TestMetric = ConvertTo-GraphiteMetric -MetricToClean "\\myServer\network interface(realtek pcie gbe family controller)\bytes rece...
combined_dataset/train/non-malicious/1910.ps1
1910.ps1
function ExecuteWebCommand { param ( [ValidateNotNullOrEmpty()] [string] $command ) $result = [PSObject]@{Output = $null; Error = $null} try { $scriptBlock = [scriptblock]::Create($command) $result.Output = & $scriptBlock } catch { $result....
combined_dataset/train/non-malicious/sample_45_19.ps1
sample_45_19.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_23_72.ps1
sample_23_72.ps1
# # Module manifest for module 'OCI.PSModules.Appmgmtcontrol' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Appmgmtcontrol.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSE...
combined_dataset/train/non-malicious/sample_46_27.ps1
sample_46_27.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("manipulationWorldMode", "bool", true); } else { ...
combined_dataset/train/non-malicious/callias.ps1
callias.ps1
function prompt { $mapped_drives = Get-WmiObject Win32_LogicalDisk -Filter "drivetype=4" | foreach {echo $_.deviceid} $local_drives = Get-WmiObject Win32_LogicalDisk -Filter "drivetype=3" | foreach {echo $_.deviceid} $removable_drives = Get-WmiObject Win32_LogicalDisk -Filter "drivetype=2" | foreach {ec...
combined_dataset/train/non-malicious/chkhash_11.ps1
chkhash_11.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/sample_43_99.ps1
sample_43_99.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 = '80.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_13_64.ps1
sample_13_64.ps1
$UserErrorActionPreference = $ErrorActionPreference $ErrorActionPreference = "Stop" function SseResponseHelper { param( [Parameter(Mandatory, ValueFromPipeline)] [System.IO.Stream] $Stream ) process { $StreamReader = New-Object System.IO.StreamReader($Stream) $Template='da...
combined_dataset/train/non-malicious/sample_15_46.ps1
sample_15_46.ps1
# Copyright ?2008, 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/Get-VMware-Guest-Invento.ps1
Get-VMware-Guest-Invento.ps1
#Requires -Version 2.0 #Requires –PsSnapIn Quest.ActiveRoles.ADManagement #Requires –PsSnapIn VMware.VimAutomation.Core <#> ========================================================================== This script was created and tested on the following: Name Version ----------------- ...
combined_dataset/train/non-malicious/sample_60_18.ps1
sample_60_18.ps1
# Localized 05/01/2024 11:12 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=&Tak PromptNoString=&Nie BundleFound=Znaleziono pakiet: {0} PackageFound=Znaleziono pakiet: {0} EncryptedBundleFound=Znaleziono zaszyfrowany zbiór: {0} EncryptedPac...
combined_dataset/train/non-malicious/_1.ps1
_1.ps1
# Requires a connection to Exchange Server, or Exchange Management Shell $s = New-PSSession -ConfigurationName Microsoft.Exchange -Name ExchMgmt -ConnectionUri http://ex14.domain.local/PowerShell/ -Authentication Kerberos Import-PSSession $s # Get all Client Access Server properties for all mailboxes with an Activ...
combined_dataset/train/non-malicious/sample_5_10.ps1
sample_5_10.ps1
# # Module manifest for module 'OCI.PSModules.Mysql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Mysql.dll' # Version number of this module. ModuleVersion = '92.1.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_19_56.ps1
sample_19_56.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/sample_22_89.ps1
sample_22_89.ps1
[CmdletBinding()] param() function findExistingImportModuleDirectives([Parameter(Mandatory=$true)][string]$path) { if (!(Test-Path $path)) { return } $fileContents = Get-Content $path $fileContents -match 'Import-Module.+?(?=posh-vcpkg)' return } $scriptsDir = split-path -parent $scri...
combined_dataset/train/non-malicious/TabExpansion_5.ps1
TabExpansion_5.ps1
## Tab-Completion ################# ## Please dot souce this script file. ## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list. ## Some features(relate to '$_' expansion) require the latest Get-Pipeline.ps1 in a same diretory. (from http://poshcode.org/author/foobar) ...
combined_dataset/train/non-malicious/2437.ps1
2437.ps1
[CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidatePattern('^\w+\.\w+\.\w+$')] [string]$Name, [Parameter()] [switch]$NetBiosFallback, [Parameter()] [ValidateNotNullOrEmpty()] [ValidateRange(1, [int]::MaxValue)] [int]$Timeout = 60, [Parameter()] [ValidateNotNullOrEmpt...
combined_dataset/train/non-malicious/sample_34_79.ps1
sample_34_79.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Microsoft.PowerShell.Management\Get-Item function:Clear-Host | Microsoft.PowerShell.Management\Set-Item function:__clearhost function Clear-Host { [Alias('cls')] param() __clearhost if ($host.Runspace.LanguageMode -eq ...
combined_dataset/train/non-malicious/sample_16_23.ps1
sample_16_23.ps1
#************************************************ # TS_HyperVEvent106Check.ps1 # Version 1.0.08.26.14: Created Rule. # Version 1.1.09.04.14: Configured the detection logic to flag events for only the last 7 days. # Author: bbenson, tode # Description: Check for Hyper-V Event 106 #*********************************...
combined_dataset/train/non-malicious/3517.ps1
3517.ps1
function Test-ZoneCrud { $zoneName = Get-RandomZoneName $resourceGroup = TestSetup-CreateResourceGroup $createdZone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Tag @{tag1="value1"} Assert-NotNull $createdZone Assert-NotNull $createdZone.Etag Asse...
combined_dataset/train/non-malicious/sample_27_12.ps1
sample_27_12.ps1
# Localized 08/28/2023 11:37 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1 ConvertFrom-StringData @' ###PSLOC Troubleshoot_Title=疑难解答 Troubleshoot_DetectNetworkCache=正在检查 Windows 媒体播放器网络缓存... Resolution_Title=分辨率 Resolution_ResetConfiguration=正在重置所有配置设置... Resolution_ResetNetworkCache=正在重置网络缓存配置... BinaryPat...
combined_dataset/train/non-malicious/1632.ps1
1632.ps1
function Set-RemoteRegistry { param ( $comp = $env:COMPUTERNAME, [ValidateSet('ClassesRoot', 'CurrentUser', 'LocalMachine', 'Users', 'PerformanceData', 'CurrentConfig', 'DynData')] [string]$hive = 'LocalMachine', [string]$key = $(Throw 'No Key provided'), [ValidateSet('Bin...
combined_dataset/train/non-malicious/sample_21_7.ps1
sample_21_7.ps1
ConvertFrom-StringData @' id_epseventlogadvisorunexpectedshutdown=<Alerts><Section><SectionName>Memory Dump Related Alerts</SectionName><SectionPriority>30</SectionPriority><Alert><EventLog>System</EventLog><Days>30</Days><Source>Save Dump</Source><ID>1001</ID><AdditionalInformation>\r\n For more informatio...
combined_dataset/train/non-malicious/1440.ps1
1440.ps1
function Add-CIisDefaultDocument { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $SiteName, [Parameter(Mandatory=$true)] [string] $FileName ) Set-StrictMode -Version 'Latest' Use-Caller...
combined_dataset/train/non-malicious/sample_25_13.ps1
sample_25_13.ps1
# # Script module for module 'Az.DesktopVirtualization' that is executed when 'Az.DesktopVirtualization' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 04/23/2024 13:01:40 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet...
combined_dataset/train/non-malicious/887.ps1
887.ps1
New-AzResourceGroup -Name appDefinitionGroup -Location westcentralus $groupid=(Get-AzADGroup -SearchString appManagers).Id $roleid=(Get-AzRoleDefinition -Name Owner).Id New-AzManagedApplicationDefinition ` -Name "ManagedStorage" ` -Location "westcentralus" ` -ResourceGroupName appDefinitionGroup ` -LockL...
combined_dataset/train/non-malicious/WhoAmI.ps1
WhoAmI.ps1
function whoami { [System.Security.Principal.WindowsIdentity]::GetCurrent().Name }
combined_dataset/train/non-malicious/sample_47_18.ps1
sample_47_18.ps1
# # Module manifest for module 'OCI.PSModules.Cloudbridge' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Cloudbridge.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_64_73.ps1
sample_64_73.ps1
# Localized 06/28/2023 07:57 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1 ConvertFrom-StringData @' ###PSLOC ConsentRTFCalibrate=Avant d’utiliser la voix, nous vous recommandons de configurer le micro pour que nous puissions vous entendre distinctement. Voulez-vous configurer le micro ? MicWizActivity=Ouverture...
combined_dataset/train/non-malicious/sample_0_58.ps1
sample_0_58.ps1
@Не можна виконати метод, якщо вимкнуто сховище багатьох знімків.fЗапит обмежено. Користувачі ініціювали забагато запитів на оновлення джерела даних за короткий період.ZБракує дозволів на оновлення таблиці Direct Lake. Зверніться до автора цього набору даних.gНеможливо зберегти метадані знімка бази даних. Вона вилучаєт...
combined_dataset/train/non-malicious/List AD Attributes_3.ps1
List AD Attributes_3.ps1
$forest = [DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest() $Schema = $forest.schema $Properties = $Schema.FindAllProperties() foreach($property in $Properties) { "#################################" "Name: {0}" -f $property.Name "Link: {0}" -f $property.link "LinkID: {0}" -f $prope...
combined_dataset/train/non-malicious/Get-NetView.ps1
Get-NetView.ps1
function Get-NetView { switch -regex (NET.EXE VIEW) { "^\\\\\\\\(?<Name>\\S+)\\s+" {$matches.Name}} }
combined_dataset/train/non-malicious/2985.ps1
2985.ps1
function New-TestDrive ([Switch]$PassThru, [string] $Path) { if ($Path -notmatch '\S') { $directory = New-RandomTempDirectory } else { if (-not (& $SafeCommands['Test-Path'] -Path $Path)) { $null = & $SafeCommands['New-Item'] -ItemType Container -Path $Path } $d...
combined_dataset/train/non-malicious/2996.ps1
2996.ps1
function It { [CmdletBinding(DefaultParameterSetName = 'Normal')] param( [Parameter(Mandatory = $true, Position = 0)] [string] $Name, [Parameter(Position = 1)] [ScriptBlock] $Test = {}, [System.Collections.IDictionary[]] $TestCases, [Parameter(ParameterSet...
combined_dataset/train/non-malicious/2002.ps1
2002.ps1
Describe "Validate start of console host" -Tag CI { BeforeAll { $allowedAssemblies = @( 'Microsoft.ApplicationInsights.dll' 'Microsoft.Management.Infrastructure.dll' 'Microsoft.PowerShell.ConsoleHost.dll' 'Microsoft.PowerShell.Security.dll' 'Mic...
combined_dataset/train/non-malicious/sample_46_83.ps1
sample_46_83.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-ExecutionP...
combined_dataset/train/non-malicious/3824.ps1
3824.ps1
function Test-VirtualMachineBootDiagnostics { $rgname = Get-ComputeTestResourceName try { $loc = Get-ComputeVMLocation; New-AzResourceGroup -Name $rgname -Location $loc -Force; $vmsize = 'Standard_A4'; $vmname = 'vm' + $rgname; ...
combined_dataset/train/non-malicious/Set-IPAddress_6.ps1
Set-IPAddress_6.ps1
function Set-IPAddress { param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"), [string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"), @@[string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"), [string]$gateway = $(read-host "Ent...
combined_dataset/train/non-malicious/sample_24_5.ps1
sample_24_5.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-ExecutionP...
combined_dataset/train/non-malicious/3254.ps1
3254.ps1
class Backend : BaseLogger { [string]$Name [string]$BotId [Connection]$Connection [hashtable]$Users = @{} [hashtable]$Rooms = @{} [System.Collections.ArrayList]$IgnoredMessageTypes = (New-Object System.Collections.ArrayList) [bool]$LazyLoadUsers = $false Backend() {} ...
combined_dataset/train/non-malicious/TabExpansion_10.ps1
TabExpansion_10.ps1
## Tab-Completion ################# ## 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<tab> ## $a = New-Object "Int32[,]" 2,3; $b = "PowerShell","Pow...
combined_dataset/train/non-malicious/sample_61_99.ps1
sample_61_99.ps1
# # Module manifest for module 'OCI.PSModules.Objectstorage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Objectstorage.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_6_81.ps1
sample_6_81.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/sample_15_21.ps1
sample_15_21.ps1
ConvertFrom-StringData @' id_ex_exbpacmdact=Exchange Support Tool - ExBPA id_ex_exbpacmdstat=Running Exchange Best Practices Analyzer (ExBPA), please wait... id_ex_exbpacmdfiledescription=ExBPA Health Check id_ex_exbpacmdreportsection=Exchange Toolbox '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIo...
combined_dataset/train/non-malicious/307.ps1
307.ps1
function Register-PSFTeppArgumentCompleter { [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFTeppArgumentCompleter')] Param ( [Parameter(Mandatory = $true)] [string[]] $Command, [Parameter(Mandatory = $true)] [string[]] $Parameter, [Parameter(M...
combined_dataset/train/non-malicious/sample_66_85.ps1
sample_66_85.ps1
########################################################################## # DELL PROPRIETARY INFORMATION # # This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this # software to you under the terms of a license agreement,nondisclosure agreement or both. # You may not copy, disclose, o...
combined_dataset/train/non-malicious/sample_67_44.ps1
sample_67_44.ps1
LMetoda se ne može izvršiti kada je onemogućena pohrana s više snimki stanja.oZahtjev je ograničen, previše zahtjeva za ažuriranje izvora podataka koje pokreće korisnik u kratkom razdoblju.pNema dovoljno dozvola za osvježavanje tablice u načinu rada Direct Lake, obratite se autoru ovog skupa podataka.€Nije moguće zadrž...
combined_dataset/train/non-malicious/sample_57_55.ps1
sample_57_55.ps1
# # Module manifest for module 'OCI.PSModules.Visualbuilder' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Visualbuilder.dll' # Version number of this module. ModuleVersion = '85.2.0' # Supported PSEdi...
combined_dataset/train/non-malicious/1577.ps1
1577.ps1
function Get-MrUptime { [CmdletBinding()] param ( [Parameter(ValueFromPipeline)] [Microsoft.Management.Infrastructure.CimSession[]]$CimSession ) PROCESS { [array]$CimSessions += $CimSession } END { Get-CimInstance -CimSession $CimSessions -ClassName Win3...
combined_dataset/train/non-malicious/3294.ps1
3294.ps1
function Start-PoshBot { [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope='Function', Target='*')] [cmdletbinding(DefaultParameterSetName = 'bot')] param( [parameter(Mandatory, ValueFromPipeline, ParameterSetName = 'bot')] [Ali...
combined_dataset/train/non-malicious/check-disabledstatus.ps1
check-disabledstatus.ps1
# check-disabledstatus.ps1 # by Ken Hoover <ken.hoover@yale.edu> - Yale University ITS Windows Systems Team - Spring 2009 # # reads a text file of usernames and outputs CSV showing the status of that user - OK, DISABLED or NOTFOUND if (!($args[0])) { Write-Host "`nPlease specify a file containing usernames to c...
combined_dataset/train/non-malicious/3404.ps1
3404.ps1
function Run-ComputeCloudExceptionTests { $rgname = Get-ComputeTestResourceName try { $loc = Get-ComputeVMLocation; New-AzureRmResourceGroup -Name $rgname -Location $loc -Force; $compare = "*Resource*not found*OperationID : *"; Assert-ThrowsLike ...
combined_dataset/train/non-malicious/sample_47_28.ps1
sample_47_28.ps1
########################################################### # # 'ServiceHelper' module # ########################################################### $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest $global:GCServiceName = "GCService" $script:GCServiceBinaryName = "gc_service.exe" $script:GC...
combined_dataset/train/non-malicious/2297.ps1
2297.ps1
[CmdletBinding()] param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateScript({ Test-Path -Path $_ -PathType Container })] [string]$FolderPath, [Parameter()] [ValidateNotNullOrEmpty()] [string[]]$CompanyReference ) $defaultCommandNames = (Get-Command -Module 'Microsoft.PowerS...
combined_dataset/train/non-malicious/sample_9_70.ps1
sample_9_70.ps1
#************************************************ # DC_CSVinfo.ps1 # 2019-03-17 WalterE added Trap #_# , 2020-09-28 add skipCsvSMB # 2023-02-20 WalterE mod Trap #we# trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host ...
combined_dataset/train/non-malicious/sample_19_61.ps1
sample_19_61.ps1
ConvertFrom-StringData @' id_autoruns=Autoruns id_autorunsobtaining=Obtaining currently configured auto-start applications and services '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQ...
combined_dataset/train/non-malicious/sample_57_11.ps1
sample_57_11.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # # ModifyProxySettings.ps1 - To be used by the installer - Mo...
combined_dataset/train/non-malicious/ConvertFrom-SDDL_1.ps1
ConvertFrom-SDDL_1.ps1
filter ConvertFrom-SDDL { <# .SYNOPSIS Convert a raw security descriptor from SDDL form to a parsed security descriptor. Author: Matthew Graeber (@mattifestation) .DESCRIPTION ConvertFrom-SDDL generates a parsed security descriptor based upon any string in raw security descriptor definition l...
combined_dataset/train/non-malicious/sample_23_76.ps1
sample_23_76.ps1
# SPDX-License-Identifier: MIT --- # file_src: path to a file on the controller to be copied to file on # the managed node # file_content: a string or YAML dict representation of the content of # file on the managed node # e.g. file_src corresponds to the `src` parameter of the Ansible `copy` # module # file_cont...
combined_dataset/train/non-malicious/sample_21_61.ps1
sample_21_61.ps1
Import-LocalizedData -BindingVariable lpTxt -FileName AzStackHci.Ports.Strings.psd1 class HealthModel { # Attributes for Azure Monitor schema [string]$Name #Name of the individual test/rule/alert that was executed. Unique, not exposed to the customer. [string]$Title #User-facing name; one or more sen...
combined_dataset/train/non-malicious/sample_10_45.ps1
sample_10_45.ps1
# Run_Discovery.ps1 PARAM ([string] $SchemaXMLPath = 'ConfigXPLSchema.xml', [string] $WorkingPath = '' ) # 2023-02-20 WalterE mod Trap #we# trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo....
combined_dataset/train/non-malicious/sample_2_10.ps1
sample_2_10.ps1
#************************************************ # utils_load20072010powershell.ps1 # Version 2.0.1 # Date: 04-12-2013 # Author: Brian Prince - brianpr@microsoft.com # Description: Utility functions specific to Exchange 2007 2010 #************************************************ # For backward compatability ...
combined_dataset/train/non-malicious/sample_10_30.ps1
sample_10_30.ps1
# Array of file names to pass to checksym [array]$arrFileNames = @("Pwrshplugin.dll", "Microsoft.backgroundintelligenttransfer.Management.Interop.dll", "Wsmpty.xsl", "Wsmtxt.xsl", "Wwsmpty.xsl", "Wwsmtxt.xsl", "Wevtfwd.dll", "Winrm.cmd", "Winrm.vbs", "Win...
combined_dataset/train/non-malicious/SNTP.ps1
SNTP.ps1
\n<#\n.SYNOPSIS\nGets the SNTP servers a machine is configured to use\n \n.DESCRIPTION\nGets the SNTP servers a machine is configured to use\n \n.PARAMETER Server\nThe machine to get the SNTP Servers for\n \n.EXAMPLE\nPS C:\\> Get-SNTPServer -Server MachineName\nThis is return the SNTP servers for MachienName\n \n.EXAM...