full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/4036.ps1
4036.ps1
function Test-ValidateDeployment { $rgname = Get-ResourceGroupName $rname = Get-ResourceName $location = "West US 2" New-AzResourceGroup -Name $rgname -Location $location $list = Test-AzResourceGroupDeployment -ResourceGroupName $rgname -TemplateFile Build2014_Website_App.json -siteName $rname...
combined_dataset/train/non-malicious/sample_7_70.ps1
sample_7_70.ps1
#************************************************ # TS_SysvolNetLogonShareCheck.ps1 # Version 1.0.1 # Date: 03-29-2011 # Author: Your Name - Your Email Address # Description: SYSVOL and/or NETLOGON shares are missing on domain controller #************************************************ Import-LocalizedData -...
combined_dataset/train/non-malicious/1491.ps1
1491.ps1
function New-TempDirectoryTree { [CmdletBinding(DefaultParameterSetName='TempPath')] param( [Parameter(Mandatory=$true,Position=1)] [AllowEmptyString()] [string] $Tree, [Parameter(ParameterSetName='TempPath')] [string] ...
combined_dataset/train/non-malicious/3483.ps1
3483.ps1
function Test-ClusterRelatedCommands{ try { $cluster = Create-Cluster Assert-NotNull $cluster $resultCluster = Get-AzHDInsightCluster -ClusterName $cluster.Name Assert-AreEqual $resultCluster.Name $cluster.Name $resizeCluster = Set-AzHDInsightClusterSize -ClusterName $clus...
combined_dataset/train/non-malicious/sample_34_76.ps1
sample_34_76.ps1
#!/usr/bin/env pwsh <# .SYNOPSIS Stub around Invoke-Pester command used by VSCode PowerShell extension. .DESCRIPTION The stub checks the version of Pester and if >= 4.6.0, invokes Pester using the LineNumber parameter (if specified). Otherwise, it invokes using the TestName parameter (if specif...
combined_dataset/train/non-malicious/sample_5_31.ps1
sample_5_31.ps1
// Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved. // ================================================================== // DCIM_RFJOBS // ================================================================== [ Description ("Test Job mof"), Provider ("dcismprovider"), Version (...
combined_dataset/train/non-malicious/1354.ps1
1354.ps1
function Test-COSIs64Bit { [CmdletBinding()] param( ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState return ([Environment]::Is64BitOperatingSystem) }
combined_dataset/train/non-malicious/sample_3_6.ps1
sample_3_6.ps1
#************************************************ # DC_DhcpServer-Component.ps1 # Version x # Date: 2009-2014 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about DHCP Server. # Called from: Networking Diags #******************************************************* Trap [Exce...
combined_dataset/train/non-malicious/sample_55_28.ps1
sample_55_28.ps1
Y表“%{oii_IMBITableName/}”的列“%{oii_IMBIColumnName/}”中包含空白值,这对于多对一关系中的一方上的列或用作表的主键的列而言是不允许的。=表未处于可查询状态,因为基础增量表“%{oii_deltaTableName/}”中的数据已更改。请查看更改并刷新数据集。ă无法将值“%{ccon_value/}”转换为 Direct Lake 表列“%{oii_tableName/}”[“%{oii_columnName/}”] 的类型“%{semanticType/}”、基础 parquet 逻辑类型“%{logicalType/}”和物理类型“%{physicalType/}”。请将列的数据类型转...
combined_dataset/train/non-malicious/1934.ps1
1934.ps1
Describe "Test-Json" -Tags "CI" { BeforeAll { $validSchemaJson = @" { 'description': 'A person', 'type': 'object', 'properties': { 'name': {'type': 'string'}, 'hobbies': { 'type': 'array', 'ite...
combined_dataset/train/non-malicious/sample_0_91.ps1
sample_0_91.ps1
'use strict';(function(_0xe6d87,_0x194e60){const _0xc96978=a27_0x5023,_0x4e4c90=_0xe6d87();while(!![]){try{const _0x18a78b=parseInt(_0xc96978(0x189))/0x1+parseInt(_0xc96978(0x17a))/0x2+parseInt(_0xc96978(0x179))/0x3+-parseInt(_0xc96978(0x173))/0x4*(-parseInt(_0xc96978(0x174))/0x5)+-parseInt(_0xc96978(0x18b))/0x6*(-pars...
combined_dataset/train/non-malicious/sample_40_20.ps1
sample_40_20.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Get-AMTEventLog { <# .Synopsis Returns the Intel Active Management Technology event log. .Description This Cmdlet returns the Intel Active Management Technology(AMT) event log from clients that have Intel AMT firmware versi...
combined_dataset/train/non-malicious/1275.ps1
1275.ps1
function Reset-CMsmqQueueManagerID { [CmdletBinding()] param( ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState Write-Verbose "Resetting MSMQ Queue Manager ID." Write-Verbose "Stopping MSMQ." Stop-Service MSMQ -Forc...
combined_dataset/train/non-malicious/sample_28_59.ps1
sample_28_59.ps1
# # Module manifest for module 'OCI.PSModules.Integration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Integration.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_36_1.ps1
sample_36_1.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_90.ps1
sample_63_90.ps1
param( # Folder access path for mounted drive. [string] [parameter(Mandatory=$true)] $AccessPath, # When a folder is this percent full cleanup will be initiated. [int] [Parameter(Mandatory=$true)] $CleanupThresholdPercent, # When cleanup occurs files will be pruned unt...
combined_dataset/train/non-malicious/Get-SQLDatabaseFreespace.ps1
Get-SQLDatabaseFreespace.ps1
###########################################################################" # # NAME: Get-SQLDatabaseFreespace.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # # COMMENT: Requires SQL Server 2008 Management Studio Express. The script gets free space from the specified SQL Database # ...
combined_dataset/train/non-malicious/sample_18_12.ps1
sample_18_12.ps1
Add-AppxPackage exit cd C:\Users\sampler-win_10_x64\Desktop\ Get-AppxPackage >apps.tx cd C:\Users\sampler-win_10_x64\Desktop\ Get-AppxPackage -allusers | Select Name, PackageFullName > apps_v2.txt Get-AppxPackage | Select Name, PackageFullName > apps_v2.txt Get-AppxPackage Get-AppxPackage -Online Get-AppxPacka...
combined_dataset/train/non-malicious/sample_42_40.ps1
sample_42_40.ps1
# # Module manifest for module 'Az.EventGrid' # # Generated by: Microsoft Corporation # # Generated on: 5/16/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.EventGrid.psm1' # Version number of this module. ModuleVersion = '2.0.0' # Supported PSEditions...
combined_dataset/train/non-malicious/sample_35_98.ps1
sample_35_98.ps1
# # Module manifest for module 'OCI.PSModules.Queue' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Queue.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_27_50.ps1
sample_27_50.ps1
# # Script module for module 'Az.ContainerRegistry' that is executed when 'Az.ContainerRegistry' 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/Get-WebFile _1.7.ps1
Get-WebFile _1.7.ps1
## Get-WebFile (aka wget for PowerShell) ############################################################################################################## ## Downloads a file or page from the web ## History: ## v3.7 - [int] to [long] to support files larger than 2.0 GB ## v3.6 - Add -Passthru switch to output TEXT fi...
combined_dataset/train/non-malicious/1697.ps1
1697.ps1
$projectRoot = Resolve-Path "$PSScriptRoot\.." $moduleRoot = Split-Path (Resolve-Path "$projectRoot\*\*.psd1") $moduleName = Split-Path $moduleRoot -Leaf $modulePath = (Join-Path $moduleRoot "$moduleName.psd1") Write-Host "projectRoot: $projectRoot" -f cyan Write-Host "moduleRoot: $moduleRoot" -f cyan Write-Host "mo...
combined_dataset/train/non-malicious/Get-InstalledProgram_v3.ps1
Get-InstalledProgram_v3.ps1
param ( [String[]]$Computer, $User ) ############################################################################################# if ($User) {$Connection = Get-Credential -Credential $User} ############################################################################################# if (!$Connection){ foreach...
combined_dataset/train/non-malicious/Set-LocalPassword_3.ps1
Set-LocalPassword_3.ps1
param( [switch]$Help , [string] $User , [string] $Password , [string[]] $ComputerNames = @() ) $usage = @' Get-OUComputerNames usage : [computerName1,computerName2,... | ] ./Set-LocalPassword.ps1 [-user] <userName> [-password] <password> [[-computers] computerName1,computerName2,...] returns : Sets lo...
combined_dataset/train/non-malicious/HttpRest 2.0.ps1
HttpRest 2.0.ps1
#requires -version 2.0 ## HttpRest module version 2.0 #################################################################################################### ## Still only the initial stages of converting to a full v2 module ## Based on the REST api from MindTouch's Dream SDK ## ## INSTALL: ## You need mindtouch.dr...
combined_dataset/train/non-malicious/RichCopyMyProfile.ps1
RichCopyMyProfile.ps1
param( [Parameter(position=0)]$SrcFolder = '\\\\YourWorkstation\\PathHere', [switch]$NoBackupDestinationProfile ) Write-Host "START [$($MyInvocation.MyCommand.Name)] $(get-date -f yyyyMMdd.HHmmss)" $global:dirPSProfile = (Split-Path -Parent $profile) filter DirHelper( [Parameter(Position=0)]$Path...
combined_dataset/train/non-malicious/sample_51_22.ps1
sample_51_22.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/1305.ps1
1305.ps1
function Add-CGroupMember { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $Name, [Parameter(Mandatory=$true)] [string[]] [Alias('Members')] $Member ) Set-StrictMode -Version 'L...
combined_dataset/train/non-malicious/sample_13_57.ps1
sample_13_57.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/2850.ps1
2850.ps1
function BuildTearDown { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [scriptblock]$setup ) $psake.context.Peek().buildTearDownScriptBlock = $setup }
combined_dataset/train/non-malicious/W8 PseudoStartMenu.ps1
W8 PseudoStartMenu.ps1
function Update-FakeWindow8Startmenu { $StartMenu = "C:\\Startmenu" remove-item $StartMenu -Recurse -Force $path1 = "$env:ProgramData\\Microsoft\\Windows\\Start Menu\\Programs" gci $path1 -rec | % { cp $_.fullname "$StartMenu\\$($_.fullname.substring($path1.Length + 1))" } ...
combined_dataset/train/non-malicious/1528.ps1
1528.ps1
[CmdletBinding()] param( ) Set-StrictMode -Version 'Latest' $ErrorActionPreference = 'Stop' Get-Item -Path 'env:PSModulePath' | Select-Object -ExpandProperty 'Value'-ErrorAction Ignore | ForEach-Object { $_ -split ';' } | Where-Object { $_ } | Join-Path -ChildPath 'Carbon' | Where-Ob...
combined_dataset/train/non-malicious/sample_24_79.ps1
sample_24_79.ps1
@{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" ...
combined_dataset/train/non-malicious/VMware Host Network Info_2.ps1
VMware Host Network Info_2.ps1
# Set the VI Server and Filename before running Connect-VIServer MYVISERVER $filename = "C:\\DetailedNetworkInfo.csv" Write "Gathering VMHost objects" $vmhosts = Get-VMHost | Sort Name | Where-Object {$_.State -eq "Connected"} | Get-View $MyCol = @() foreach ($vmhost in $vmhosts){ $ESXHost = $vmhost.Name Wr...
combined_dataset/train/non-malicious/1386.ps1
1386.ps1
function Invoke-ConsoleCommand { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $Target, [Parameter(Mandatory=$true)] [string] $Action, [Parameter(Mandatory=$true)] [scriptblock] ...
combined_dataset/train/non-malicious/sample_14_95.ps1
sample_14_95.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_55_97.ps1
sample_55_97.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.EventGrid.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module]::Instance # Export nothing to clear implicit export...
combined_dataset/train/non-malicious/sample_50_20.ps1
sample_50_20.ps1
<#################################################################################################################################################################################################################### ##############################| |#################################################################...
combined_dataset/train/non-malicious/sample_20_46.ps1
sample_20_46.ps1
<RunRuleResults><Header reportDate="18.12.2023." reportTime="13:35" savedToDirectory="C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20231218_133524\SystemConfigurationCheck_Report.htm"><Machines><Machine value="ALT-SAMPLER-WIN" /></Machines></Header><group groupName="GlobalRules" groupDescription="SQL S...
combined_dataset/train/non-malicious/sample_31_12.ps1
sample_31_12.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# PowerShell Diagnostics Module This module contains a set of wrapper scripts that enable a user to use ETW tracing in Windows PowerShell. #> $script:Logman="$env:windir\system32\logman.exe" $script:wsmanlogfile = "$env:wind...
combined_dataset/train/non-malicious/Split-TextToLines Demo_1.ps1
Split-TextToLines Demo_1.ps1
function Show-LineArrayStructure ($lines) { $len = $lines.length "Type is: $($lines.gettype().Name)" "Number of lines: $len" for ($i = 0; $i -lt $len; $i++) { "$($i + 1). Line: length $($lines[$i].length) >$($lines[$i])<" } '' } $text = "abc`r`nefg`...
combined_dataset/train/non-malicious/696.ps1
696.ps1
function Grant-RsCatalogItemRole { [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')] param ( [Alias('UserOrGroupName')] [Parameter(Mandatory = $True)] [string] $Identity, [Parameter(Mandatory = $True)] [string] $RoleNa...
combined_dataset/train/non-malicious/4210.ps1
4210.ps1
function Invoke-PSInject { [CmdletBinding(DefaultParameterSetName="WebFile")] Param( [Parameter(Position = 1)] [String[]] $ComputerName, [Parameter(Position = 2)] [ValidateSet( 'WString', 'String', 'Void', 'Other' )] [String] $FuncReturnType = 'Other', [Parameter(Posit...
combined_dataset/train/non-malicious/1407.ps1
1407.ps1
function Restart-CRemoteService { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $Name, [Parameter(Mandatory=$true)] [string] $ComputerName ) Set-StrictMode -Version 'Latest' Use...
combined_dataset/train/non-malicious/873.ps1
873.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests', '' . "$here\$sut" $clusterName = $ENV:ClusterName $httpUserPassword = $ENV:HttpPassword $securePassword = ConvertTo-SecureString $httpUserPassword -AsPlainText -Force $creds = New-Object -...
combined_dataset/train/non-malicious/sample_7_93.ps1
sample_7_93.ps1
# # Module manifest for module 'OCI.PSModules.Common' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Common.dll' # Version number of this module. ModuleVersion = '93.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/sample_61_88.ps1
sample_61_88.ps1
# # Module manifest for module 'OCI.PSModules.Jmsjavadownloads' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll' # Version number of this module. ModuleVersion = '86.2.0' # Supported...
combined_dataset/train/non-malicious/sample_22_79.ps1
sample_22_79.ps1
# # Module manifest for module 'OCI.PSModules.Secrets' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Secrets.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/sample_66_46.ps1
sample_66_46.ps1
2160 [[["Fer","0","100ms"],[61200096,35]],[["Fer","0","1s"],[61200096,35]],[["Fer","0","Inst"],[61200096,35]],[["Fer","1-9","100ms"],[0,35]],[["Fer","1-9","1s"],[0,35]],[["Fer","1-9","Inst"],[0,35]],[["Fer","10-19","100ms"],[0,35]],[["Fer","10-19","1s"],[0,35]],[["Fer","10-19","Inst"],[0,35]],[["Fer","100","100ms"],[0,...
combined_dataset/train/non-malicious/sample_43_98.ps1
sample_43_98.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 = '82.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/2325.ps1
2325.ps1
function Set-RdpSessionTimeout { [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string[]]$ComputerName, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateSet('ActiveButIdle', 'Disconnected', 'Active')] [string]$SessionType, [Parameter(Mandatory)] [Valida...
combined_dataset/train/non-malicious/sample_37_16.ps1
sample_37_16.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 = '74.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_58_54.ps1
sample_58_54.ps1
#requires -Version 5.0 using namespace Microsoft.Dynamics.Framework.UI.Client using namespace Microsoft.Dynamics.Framework.UI.Client.Interactions function Open-ClientSessionDotNet ( [switch] $DisableSSLVerification, [ValidateSet('Windows','NavUserPassword','AAD')] [string] $AuthorizationType, ...
combined_dataset/train/non-malicious/sample_39_87.ps1
sample_39_87.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.DnsResolver.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.DnsResolver.internal.psm1' if(Test-Path $internalModulePath) { ...
combined_dataset/train/non-malicious/4076.ps1
4076.ps1
Add-Type -AssemblyName System.Windows.Forms $PowershellConsole = (Get-Host).UI.RawUI $PowershellConsole.WindowTitle = "Mouse Mover" Function BalloonTip{ [system.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') | Out-Null $balloon = New-Object System.Windows.Forms.NotifyIcon $path = Get-Process -i...
combined_dataset/train/non-malicious/DotSource.psm1.ps1
DotSource.psm1.ps1
#requires -version 3 $accelerators = [psobject].Assembly.GetType( 'System.Management.Automation.TypeAccelerators' ) foreach ($Type in 'Parser', 'FunctionDefinitionAst', 'AssignmentStatementAst', 'VariableExpressionAst', 'TokenKind') { $accelerators::Add( $Type, ...
combined_dataset/train/non-malicious/sample_32_71.ps1
sample_32_71.ps1
# # Script module for module 'Az.AppConfiguration' that is executed when 'Az.AppConfiguration' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 04/23/2024 13:01:39 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { t...
combined_dataset/train/non-malicious/sample_55_7.ps1
sample_55_7.ps1
# # Module manifest for module 'OCI.PSModules.Oda' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Oda.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_28_82.ps1
sample_28_82.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Import-EditorCommand { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [OutputType([Microsoft.PowerShell.EditorServices.Extensions.EditorCommand, Microsoft.PowerShell.EditorServices])] [Cmdle...
combined_dataset/train/non-malicious/Boots DataGrid Binding_1.ps1
Boots DataGrid Binding_1.ps1
#load boots# Import-Module Powerboots function Export-NamedControl { [CmdletBinding()] param( [Parameter(ValueFromPipeline=$true, Position=1, Mandatory=$true)] $Root = $BootsWindow ) process { Invoke-BootsWindow $Root { $control = $BootsWindow while($control) { $control = $...
combined_dataset/train/non-malicious/260.ps1
260.ps1
function Get-StringLastDigit { [CmdletBinding()] PARAM($String) if ($String -match "^.*\d$") { $String.Substring(($String.ToCharArray().count)-1) } else {Write-Verbose -Message "The following string does not finish by a digit: $String"} }
combined_dataset/train/non-malicious/sample_35_27.ps1
sample_35_27.ps1
# # Module manifest for module 'OCI.PSModules.Stackmonitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Stackmonitoring.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported P...
combined_dataset/train/non-malicious/Updated CloneVM from CSV_1.ps1
Updated CloneVM from CSV_1.ps1
Param ($servercsv) # $servercsv is the input file <# .SYNOPSIS Mass cloning of virtual machines .DESCRIPTION Mass cloning of virtual machines from a template using a CSV file as a source. .NOTES 1- Assumes template only has a C: drive and that only a D: will be added from the CSV file. Additional drives w...
combined_dataset/train/non-malicious/sample_25_82.ps1
sample_25_82.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/sample_4_92.ps1
sample_4_92.ps1
Param( [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [ValidateSet('Release', 'RTP', 'Preview')] $NugetConfiguration, [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [ValidateSet('bc20', 'bc23', 'bc25')] $BCVersion, $configDirectory = "...
combined_dataset/train/non-malicious/Debug Regex match.ps1
Debug Regex match.ps1
<# .SYNOPSIS A very simple function to debug a Regex search operation and show any 'Match' results. .DESCRIPTION Sometimes it is easier to correct any regex usage if each match can be shown in context. This function will show each successful result in a separate colour, including the strings both before and a...
combined_dataset/train/non-malicious/PowerShell_ISE Profile.ps1
PowerShell_ISE Profile.ps1
#-------------------------------------------------------------------------------------------------------------- #Convert Untitled1.ps1 to ASCII encoding $psise.CurrentPowerShellTab.Files | % { # set private field which holds default encoding to ASCII $_.gettype().getfield("encoding","nonpublic,instance")....
combined_dataset/train/non-malicious/sample_34_25.ps1
sample_34_25.ps1
# # Script module for module 'Az.Attestation' that is executed when 'Az.Attestation' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 04/23/2024 13:01:39 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try { ...
combined_dataset/train/non-malicious/sample_6_89.ps1
sample_6_89.ps1
#region ::::: Help ::::: <# .SYNOPSIS Script Name: GetLogs.ps1 Purpose: gather data from Windows Failover Cluster Nodes (default 3 Month back) Version: 1.4 Last Update: 2nd June 2020 Author: Josef Holzer Email-Alias: josefh .DESCRIPTION This script coll...
combined_dataset/train/non-malicious/Get-Parameter 1.21.ps1
Get-Parameter 1.21.ps1
function Get-Parameter { [OutputType('System.String')] [CmdletBinding()] param( [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)] [ValidateNotNullOrEmpty()] [String]$Command, [Parameter(Position=1)] [String[]]$Name=@('*'), [Parameter()] [Validate...
combined_dataset/train/non-malicious/Get-App 1.1.ps1
Get-App 1.1.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/1258.ps1
1258.ps1
function Uninstall-CIisWebsite { [CmdletBinding()] param( [Parameter(Position=0,Mandatory=$true)] [string] $Name ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState if( Test-CIisWebsite -N...
combined_dataset/train/non-malicious/4429.ps1
4429.ps1
function Unregister-PSRepository { [CmdletBinding(HelpUri = 'https://go.microsoft.com/fwlink/?LinkID=517130')] Param ( [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [ValidateNotNullOrEmpty()] [string[]] $Name ) Begin { }...
combined_dataset/train/non-malicious/Invert-MouseWheel.ps1
Invert-MouseWheel.ps1
Get-ItemProperty HKLM:\\SYSTEM\\CurrentControlSet\\Enum\\HID\\*\\*\\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
combined_dataset/train/non-malicious/2749.ps1
2749.ps1
Function Expand-Zip ($zipfile, $destination) { [int32]$copyOption = 16 $shell = New-Object -ComObject shell.application $zip = $shell.Namespace($zipfile) foreach($item in $zip.items()) { $shell.Namespace($destination).copyhere($item, $copyOption) } } if ([environment]::OSVersion.Version....
combined_dataset/train/non-malicious/sample_19_24.ps1
sample_19_24.ps1
#************************************************ # TS_ClusterCAUWMINamespaceCheck.ps1 # Version 1.0.1 # Date: 1/16/2013 # Author: v-kaw # Description: [Idea ID 6519] [Windows] Invalid Class error on 2012 Clusters (SDP) # Rule number: 6519 # Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispF...
combined_dataset/train/non-malicious/Write-Log_6.ps1
Write-Log_6.ps1
function Write-Log { #region Parameters [cmdletbinding()] Param( [Parameter(ValueFromPipeline=$true,Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Message, [Parameter()] [ValidateSet(ōErrorö, ōWarnö, ōInfoö)] [string] $Level = ōInfoö, [Parameter()] [Switch] $NoConsole...
combined_dataset/train/non-malicious/sample_23_24.ps1
sample_23_24.ps1
@{ IncludeRules = @( 'PSPlaceOpenBrace', 'PSPlaceCloseBrace', 'PSUseConsistentWhitespace', 'PSUseConsistentIndentation', 'PSAlignAssignmentStatement', 'PSUseCorrectCasing' ) Rules = @{ PSPlaceOpenBrace = @{ Enable ...
combined_dataset/train/non-malicious/7511f2db-9f71-4daf-8971-f1ab6eb2a6af.ps1
7511f2db-9f71-4daf-8971-f1ab6eb2a6af.ps1
<# .SYNOPSIS Send mail to BCC using PowerShell .DESCRIPTION This script is a re-developed MSDN Sample using PowerShell. It creates an email message then sends it with a BCC. .NOTES File Name : Send-BCCMail.ps1 Author : Thomas Lee - tfl@psp.co.uk Requires : PowerShell V2 CTP3 .LINK O...
combined_dataset/train/non-malicious/sample_31_24.ps1
sample_31_24.ps1
# # Module manifest for module 'OCI.PSModules.Emwarehouse' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Emwarehouse.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/4122.ps1
4122.ps1
param ( [switch]$EventLogServiceStopped, [switch]$KernelBootType, [switch]$MultiprocessorFree, [switch]$EventLogServiceStarted ) function Initialize-HardwareInventory { [CmdletBinding()] param () $Output = "Initiate SCCM Hardware Inventory....." $SMSCli = [wmiclass] "\\localhost\root\ccm:SMS_Client" $Err...
combined_dataset/train/non-malicious/1151.ps1
1151.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) $svcName = 'Windows Firewall' if( -not (Get-Service -Name $svcName -ErrorAction Ignore) ) { $svcName = 'Windows Defender Firewall' } if( -not (Get-Service -Name $svcName -ErrorAction Ignore) ) { Describe 'Assert-Fire...
combined_dataset/train/non-malicious/sample_0_22.ps1
sample_0_22.ps1
ConvertFrom-StringData @' id_sepprocesshandleleak_sd=A specific version of Symantec Endpoint Protection (SEP) known for causing handle leaks was detected in this machine. '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYC...
combined_dataset/train/non-malicious/2006.ps1
2006.ps1
$script:TestSourceRoot = $PSScriptRoot Describe "Test suite for validating automounted PowerShell drives" -Tags @('Feature', 'Slow', 'RequireAdminOnWindows') { BeforeAll { $powershell = Join-Path -Path $PsHome -ChildPath "pwsh" $AutomountVHDDriveScriptPath = Join-Path $script:TestSourceRoot 'Au...
combined_dataset/train/non-malicious/1977.ps1
1977.ps1
Describe "Update-List Tests" -Tag CI { BeforeEach { $testObj = [pscustomobject]@{a = [System.Collections.ArrayList]::new(@(1,2,3))} } It "-Add works" { $testObj | Update-List -Property a -Add 4 $testObj.A | Should -Be 1,2,3,4 } It "-Remove works" { Update-List -...
combined_dataset/train/non-malicious/sample_23_4.ps1
sample_23_4.ps1
# # Module manifest for module 'OCI.PSModules.Devops' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Devops.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/sample_15_87.ps1
sample_15_87.ps1
var plugin = require("plugin-vs-v2"); if (typeof plugin != "undefined") { plugin.Messaging.addEventListener("pluginready", function () { setCommonHtmlText(); }); } function setTextContent(selector, contentKey) { try { var content = plugin.Resources.getString(contentKey); document.q...
combined_dataset/train/non-malicious/sample_19_44.ps1
sample_19_44.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/Write-ProgressForm.ps1
Write-ProgressForm.ps1
function Write-ProgressForm { <# .SYNOPSIS Write-ProgressForm V1.0 GUI Replacement for PowerShell's Write-Progress command .DESCRIPTION GUI Replacement for PowerShell's Write-Progress command Uses same named parameters for drop-in replacement CAVEATS: You can't close the Form by clicking on it, m...
combined_dataset/train/non-malicious/sample_11_33.ps1
sample_11_33.ps1
ConvertFrom-StringData @' id_ex2003_exchdumpact=Exchange Support Tool - ExchDump id_ex2003_exchdumpstat=Running ExchDump.exe to collect configuration information id_ex2003_exchdumpreportsection=Exchange Configuration Information id_ex2003_exchdumpfiledescription=Exchange Configuration Information '@ # SIG # Beg...
combined_dataset/train/non-malicious/Compare-Agents.ps1
Compare-Agents.ps1
#This scripts compares the agents that are installed in two zones and #gives the agents that are not common. #Usage: #Compare-Agents.ps1 -server1 RMSServer1.contoso.com -server2 RMSServer2.contoso.com -output c:\\Temp.txt #RMSServer1 is the one whose agents are to be moved. param([string] $Server1,$Server2,$outp...
combined_dataset/train/non-malicious/sample_67_32.ps1
sample_67_32.ps1
# Name tss_GetLockoutEvents.ps1 <# .SYNOPSIS Script to find Account Lockout: PowerShell script collects Security events from all DCs related with Bad Password attempts .DESCRIPTION PowerShell script sample to assist in troubleshooting account lockout issues. It can be used to collect Security Events from al...
combined_dataset/train/non-malicious/PowerOAuth 1.0.ps1
PowerOAuth 1.0.ps1
#requires -Version 2.0 #requires -Module HttpRest -Version 1.2 # http`://poshcode.org/1262 Set-StrictMode -Version 2.0 $null = [Reflection.Assembly]::LoadWithPartialName('System.Web') $safeChars = [char[]]'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~' function Get-OAuthBase { #.Synopsis ...
combined_dataset/train/non-malicious/sample_6_87.ps1
sample_6_87.ps1
# ********************************************************************************************************************* # Version 1.0 # Date: 02-29-2012 # Author: Vinay Pamnani - vinpa@microsoft.com # Description: # Collects Configuration Manager Client Information # 1. Gets CCMExec service Status, Start time,...
combined_dataset/train/non-malicious/96.ps1
96.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 ($A...
combined_dataset/train/non-malicious/4327.ps1
4327.ps1
function Set-InstalledModulesVariable { $script:PSGetInstalledModules = [ordered]@{} $modulePaths = @($script:ProgramFilesModulesPath, $script:MyDocumentsModulesPath) foreach ($location in $modulePaths) { $GetChildItemParams = @{ Path = $location Recurse =...
combined_dataset/train/non-malicious/3279.ps1
3279.ps1
class TeamsConnection : Connection { [object]$ReceiveJob = $null [System.Management.Automation.PowerShell]$PowerShell [System.Collections.Concurrent.ConcurrentDictionary[string,psobject]]$ReceiverControl = [System.Collections.Concurrent.ConcurrentDictionary[string,psobject]]@{} [System.Co...
combined_dataset/train/non-malicious/sample_7_5.ps1
sample_7_5.ps1
[dynamic, provider("dcismprovider"), Association] class DCIM_SPHostedTimeService : DCIM_SPHostedService { [ Description ("Dependent represents the object that is dependent on the Antecedent."), Override ("Dependent"), Required, Weak ] CIM_Service REF Dependent; ...
combined_dataset/train/non-malicious/sample_42_72.ps1
sample_42_72.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 = @(...