full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_21_16.ps1
sample_21_16.ps1
# 2023-02-20 WalterE mod Trap #we# trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" } . ./utils_cts.ps1 SkipSecondExecution $EventLogAl...
combined_dataset/train/non-malicious/chkhash_5.ps1
chkhash_5.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/Write-Twilight.ps1
Write-Twilight.ps1
#Write-Twilight while(1){ $wc = Get-Random -Minimum (Get-Random -Minimum 1 -Maximum 3) -Maximum (Get-Random -Minimum 4 -Maximum 14) for($y=0; $y-lt$wc; $y++){ $word = "" $max = Get-Random -Minimum 5 -Maximum 11 $wl = Get-Random -Minimum 1 -Maximum $max fo...
combined_dataset/train/non-malicious/sample_12_78.ps1
sample_12_78.ps1
#************************************************ # TS_SkypeFailureForMissingKB2703761Check.ps1 # Version 1.0.1 # Date: 3/13/2013 # Author: v-blchen # Description: [Idea ID 7499] [Windows] Win8:APP - Skype fails to start # Rule number: 7499 # Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/Disp...
combined_dataset/train/non-malicious/1718.ps1
1718.ps1
function Update-ServiceNowChangeRequest { Param( [parameter(Mandatory=$true)] [parameter(ParameterSetName='SpecifyConnectionFields')] [parameter(ParameterSetName='UseConnectionObject')] [parameter(ParameterSetName='SetGlobalAuth')] [string]$SysId, ...
combined_dataset/train/non-malicious/sample_56_16.ps1
sample_56_16.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ###########################################################...
combined_dataset/train/non-malicious/1230.ps1
1230.ps1
Set-StrictMode -Version 'Latest' & (Join-Path -Path $PSScriptRoot 'Initialize-CarbonTest.ps1' -Resolve) $appPoolName = 'Carbon-Set-IisWebsiteID' $siteName = 'Carbon-Set-IisWebsiteID' Describe 'Set-IisWebsiteID' { BeforeEach { $testDir = Join-Path -Path $TestDrive.FullName -ChildPath ([IO.Path...
combined_dataset/train/non-malicious/sample_34_65.ps1
sample_34_65.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 = '80.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/2644.ps1
2644.ps1
function Copy-SqlLogins{ [cmdletbinding()] param([parameter(Mandatory=$true)][string] $source ,[string] $ApplyTo ,[string[]] $logins ) $smosource = new-object ('Microsoft.SqlServer.Management.Smo.Server') $source $so = new-object microsoft.sqlserver.management.smo.scriptingoptions $so.L...
combined_dataset/train/non-malicious/1467.ps1
1467.ps1
filter Out-HtmlString { $_ | Out-String -Width 9999 | ForEach-Object { $_.Trim() } | Where-Object { $_ } }
combined_dataset/train/non-malicious/sample_26_73.ps1
sample_26_73.ps1
import t from"./javascript-202a59bf.js";import e from"./css-d17117ca.js";const n=Object.freeze({displayName:"HTML",injections:{"R:text.html - (comment.block, text.html meta.embedded, meta.tag.*.*.html, meta.tag.*.*.*.html, meta.tag.*.*.*.*.html)":{comment:"Uses R: to ensure this matches after any other injections.",pat...
combined_dataset/train/non-malicious/4379.ps1
4379.ps1
function Test-ModuleInstalled { [CmdletBinding(PositionalBinding=$false)] [OutputType("PSModuleInfo")] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Name, [Parameter()] [string] $RequiredVersion ) $availab...
combined_dataset/train/non-malicious/sample_20_88.ps1
sample_20_88.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\sucrase@3.35.0\node_modules\sucrase\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\sucrase@...
combined_dataset/train/non-malicious/sample_61_37.ps1
sample_61_37.ps1
# # Script module for module 'Az.DataLakeStore' that is executed when 'Az.DataLakeStore' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 07/04/2024 08:22:40 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try ...
combined_dataset/train/non-malicious/Resizer of pictures.ps1
Resizer of pictures.ps1
[reflection.assembly]::LoadWithPartialName(&#8221;System.Drawing&#8221;) $SizeLimit=1280 # required size of picture's long side $logfile=&#8221;resizelog.txt&#8221; # log file for errors $toresize=$args[0] # list of directories to find and resize images. can be empty if ([string]$toresize -eq &#8...
combined_dataset/train/non-malicious/sample_52_16.ps1
sample_52_16.ps1
param( [String] $ccPath = $(gcm cc), [String] $projPath ) $ErrorActionPreference = "Stop"; $Stopwatch = [System.Diagnostics.Stopwatch]::new() function ElegantExit([String]$Result) { if (![string]::IsNullOrEmpty($Result)) { & "$($PSScriptRoot)/sendMetrics.ps1" -MetricNamespace...
combined_dataset/train/non-malicious/1744.ps1
1744.ps1
[cmdletbinding(DefaultParameterSetName='default')] param ( [string] $fork = 'powershell', [string] $branch = 'master', [string] $location = "$pwd\powershell", [string] $destination = "$env:WORKSPACE", [ValidateSet("win7-x64", "win7-x86", "win-arm", "win-arm64", "fxdependent", "fxdependent-win...
combined_dataset/train/non-malicious/2210.ps1
2210.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Position=0, Mandatory=$true, HelpMessage="Specify Primary Site server")] [ValidateScript({Test-Connection -ComputerName $_ -Count 2})] [string]$SiteServer = "$($env:COMPUTERNAME)", [parameter(Position=1,Mandatory=$true, HelpMessage="Specify...
combined_dataset/train/non-malicious/sample_59_31.ps1
sample_59_31.ps1
name: azdevops-vscode-extension trigger: branches: include: - master tags: include: - v* variables: - group: AzDevOps-VSCode-Extension jobs: - job: Build pool: Nodejs steps: - task: PowerShell@2 displayName: "npm install and vsce package" inputs: ta...
combined_dataset/train/non-malicious/sample_21_87.ps1
sample_21_87.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/Write-DataTable_4.ps1
Write-DataTable_4.ps1
####################### <# .SYNOPSIS Writes data only to SQL Server tables. .DESCRIPTION Writes data only to SQL Server tables. However, the data source is not limited to SQL Server; any data source can be used, as long as the data can be loaded to a DataTable instance or read with a IDataReader instance. .INPUTS...
combined_dataset/train/non-malicious/2517.ps1
2517.ps1
param( $SqlServerOne = 'XSQLUTIL18', $FirstDatabase = 'dbamaint', $SecondDatabase = 'dbamaint', [String[]] $ServerList, $FilePrefix = 'Log', [switch]$Log, [switch]$Column ) $File = $FilePrefix + '{0}-{1}.csv' $Date = (Get-Date -Format ddMMyyyy) $ScriptName = [system.io.path]::GetFilenameWithoutExtension($...
combined_dataset/train/non-malicious/sample_12_73.ps1
sample_12_73.ps1
ConvertFrom-StringData @' id_fileacl=Determining file ACL's '@ # SIG # Begin signature block # MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA6VsPfmmzM00am # qvD0ITk80rX9ws5...
combined_dataset/train/non-malicious/420.ps1
420.ps1
Register-PSFTeppScriptblock -Name "PSFramework-Unregister-PSFConfig-FullName" -ScriptBlock { switch ("$($fakeBoundParameter.Scope)") { "UserDefault" { $path = "HKCU:\SOFTWARE\Microsoft\WindowsPowerShell\PSFramework\Config\Default" } "UserMandatory" { $path = "HKCU:\SOFTWARE\Microsoft\WindowsPowerShell\PSFramework...
combined_dataset/train/non-malicious/2131.ps1
2131.ps1
Describe "Split Operator" -Tags CI { Context "Binary split operator" { It "Binary split operator can split array of value" { $res = "a b", "c d" -split " " $res.count | Should -Be 4 $res[0] | Should -Be "a" $res[1] | Should -Be "b" $res[2] | Shou...
combined_dataset/train/non-malicious/sample_21_51.ps1
sample_21_51.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 = '74.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_7_34.ps1
sample_7_34.ps1
ConvertFrom-StringData @' id_memorydumprelated=Memory Dump Related Issues id_memorydumpcollecting=Collecting Memory Dump Related Information id_memorydumprelatedinfo=Memory dump related information id_memorydumpreport=Memory Dump Report id_memorydumpfile=Memory Dump File '@ # SIG # Begin signature block # MII...
combined_dataset/train/non-malicious/sample_62_86.ps1
sample_62_86.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ function Unpublish-ServiceFab...
combined_dataset/train/non-malicious/MoveJunkEmail.ps1
MoveJunkEmail.ps1
<###################################################### Name: MoveJunkEmail.ps1 Author: Shawn Harris Date: 15 Oct 2012 Purpose: Move specified messages from JunkEmail to another folder. Criteria can be filtered with the restricted property. ######################################################> #Assembly can ...
combined_dataset/train/non-malicious/Logger.psm1 0.3.ps1
Logger.psm1 0.3.ps1
<# Name : Universal Log4Net Logging Module (Logger.psm1) Version : 0.3 Author : Joel Bennett (MVP) Site : http://www.HuddledMasses.org/ Version History: 0.3 - Cleanupable release. Added Udp, Email, Xml and RollingXml, as well as a "Chainsaw":http`://logging.apache.org/log...
combined_dataset/train/non-malicious/4048.ps1
4048.ps1
param ([string]$SnapinPath = $(throw "Path to snapin dll is required"), [string[]]$cmdletClassName = $(throw "Name of cmdlet classes is required"), $OutputPath) $ScriptDir = Split-Path $MyInvocation.MyCommand.Path -Parent if (!$OutputPath) { $OutputPath = Join-Path $ScriptDir ..\Help } ...
combined_dataset/train/non-malicious/New-PInvoke.ps1
New-PInvoke.ps1
function New-PInvoke { <# .Synopsis Generate a powershell function alias to a Win32|C api function .Description Creates C# code to access a C function, and exposes it via a powershell function .Example New-PInvoke -Library User32.dll -Signature "int GetSystemMetrics(uint ...
combined_dataset/train/non-malicious/vibackup-lx_2.ps1
vibackup-lx_2.ps1
Param ( $viServer, $bakVM, $lxDest ) #region check if (!$viServer) { $viServer = Read-Host -Prompt "VI Server " } if (!$bakVM) { $bakVM = Read-Host -Prompt "VM to Backup " } if (!$lxDest) { $lxDest = Read-Host -Prompt "Backup Path (ex. /srv/backup) " } #endregion #region globalvars $encoding = "OEM" ...
combined_dataset/train/non-malicious/Convert-BounceToX_8.ps1
Convert-BounceToX_8.ps1
# $Id: Convert-BounceToX500.ps1 610 2010-11-16 00:39:19Z jon $ # $Revision: 610 $ #.Synopsis # Convert Bounce to X500 #.Description # Convert URL Encoded address in a Bounce message to an X500 address # that can be added as an alias to the mail-enabled object #.Parameter bounceAddress # URL Encoded bounce...
combined_dataset/train/non-malicious/sample_41_23.ps1
sample_41_23.ps1
# Localized 06/28/2023 07:58 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1 ConvertFrom-StringData @' ###PSLOC Troubleshoot_Title=Αντιμετώπιση προβλημάτων Troubleshoot_DetectDVDDevice=Έλεγχος συσκευής DVD... Troubleshoot_DetectDVDvideoDecoder=Έλεγχος αποκωδικοποιητή βίντεο για αναπαραγωγή μέσου DVD... Troublesh...
combined_dataset/train/non-malicious/sample_64_22.ps1
sample_64_22.ps1
param ( [string]$Workspace, # [bool]$UseBCTranslations = $false, # [bool]$UseOMATranslations = $false [string]$strUseBCTranslations = "false", [string]$strUseOMATranslations = "false" ) if ($strUseBCTranslations -eq "true") { $UseBCTranslations = $true } else { $UseBCTranslation...
combined_dataset/train/non-malicious/UIAutomation 1.8.ps1
UIAutomation 1.8.ps1
## UI Automation v 1.8 -- REQUIRES the Reflection module (current version: http://poshcode.org/3174 ) ## # WASP 2.0 is getting closer, but this is still 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.Invo...
combined_dataset/train/non-malicious/finddupe_6.ps1
finddupe_6.ps1
None
combined_dataset/train/non-malicious/cd command with history.ps1
cd command with history.ps1
######################################################## # Custom 'cd' command to maintain directory history # # Usage: # cd no args means cd $home # cd <name> changes to the directory specified by <name> # cd -l list your directory history # cd -# change to the history entry specified...
combined_dataset/train/non-malicious/Out-DataTable_5.ps1
Out-DataTable_5.ps1
####################### <# .SYNOPSIS Creates a DataTable for an object .DESCRIPTION Creates a DataTable based on an objects properties. .INPUTS Object Any object can be piped to Out-DataTable .OUTPUTS System.Data.DataTable .EXAMPLE $dt = Get-Alias | Out-DataTable This example creates a DataTable fro...
combined_dataset/train/non-malicious/VHDFunctions.psm1.ps1
VHDFunctions.psm1.ps1
<# Name: VHDFunctions.psm1 Author: Rich Kusak (rkusak@cbcag.edu) Created: 2009-10-23 LastEdit: 2009-11-02 15:54 Included Functions: Dismount-VHD Initialize-VHD Mount-VHD New-VHD Set-VHDBootConfiguration Test-VHD #> <# .SYNOPSIS Dismount a VHD file from the system. .DESCRIPTION This f...
combined_dataset/train/non-malicious/917.ps1
917.ps1
$resourceGroup = "myResourceGroup" $location = "eastus" $vmName = "myVM" $cred = Get-Credential New-AzResourceGroup -ResourceGroupName myResourceGroup -Location eastus $subnetConfig = New-AzVirtualNetworkSubnetConfig ` -Name mySubnet ` -AddressPrefix 192.168.1.0/24 $vnet = New-AzVirtualNetwork ` -Resourc...
combined_dataset/train/non-malicious/4226.ps1
4226.ps1
function Cred-Popper($title="Outlook", $caption="Please Enter Your Domain Credentials", $minlengthpassword=1) { $scriptblock = @" `$PS = "TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAATAEDA...
combined_dataset/train/non-malicious/sample_24_40.ps1
sample_24_40.ps1
# # Module manifest for module 'OCI.PSModules.Identity' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Identity.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/3116.ps1
3116.ps1
function Add-TrustedHost { [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact="High")] param( [Parameter( Position=0, Mandatory=$true)] [String[]]$TrustedHost ) Begin{ if(-not([Security.Principal.WindowsPrincipal][Security.Principal.Windo...
combined_dataset/train/non-malicious/sample_53_58.ps1
sample_53_58.ps1
# # Module manifest for module 'OCI.PSModules.Budget' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Budget.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/Get-Parameter_3.ps1
Get-Parameter_3.ps1
param($Cmdlet) foreach ($paramset in (Get-Command $Cmdlet).ParameterSets) { $Output = @() foreach ($param in $paramset.Parameters) { $process = "" | Select-Object Name, ParameterSet, Aliases, IsMandatory, CommonParameter $process.Name = $param.Name if ( $paramset.name -eq "__AllParameterSets" ) { $process....
combined_dataset/train/non-malicious/3184.ps1
3184.ps1
Function Get-GPPShortcut { [cmdletbinding(DefaultParameterSetName='Name')] param( [Parameter( Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, ParameterSetName='Name' )] [string[]]$Name = $nul...
combined_dataset/train/non-malicious/Set-PowerGUIWelcomePage.ps1
Set-PowerGUIWelcomePage.ps1
######################################################## # Modifies the default PowerGUI admin console # welcome screen to the mht file you supply # Details available at: # http://dmitrysotnikov.wordpress.com/2009/02/11/rebranding-powergui-consolerebranding-powergui-console/ ######################################...
combined_dataset/train/non-malicious/4023.ps1
4023.ps1
function Test-GetAllADGroups { $groups = Get-AzADGroup Assert-NotNull($groups) foreach($group in $groups) { Assert-NotNull($group.DisplayName) Assert-NotNull($group.Id) } } function Test-GetADGroupWithSearchString { param([string]$displayName) ...
combined_dataset/train/non-malicious/Set-Computername_11.ps1
Set-Computername_11.ps1
function Set-ComputerName { param( [switch]$help, [string]$originalPCName=$(read-host "Please specify the current name of the computer"), [string]$computerName=$(read-host "Please specify the new name of the computer")) $usage = "set-ComputerName -originalPCname CurrentName -computername AnewName" if (...
combined_dataset/train/non-malicious/3128.ps1
3128.ps1
function Invoke-IPv4PortScan { [CmdletBinding()] param( [Parameter( Position=0, Mandatory=$true, HelpMessage='ComputerName or IPv4-Address of the device which you want to scan')] [String]$ComputerName, [Parameter( Position=1, ...
combined_dataset/train/non-malicious/sample_44_41.ps1
sample_44_41.ps1
# # Module manifest for module 'OCI.PSModules.Genericartifactscontent' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Genericartifactscontent.dll' # Version number of this module. ModuleVersion = '79.0.0...
combined_dataset/train/non-malicious/sample_61_87.ps1
sample_61_87.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/Report-DecomVMs.ps1
Report-DecomVMs.ps1
#======================================================================== # Created on: 6/8/2012 9:45 AM # Created by: Clint Jones # Organization: Virtually Genius! # Filename: Report-DecomVMs #======================================================================== #Load PowerCLI Add-PSSnapin VMware.V...
combined_dataset/train/non-malicious/sample_11_47.ps1
sample_11_47.ps1
# # Module manifest for module 'OCI.PSModules.Dns' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dns.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_44_81.ps1
sample_44_81.ps1
# ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Licen...
combined_dataset/train/non-malicious/sample_31_36.ps1
sample_31_36.ps1
# # Module manifest for module 'OCI.PSModules.Osuborganizationsubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll' # Version number of this module. ModuleVersion...
combined_dataset/train/non-malicious/sample_40_86.ps1
sample_40_86.ps1
$timestamp = get-date -uformat %Y%m%d-%k%M%S $transcriptPath = "$($env:temp)\StorageSyncAgent-SetRegPIIAclSettings-$($timestamp).log" Start-Transcript -Path $transcriptPath # The following script removes read permissions from registry key locations which may contain PII information. $regPaths = 'HKLM:\Software\Mi...
combined_dataset/train/non-malicious/sample_66_33.ps1
sample_66_33.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 = '86.2.0' # Supported PSE...
combined_dataset/train/non-malicious/sample_26_52.ps1
sample_26_52.ps1
# # Module manifest for module 'OCI.PSModules.Logging' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Logging.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/sample_22_1.ps1
sample_22_1.ps1
# # Module manifest for module 'OCI.PSModules.Aidocument' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aidocument.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_51_95.ps1
sample_51_95.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/Findup_16.ps1
Findup_16.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; using System.Text.RegularExpressions; namespace Findup { public class FileLengthComparer : I...
combined_dataset/train/non-malicious/Quest Dynamic Group 004.ps1
Quest Dynamic Group 004.ps1
<# 2012.07.06 Information will be uploaded shortly. #>
combined_dataset/train/non-malicious/SqlProxy_5.psm1.ps1
SqlProxy_5.psm1.ps1
# --------------------------------------------------------------------------- ### <Author> ### Chad Miller ### </Author> ### <Description> ### Based on functions in SQLPSX. SqlProxy.psm1 module is used for administering ### SQL Server logins, users, and roles. Designed to be used with PS Remoting. ### All actio...
combined_dataset/train/non-malicious/Join-Collections.ps1
Join-Collections.ps1
#requires -version 2.0 #.Note # Depends on ConvertFrom-HashTable http://poshcode.org/1118 #.Synopsis # Performs an inner join on two collections of objects based on a common key column. #.Description # Takes two sets of objects where there are multiple "rows" and where each set has a shared column where th...
combined_dataset/train/non-malicious/sample_40_77.ps1
sample_40_77.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\marked@11.2.0\node_modules\marked\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\marked@11....
combined_dataset/train/non-malicious/Easy Migration Tool v_1.1.ps1
Easy Migration Tool v_1.1.ps1
#Generated Form Function function GenerateForm { ######################################################################## # Code Generated By: Richard Yaw # Generated On: 09/12/2010 # # Easy Migration Script for VMware (Version 2.1) # - Added a "Reload Tasks" feature. # - Fixed issue with the Undo feature for S...
combined_dataset/train/non-malicious/sample_49_89.ps1
sample_49_89.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/ConvertTo-Hex.ps1
ConvertTo-Hex.ps1
# Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx param ( [string]$SidString ) # Create SID .NET object using SID string provided $sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring # Create a byte array of the proper length $sidBytes = New-Object byte[] ...
combined_dataset/train/non-malicious/Function Run-Script_3.ps1
Function Run-Script_3.ps1
################################################################################# # This function should be included in the PowerShell ISE profile.ps1 and it will # display the start and end times of any scripts started by clicking 'Run Script' # in the Add-ons Menu, or F2; additionally they will be logged to the S...
combined_dataset/train/non-malicious/Hack ESXi_4.ps1
Hack ESXi_4.ps1
$screen = " You see here a virtual switch. ------------ ------ #...........| |....| --------------- ###------------ |...(| |..%...........|########## ###-@...| ...
combined_dataset/train/non-malicious/Assert.ps1
Assert.ps1
function Assert { #.Example # set-content C:\\test2\\Documents\\test2 "hi" # C:\\PS>assert { get-item C:\\test2\\Documents\\test2 } "File wasn't created by Set-Content!" # [CmdletBinding()] param( [Parameter(Position=0,ParameterSetName="Script",Mandatory=$true)] [ScriptBlock]$condition , [Parameter(...
combined_dataset/train/non-malicious/sample_2_32.ps1
sample_2_32.ps1
ConvertFrom-StringData @' id_2k3clsiduseraclcheck_st=Permissions for local Users group was removed from registry key HKCR\\CLSID '@ # SIG # Begin signature block # MIIoVAYJKoZIhvcNAQcCoIIoRTCCKEECAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAA...
combined_dataset/train/non-malicious/1833.ps1
1833.ps1
Describe "Basic Alias Provider Tests" -Tags "CI" { BeforeAll { $testAliasName = "TestAlias" $testAliasValue = "Get-Date" } BeforeEach { New-Item -Path "Alias:\" -Name $testAliasName -Value $testAliasValue > $null } AfterEach { Remove-Item -Path "Alias:\${testAlias...
combined_dataset/train/non-malicious/VMWare VMNET Adapters.ps1
VMWare VMNET Adapters.ps1
# see http://msdn2.microsoft.com/en-us/library/bb201634.aspx # # *NdisDeviceType # # The type of the device. The default value is zero, which indicates a standard # networking device that connects to a network. # # Set *NdisDeviceType to NDIS_DEVICE_TYPE_ENDPOINT (1) if this device is an # endpoint device and ...
combined_dataset/train/non-malicious/sample_44_24.ps1
sample_44_24.ps1
## Copyright (c) Microsoft Corporation. All rights reserved. <# .SYNOPSIS This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. .DESCRIPTION This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. These performance recordings contain Microsoft-Antimal...
combined_dataset/train/non-malicious/374.ps1
374.ps1
Describe "Select-PSFPropertyValue Unit Tests" -Tag "Unit" { BeforeAll { } AfterAll { } Describe "Ensuring unchanged command signature" { It "should have the expected parameter sets" { (Get-Command Select-PSFPropertyValue).ParameterSets.Name | Should -Be 'Default', 'Fallback', 'Select', 'Join', 'Form...
combined_dataset/train/non-malicious/sample_57_86.ps1
sample_57_86.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/322.ps1
322.ps1
function Wait-PSFMessage { [CmdletBinding()] param ( [PSFDateTime] $Timeout = "5m", [switch] $Terminate ) begin { function Test-LogFlushed { [OutputType([bool])] [CmdletBinding()] param ( ) if ([PSFramework.Message.LogHost]::OutQueueLog.Count -gt 0) { return $false ...
combined_dataset/train/non-malicious/3934.ps1
3934.ps1
function Check-CmdletReturnType { param($cmdletName, $cmdletReturn) $cmdletData = Get-Command $cmdletName; Assert-NotNull $cmdletData; [array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") }; [arra...
combined_dataset/train/non-malicious/sample_49_17.ps1
sample_49_17.ps1
# # Module manifest for module 'OCI.PSModules.Monitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Monitoring.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_38_60.ps1
sample_38_60.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_35_6.ps1
sample_35_6.ps1
# # Module manifest for module 'OCI.PSModules.Email' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Email.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_18_15.ps1
sample_18_15.ps1
<# .SYNOPSIS Adds/removes variables to a pipeline or all pipelines in a project. .DESCRIPTION This script is generally useful for setting or removing variables that have an effect on pipelines. This has generally been used for: - Setting variables to control monitoring on internal builds. - Adding and removing opt-out...
combined_dataset/train/non-malicious/Paint board.ps1
Paint board.ps1
function frmMain_Show { Add-Type -AssemblyName PresentationFramework $win = New-Object Windows.Window $ink = New-Object Windows.Controls.InkCanvas # #ink # $ink.MinWidth = $ink.MinHeight = 450 # #win # $win.Content = $ink $win.SizeToContent = "WidthAndHeight" $win.Title = "Paint...
combined_dataset/train/non-malicious/1834.ps1
1834.ps1
Describe "New-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { BeforeAll { $defaultParamValues = $PSdefaultParameterValues.Clone() $IsNotSkipped = ($IsWindows -and !$IsCoreCLR) $PSDefaultParameterValues["it:skip"] = !$IsNotSkipped } AfterAll { $global:PSDef...
combined_dataset/train/non-malicious/1761.ps1
1761.ps1
function Test-Elevated { [CmdletBinding()] [OutputType([bool])] Param() return (([Security.Principal.WindowsIdentity]::GetCurrent()).Groups -contains "S-1-5-32-544") } function Invoke-Msiexec { param( [Parameter(ParameterSetName = 'Install', Mandatory)] [Switch]$I...
combined_dataset/train/non-malicious/1434.ps1
1434.ps1
function Uninstall-CDirectory { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Path, [Switch] $Recurse ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState...
combined_dataset/train/non-malicious/1960.ps1
1960.ps1
Describe "Out-String DRT Unit Tests" -Tags "CI" { It "check display of properties with names containing wildcard characters" { $results = new-object psobject | add-member -passthru noteproperty 'name with square brackets: [0]' 'myvalue' | out-string $results.Length | Should -BeGreaterThan 1 ...
combined_dataset/train/non-malicious/sample_67_72.ps1
sample_67_72.ps1
# # Module manifest for module 'OCI.PSModules.Nosql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Nosql.dll' # Version number of this module. ModuleVersion = '89.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/3499.ps1
3499.ps1
if ($PSEdition -eq 'Desktop') { try { [Microsoft.Azure.PowerShell.Authenticators.DesktopAuthenticatorBuilder]::Apply([Microsoft.Azure.Commands.Common.Authentication.AzureSession]::Instance) } catch {} }
combined_dataset/train/non-malicious/sample_21_14.ps1
sample_21_14.ps1
ConvertFrom-StringData @' id_getexch2013datagatheringlogs=Gathering Exchange Logs id_getexchdatacollectingact=Collecting Data: id_getexchservermailbox=Exchange Mailbox Server Role id_getexchdatawait=This may take several minutes. Please wait id_getexchservercas=Exchange Client Access Server Role id_getexchserver...
combined_dataset/train/non-malicious/Find Local Group Members_6.ps1
Find Local Group Members_6.ps1
# Author: Hal Rottenberg # Purpose: Find matching members in a local group # Used tip from RichS here: http://powershellcommunity.org/Forums/tabid/54/view/topic/postid/1528/Default.aspx # Change these two to suit your needs $ChildGroups = "Domain Admins", "Group Two" $LocalGroup = "Administrators" $MemberName...
combined_dataset/train/non-malicious/Change-ServicePassword_1.ps1
Change-ServicePassword_1.ps1
Param([string]$server,[string]$service,[string]$user,[string]$password) Begin{ function ChangeServicePassword{ Param([string]$srv,[string]$ms,[string]$usr,[string]$pwd) # Setup for WMI $class = "Win32_Service" $method = "change" $computer = $srv $fil...
combined_dataset/train/non-malicious/3525.ps1
3525.ps1
function Get-TestManagementGroupName { "azgovtest5" } function Get-TestResourceGroupName { "jilimpolicytest2" } function Get-TestResourceId { "/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourcegroups/govintpolicyrp/providers/microsoft.network/trafficmanagerprofiles/gov-int-policy-r...
combined_dataset/train/non-malicious/3353.ps1
3353.ps1
param( [Parameter(Mandatory = $false, Position = 0)] [string] $buildConfig ) $VerbosePreference = 'Continue' if ([string]::IsNullOrEmpty($buildConfig)) { Write-Verbose "Setting build configuration to 'Release'" $buildConfig = 'Release' } if($env:AzurePSRoot -eq $null) { $env:AzurePSRoot="...
combined_dataset/train/non-malicious/1713.ps1
1713.ps1
function Update-ServiceNowRequestItem { [System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidUsingConvertToSecureStringWithPlainText','')] [System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidGlobalVars','')] [OutputType([void],[System.Management.Automation.PSCustomObject])] [CmdletBindin...
combined_dataset/train/non-malicious/sample_65_61.ps1
sample_65_61.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.1.0' # Supported PSEditions CompatiblePSEd...