full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/Convert-BounceToX_1.ps1
Convert-BounceToX_1.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/VMware Daily Report_1.ps1
VMware Daily Report_1.ps1
# vCheck - Daily Error Report # # Changes: # Version 1.11 - Simplified mail function. # Version 1.10 - Added How many days old the snapshots are # Version 1.9 - Added ability to change user account which makes the WMI calls # Version 1.8 - Added Real name resolution via AD and sorted disk space by PerfFree # V...
combined_dataset/train/non-malicious/4254.ps1
4254.ps1
$psver = $PSVersionTable.psversion.Major if ($psver -eq '2') { Write-Output "Powershell version 3 required" } function New-ZipFile { [CmdletBinding()] param( [Parameter(Position=0, Mandatory=$true)] $ZipFilePath, [Parameter(Position=1, Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [...
combined_dataset/train/non-malicious/sample_48_27.ps1
sample_48_27.ps1
[CmdletBinding()] param ( [string]$OutFile, [string]$AltDownload, [string]$Proxy, [string]$AltHisEndpoint ) $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' $refVersion = [version] '4.5' $provider = 'Microsoft.HybridCompute' # Error codes used by azcmagent are in r...
combined_dataset/train/non-malicious/881.ps1
881.ps1
New-AzResourceGroup -Name myResourceGroupAG -Location eastus $backendSubnetConfig = New-AzVirtualNetworkSubnetConfig ` -Name myBackendSubnet ` -AddressPrefix 10.0.1.0/24 $agSubnetConfig = New-AzVirtualNetworkSubnetConfig ` -Name myAGSubnet ` -AddressPrefix 10.0.2.0/24 $vnet = New-AzVirtualNetwork ` -Resour...
combined_dataset/train/non-malicious/sample_4_21.ps1
sample_4_21.ps1
O연결 문자열에서 매시업 세그먼트를 찾을 수 없기 때문에 데이터 원본을 Power BI 형식에서 AS Engine 형식으로 변환하지 못했습니다.M연결 문자열에서 위치 세그먼트를 찾지 못했기 때문에 데이터 원본을 Power BI 형식에서 AS Engine 형식으로 변환하지 못했습니다.H압축을 해제한 후 패키지를 로드하지 못했기 때문에 데이터 원본을 Power BI 형식에서 AS 엔진 형식으로 변환하지 못했습니다.[압축을 해제한 후 패키지가 너무 커서 로드하지 못한 것으로 확인되었기 때문에 데이터 원본을 Power BI 형식에서 AS Engine 형식으로 변환하지 못했습...
combined_dataset/train/non-malicious/HEX string to SID string_1.ps1
HEX string to SID string_1.ps1
Function EndianReverse ($strHex) { $intCounter=$strHex.length-1 do { $reverse=$reverse+$strHex.substring($intCounter-1, 2) $intCounter=$intCounter-2 } until ($intCounter -eq -1) return $reverse } Function hex2sid ($strHex) { $intSidVersionLength = 2 $intSubAuthorityCountLength = 2 $in...
combined_dataset/train/non-malicious/sample_13_85.ps1
sample_13_85.ps1
#************************************************ # TS_HyperVSCSIDiskEnum.ps1 # Version 1.0.1 # Date: 03-08-2011 # Author: Andre Teixeira - andret # Description: This checks the number of subkeys under HKLM\System\CurrentControlSet\Enum\SCSI\Disk&Ven_Msft&Prod_Virtual_Disk # If it is large (more th...
combined_dataset/train/non-malicious/MoveMailboxBySize.ps1
MoveMailboxBySize.ps1
### VARIABLES ### #Stop the script if an error ever occurs $ErrorActionPreference = "stop" #Base Directory $BaseDir="C:\\Scripts" #Place for Migration Reports $ReportFileDir="C:\\Scripts\\Logs" #Exclusion List of Mailboxes to Not Move. This should be a return-separated list of mailbox display names to av...
combined_dataset/train/non-malicious/Get-PerformanceHistory 2.ps1
Get-PerformanceHistory 2.ps1
#requires -version 2.0 ## Get-PerformanceHistory.ps1 ############################################################################################################## ## Lets you see the amount of time recent commands in your history have taken ## History: ## v2 - adds a ton of parsing to make the output pretty ## ...
combined_dataset/train/non-malicious/Get-ADGroupMembers_2.ps1
Get-ADGroupMembers_2.ps1
Function Get-ADGroupMembers { <# .SYNOPSIS Return a collection of users in an ActiveDirectory group. .DESCRIPTION This function returns an object that contains all the properties of a user object. This function works for small groups as well as groups in ex...
combined_dataset/train/non-malicious/CSV Validator Framework.ps1
CSV Validator Framework.ps1
# --- begin test-csv.ps1 --- param( [string]$Path = $(throw "require CSV path!"), [string]$RulesetPath = $(throw "require Ruleset path!") ) $csvFiles = Resolve-Path -Path $Path # load rules if ((Test-Path (Resolve-Path $RulesetPath))) { # ruleset is found, execute and assign result to vari...
combined_dataset/train/non-malicious/sample_37_85.ps1
sample_37_85.ps1
using namespace System.Management.Automation using namespace System.Management.Automation.Language # This is an example profile for PSReadLine. # # This is roughly what I use so there is some emphasis on emacs bindings, # but most of these bindings make sense in Windows mode as well. Import-Module PSReadLine ...
combined_dataset/train/non-malicious/sample_34_21.ps1
sample_34_21.ps1
# --------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------------------------------------------...
combined_dataset/train/non-malicious/sample_40_35.ps1
sample_40_35.ps1
"use strict"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. Object.defineProperty(exports, "__esModule", { value: true }); exports.Force = void 0; const switch_1 = require("../switch"); class Force extends switch_1.Switch { switch = 'force'; } exports.Force = Force; //# sourceMappingURL...
combined_dataset/train/non-malicious/sample_64_96.ps1
sample_64_96.ps1
this.webpackChunk([207],{214:function(e,t){Prism.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:{function:{pattern:/(^|[^`])\$\((?:\$\(.*?\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:{}}}},{pa...
combined_dataset/train/non-malicious/sample_64_33.ps1
sample_64_33.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/sample_12_56.ps1
sample_12_56.ps1
# Initialize variables if they aren't already defined. # These may be defined as parameters of the importing script, or set after importing this script. # CI mode - set to true on CI server for PR validation build or official build. [bool]$ci = if (Test-Path variable:ci) { $ci } else { $false } # Build configuration....
combined_dataset/train/non-malicious/sample_25_78.ps1
sample_25_78.ps1
param( [string]$Path ) $isFile = Test-Path -Path $Path -PathType Leaf $reportPath = Get-ChildItem -Path (Split-Path -Path $Path) -Filter *.html | Select-Object -First 1 -ExpandProperty FullName $command = Get-Command -Name New-BurntToastNotification -ErrorAction SilentlyContinue function ShowNotication ...
combined_dataset/train/non-malicious/sample_25_60.ps1
sample_25_60.ps1
# # Module manifest for module 'OCI.PSModules.Ospgateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ospgateway.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/2164.ps1
2164.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Specify which Store to search within")] [ValidateNotNullOrEmpty()] [ValidateSet("iTunes","GooglePlay")] [string]$Store, [parameter(Mandatory=$true, HelpMessage="Specify the app name to search for within the...
combined_dataset/train/non-malicious/sample_36_9.ps1
sample_36_9.ps1
# # Module manifest for module 'OCI.PSModules.Certificatesmanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Certificatesmanagement.dll' # Version number of this module. ModuleVersion = '73.1.0' ...
combined_dataset/train/non-malicious/sample_14_51.ps1
sample_14_51.ps1
# Rule ID 4628 # --------- # http://sharepoint/sites/rules/Rule%20Submissions/Dynamics-CRM_ehagen_2012-06-11-03-02-42.xml # # Description: This checks to see if the data types on each CRM registry key is correct. # # Related KB #----------- # Script Author: jrandall # PARAM($RegistryPath=$null) #r...
combined_dataset/train/non-malicious/sample_9_50.ps1
sample_9_50.ps1
ConvertFrom-StringData @' id_devcon=Information about devices and connections id_devconrunning=Gathering devices and connections information (devcon) id_devconoutput=DevCon Output id_devconoutputdesc=Devices and connections information '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzAN...
combined_dataset/train/non-malicious/SMS_1.psm1.ps1
SMS_1.psm1.ps1
<# .Synopsis Functions for managing SMS and SCCM. .Notes NAME: SMS.psm1 AUTHOR: Tim Johnson <tojo2000@tojo2000.com> #> #Requires -version 2.0 [string]$default_wmi_provider_server = 'myserver' [string]$default_site = 'S00' function Get-SmsWmi { <# .Synopsis A function for accessing the...
combined_dataset/train/non-malicious/1461.ps1
1461.ps1
function Test-CRegistryKeyValue { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Path, [Parameter(Mandatory=$true)] [string] $Name ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $...
combined_dataset/train/non-malicious/sample_64_26.ps1
sample_64_26.ps1
##------------------------------------------------------------------ ## <copyright file="Disable-Extension.ps1" company="Microsoft"> ## Copyright (C) Microsoft. All rights reserved. ## </copyright> ##------------------------------------------------------------------ $ErrorActionPreference = "Stop" $functio...
combined_dataset/train/non-malicious/1726.ps1
1726.ps1
function Get-ServiceNowUser{ [OutputType([System.Management.Automation.PSCustomObject])] [CmdletBinding(DefaultParameterSetName, SupportsPaging)] Param( [Parameter(Mandatory = $false)] [string]$OrderBy = 'name', [Parameter(Mandatory = $false)] [ValidateSet(...
combined_dataset/train/non-malicious/3739.ps1
3739.ps1
$pfxpwd='123' $securepfxpwd=$pfxpwd | ConvertTo-SecureString -AsPlainText -Force $expires= (Get-Date).AddYears(2).ToUniversalTime() $nbf=(Get-Date).ToUniversalTime() $newexpires= (Get-Date).AddYears(5).ToUniversalTime() $newnbf=(Get-Date).AddYears(1).ToUniversalTime() $ops = "decrypt", "verify" $newops = "encrypt",...
combined_dataset/train/non-malicious/3328.ps1
3328.ps1
function Add-RolePermission { [PoshBot.BotCommand( Permissions = 'manage-roles' )] [cmdletbinding()] param( [parameter(Mandatory)] $Bot, [parameter(Mandatory, Position = 0)] [string]$Role, [parameter(Mandatory, Position = 1)] [string]$Permi...
combined_dataset/train/non-malicious/3021.ps1
3021.ps1
Set-StrictMode -Version Latest Describe "Testing Set-ItResult" { It "This test should be inconclusive" { try { Set-ItResult -Inconclusive -Because "we are setting it to inconclusive" } catch { $_.FullyQualifiedErrorID | Should -Be "PesterTestInconclusive" } ...
combined_dataset/train/non-malicious/2284.ps1
2284.ps1
param( [parameter(Mandatory=$true)] $ResourceID, [parameter(Mandatory=$true)] $SiteServer ) function Load-Form { $Form.Controls.Add($ComboBox) $Form.Controls.Add($Button) $Form.Add_Shown({$Form.Activate()}) $Form.Add_Shown({Get-IPAddresses}) [void]$Form.ShowDialog() } function Get-CMSiteCode { $CMSi...
combined_dataset/train/non-malicious/RoboGUI.ps1
RoboGUI.ps1
# a helper GUI to create RoboCopy commands # uses FormsLib.ps1 # # /\\/\\o\\/\\/ # http://thePowerShellGuy.com # load windows.forms assembly and FormsLib.ps1 [system.reflection.assembly]::LoadWithPartialName('system.windows.forms') . .\\FormsLib.ps1 ###############################################...
combined_dataset/train/non-malicious/BinaryClock V2.0.ps1
BinaryClock V2.0.ps1
Function Start-BinaryClock { <# .SYNOPSIS This is a binary clock that lists the time in hours, minutes and seconds .DESCRIPTION This is a binary clock that lists the time in hours, minutes and seconds. Key Input Tips: r: Toggles the resize mode of the clock so you can adjust the size....
combined_dataset/train/non-malicious/3995.ps1
3995.ps1
$testAutomationAccount = @{ ResourceGroupName = 'anatolib-azureps-test-rg' AutomationAccountName = 'anatolib-azureps-test-aa' } $testGlobalModule = @{ Name = 'Azure' Version = '1.0.3' Size = 41338511 ActivityCount = 673 } $testNonGlobalModule = @{ Name = 'Pester' Version = '3.0.3' ContentLinkUri ...
combined_dataset/train/non-malicious/1299.ps1
1299.ps1
function Uninstall-CService { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $Name, [timespan] $StopTimeout ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdl...
combined_dataset/train/non-malicious/2937.ps1
2937.ps1
$ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest properties { $container = @{} } Task default -depends task2 Task Step1 -alias task1 { 'Hi from Step1 (task1)' } Task Step2 -alias task2 -depends task1 { 'Hi from Step2 (task2)' }
combined_dataset/train/non-malicious/sample_52_43.ps1
sample_52_43.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("showEm...
combined_dataset/train/non-malicious/2479.ps1
2479.ps1
function Remove-AzrVirtualMachine { [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] param ( [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [ValidateNotNullOrEmpty()] [Alias('Name')] [string]$VMName, [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [ValidateNotNullOrEmp...
combined_dataset/train/non-malicious/sample_41_22.ps1
sample_41_22.ps1
Param( [parameter(Mandatory = $true)] [string] $histogramFile ) ## list of histograms aligning with Edge performance metrics $metricNames = @() $metricNames += "PageLoad.Experimental.PaintTiming.NavigationToFirstMeaningfulPaint" $metricNames += "PageLoad.PaintTiming.NavigationToFirstContentfulPa...
combined_dataset/train/non-malicious/sample_55_27.ps1
sample_55_27.ps1
# # Module manifest for module 'OCI.PSModules.Database' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Database.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/279.ps1
279.ps1
$sourceReportGroupId = " FILL ME IN " $sourceReportId = " FILL ME IN " $targetReportName = " FILL ME IN " $targetGroupId = " FILL ME IN " $targetDatasetId = " FILL ME IN " $clientId = " FILL ME IN " function GetAuthToken { if(-not (Get...
combined_dataset/train/non-malicious/Copy-MAGig.ps1
Copy-MAGig.ps1
function Copy-MAGig { param( [string]$src, [string]$dest, $exclude, [int]$width = 100, # used with the -log switch to format the log, [int]$ident = 2, # dito [switch]$log, # if -verbose had a nice format and its output cou...
combined_dataset/train/non-malicious/2852.ps1
2852.ps1
function Include { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$fileNamePathToInclude ) Assert (test-path $fileNamePathToInclude -pathType Leaf) ($msgs.error_invalid_include_path -f $fileNamePathToInclude) $psake.context.Peek().includes.Enqueue((Resolve-Pat...
combined_dataset/train/non-malicious/sample_19_88.ps1
sample_19_88.ps1
# # Module manifest for module 'OCI.PSModules.Bastion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Bastion.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/3487.ps1
3487.ps1
function Test-SetGatewayCredential{ try { $cluster= Create-Cluster $username = "admin" $textPassword= "YourPw!00953" $password = ConvertTo-SecureString $textPassword -AsPlainText -Force $credential = New-Object System.Management.Automation.PSCredential($username, $password) $gateway...
combined_dataset/train/non-malicious/sample_9_37.ps1
sample_9_37.ps1
ConvertFrom-StringData @' id_etltraceenable=Enabling %Component% Event Trace Log id_etltraceenabledesc=Enabling Event Trace Log for %Component% id_etltracereprotitle=Please click 'Next' to start collecting data id_etltracereprodescription=Please click 'Next' to start collecting information. You will be prompted to ...
combined_dataset/train/non-malicious/sample_58_11.ps1
sample_58_11.ps1
# # Module manifest for module 'OCI.PSModules.Networkloadbalancer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Networkloadbalancer.dll' # Version number of this module. ModuleVersion = '85.1.0' # Sup...
combined_dataset/train/non-malicious/868.ps1
868.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/Make a phone call_2.ps1
Make a phone call_2.ps1
<# .NOTES AUTHOR: Sunny Chakraborty(sunnyc7@gmail.com) WEBSITE: http://tekout.wordpress.com VERSION: 0.1 CREATED: 17th April, 2012 LASTEDIT: 17th April, 2012 Requires: PowerShell v2 or better .CHANGELOG 4/17/2012 Try passing powershell objects to PROTO API and pass the variables to .JS file P...
combined_dataset/train/non-malicious/sample_27_55.ps1
sample_27_55.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 = '75.1.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/1026.ps1
1026.ps1
$endpoint = 'mysftestcluster.southcentralus.cloudapp.azure.com:19000' $thumbprint = '2779F0BB9A969FB88E04915FFE7955D0389DA7AF' $packagepath="C:\Users\sfuser\Documents\Visual Studio 2017\Projects\MyApplication\MyApplication\pkg\Release" Connect-ServiceFabricCluster -ConnectionEndpoint $endpoint ` -KeepAlive...
combined_dataset/train/non-malicious/Set-VMBuildCSVDeploy.ps1
Set-VMBuildCSVDeploy.ps1
####################################################################### # # Purpose: Build VMs from CSV file built by SET-VMBUILDCSV.ps1 # Author: David Chung # Docs: N/A # # v.1 - 02/10/2012 # # Instruction: ./set-vmbuildcsvdeploy.ps1 viserver csvfilename # #########################################...
combined_dataset/train/non-malicious/PowerShell Template.ps1
PowerShell Template.ps1
Function New-Script { $strName = $env:username $date = get-date -format d $name = Read-Host "Filename" if ($name -eq "") { $name="NewTemplate" } $email = Read-Host "eMail Address" if ($email -eq "") { $email="youremail@yourhost.com" } $file = New-Item -type file "$name.ps1" -force $template=@" ###############...
combined_dataset/train/non-malicious/sample_14_82.ps1
sample_14_82.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\update-browserslist-db@1.0.13_browserslist@4.22.3\node_modules\update-browserslist-db\node_modules;C:\Users\abder\c...
combined_dataset/train/non-malicious/Invoke-RemoteCommand.ps1
Invoke-RemoteCommand.ps1
<# # Script FileName: func_Invoke-RemoteCommand.ps1 # Current Version: A03 # Description: Run command on a remote computer as the currently logged on user. # Created By: Adam Listek # Version Notes # A01 - Initial Release # A02 - Conversion to Function # A03 - Abstracted to generic purpos...
combined_dataset/train/non-malicious/1477.ps1
1477.ps1
function Set-ModuleNuspec { param( [Parameter(Mandatory=$true)] [string] $ManifestPath, [Parameter(Mandatory=$true)] [string] $NuspecPath, [Parameter(Mandatory=$true)] [string] $ReleaseNotesPath, [string[]...
combined_dataset/train/non-malicious/sample_28_41.ps1
sample_28_41.ps1
# # Module manifest for module 'OCI.PSModules.Healthchecks' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/3364.ps1
3364.ps1
Function CreateAdApp_Test { $adDisplayName = "TestAdAppForNodeCliTestCase" $subId = '2c224e7e-3ef5-431d-a57b-e71f4662e3a6' Create-ServicePrincipal -ADAppDisplayName "MyModTestApp1" -SubscriptionId 2c224e7e-3ef5-431d-a57b-e71f4662e3a6 -TenantId 72f988bf-86f1-41af-91ab-2d7cd011db47 -createADAppIfNotFound $tr...
combined_dataset/train/non-malicious/sample_52_99.ps1
sample_52_99.ps1
# # Module manifest for module 'Microsoft.SME.RegistryEditor' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.RegistryEditor.psm1' # Version number of this module. ModuleVersion = '4.10.0' # Supported PSEditions # CompatiblePSEditions = @() # ID ...
combined_dataset/train/non-malicious/3178.ps1
3178.ps1
function Import-PSCredential { [cmdletbinding()] param ( [Alias("FullName")] [validatescript({ Test-Path -Path $_ })] [string]$Path = "credentials.$env:computername.xml", [string]$GlobalVariable ) $import = Import-Clixml -Path $Path -ErrorAction St...
combined_dataset/train/non-malicious/3252.ps1
3252.ps1
class Scheduler : BaseLogger { [hashtable]$Schedules = @{} hidden [StorageProvider]$_Storage Scheduler([StorageProvider]$Storage, [Logger]$Logger) { $this._Storage = $Storage $this.Logger = $Logger $this.Initialize() } [void]Initialize() { $this.LogInfo('Initiali...
combined_dataset/train/non-malicious/Findup_15.ps1
Findup_15.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/Get-Hostname_2.ps1
Get-Hostname_2.ps1
# .SYNOPSIS # Print the hostname of the system. # .DESCRIPTION # This function prints the hostname of the system. You can additionally output the DNS # domain or the FQDN by using the parameters as described below. # .PARAMETER Short # (Default) Print only the computername, i.e. the same value as returned by $env...
combined_dataset/train/non-malicious/515.ps1
515.ps1
function Enable-SPBlobCache{ [CmdletBinding()] param( [Parameter(Mandatory=$true)] [String] $Identity, [Parameter(Mandatory=$false)] [String] $Path = "E:\Blobcache" ) if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Microsoft....
combined_dataset/train/non-malicious/group-byobject_4.ps1
group-byobject_4.ps1
function Group-ByObject { #.Synopsis # Groups by a set of properties, returning objects #.Description # A wrapper for the built-in Group-Object cmdlet which returns one of the original objects (with separate properties for each property used to group) rather than a simple string representation as the "name" of the ...
combined_dataset/train/non-malicious/Disable-CopyPasta.ps1
Disable-CopyPasta.ps1
Begin { $disableCopy = "isolation.tools.copy.enable" $disableCopy_value = "false" $disablePaste = "isolation.tools.paste.enable" $disablePaste_value = "false" $disableGUI = "isolation.tools.setGUIOptions.enable" $disableGUI_vsalue = "false" } Process { #Make Sure it's a VM if ( $_ -isnot [VMwar...
combined_dataset/train/non-malicious/Get-DCsFromDNS.ps1
Get-DCsFromDNS.ps1
function Get-DCsFromDNS($DomainName){ $DCs = get-dns _ldap._tcp.dc._msdcs.$DomainName -Type srv | select -ExpandProperty RecordsRR | %{$_.record.target} | select -Unique | sort | %{ get-dns $_ | select -ExpandProperty Answers | select Name,@{n='IPAddress';e={$_.Record}}} return $DCs }
combined_dataset/train/non-malicious/sample_62_4.ps1
sample_62_4.ps1
# # Module manifest for module 'OCI.PSModules.Aivision' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aivision.dll' # Version number of this module. ModuleVersion = '88.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/Deploying VM with static_1.ps1
Deploying VM with static_1.ps1
# 1. Create a simple customizations spec $custSpec = New-OSCustomizationSpec -Type NonPersistent -OSType Windows -OrgName TestOrgName -FullName TestFullName -Workgroup TestWorkgroup # 2. Modify the default network customization settings $custSpec | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -IpMod...
combined_dataset/train/non-malicious/sample_42_50.ps1
sample_42_50.ps1
# # Module manifest for module 'OCI.PSModules.Containerengine' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Containerengine.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported P...
combined_dataset/train/non-malicious/sample_0_70.ps1
sample_0_70.ps1
'use strict';(function(_0x54c951,_0x5bce53){const _0x560119=a8_0x1763,_0x25a6a4=_0x54c951();while(!![]){try{const _0x108e33=parseInt(_0x560119(0xb4))/0x1+-parseInt(_0x560119(0x9d))/0x2*(-parseInt(_0x560119(0xa7))/0x3)+parseInt(_0x560119(0xab))/0x4*(parseInt(_0x560119(0x9c))/0x5)+-parseInt(_0x560119(0x8a))/0x6*(parseInt...
combined_dataset/train/non-malicious/2920.ps1
2920.ps1
properties { $my_property = $p1 + $p2 } task default -depends TestParams task TestParams { Assert ($my_property -ne $null) '$my_property should not be null' }
combined_dataset/train/non-malicious/sample_25_10.ps1
sample_25_10.ps1
<!--xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PowerShell/PowerShell/master/src/Schemas/Format.xsd"?--> <Configuration> <ViewDefinitions> <View> <Name>default</Name> <ViewSelectedBy> <TypeName>PoshSvn.CmdLets.Svn...
combined_dataset/train/non-malicious/sample_7_14.ps1
sample_7_14.ps1
ConvertFrom-StringData @' id_filesnottobackup2k3check_st=There are too many HKLM\\SYSTEM\\CurrentControlSet\\Control\\BackupRestore\\FilesNotToBackup entries and this may cause problems with ntbackup '@ # SIG # Begin signature block # MIIoUwYJKoZIhvcNAQcCoIIoRDCCKEACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgE...
combined_dataset/train/non-malicious/LibraryChart.ps1
LibraryChart.ps1
# --------------------------------------------------------------------------- ### <Script> ### <Author> ### Chad Miller ### </Author> ### <Description> ### Defines functions for wokring with Microsoft Chart Control for .NET 3.5 Framework ### Pipe output of Powershell command to Out-Chart function and specify c...
combined_dataset/train/non-malicious/sample_41_31.ps1
sample_41_31.ps1
########################################################### # # 'ServiceHelper' module # ########################################################### $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest $global:GCServiceName = "GCService" $script:GCServiceBinaryName = "gc_service.exe" $script:GC...
combined_dataset/train/non-malicious/sample_12_17.ps1
sample_12_17.ps1
ConvertFrom-StringData @' id_PoolMon=PoolMon information id_PoolMonrunning=Gathering PoolMon information (PoolMon.exe) id_PoolMonoutput=PoolMon Output id_PoolMonoutputdesc=PoolMon Snaps information '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3Ag...
combined_dataset/train/non-malicious/Xml Module 3.ps1
Xml Module 3.ps1
#requires -version 2.0 # Improves over the built-in Select-XML by leveraging Remove-XmlNamespace http://poshcode.org/1492 # to provide a -RemoveNamespace parameter -- if it's supplied, all of the namespace declarations # and prefixes are removed from all XML nodes (by an XSL transform) before searching. # IMPO...
combined_dataset/train/non-malicious/650.ps1
650.ps1
Describe "Remove-RsCatalogItem" { Context "Remove-RsCatalogItem with min parameters"{ $folderName = 'SutRemoveRsCatalogItem_MinParameters' + [guid]::NewGuid() New-RsFolder -Path / -FolderName $folderName $folderPath = '/' + $folderName $localPath = (Get-Item -Path ".\").FullNam...
combined_dataset/train/non-malicious/sample_8_21.ps1
sample_8_21.ps1
#************************************************ # DC_DhcpClient-Component.ps1 # Version 1.0 # Date: 2009 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about DHCP Client. # Called from: Main Networking Diag #******************************************************* Trap [Exc...
combined_dataset/train/non-malicious/NewUser in AD_OCS_Email.ps1
NewUser in AD_OCS_Email.ps1
# New User In PowerShell # ye110wbeard (EnergizedTech) Finally shuts up and writes a script that is USEFUL and doesn't sing about it # 7/15/2009 :) # And it couldn't have happened if it wasn't for the Powershell Community # # This script in many ways is VERY simple. I simply chose to use simple assignments i...
combined_dataset/train/non-malicious/sample_47_88.ps1
sample_47_88.ps1
<# .SYNOPSIS SyncShare.psd1 file This is a place-holder module file only for agent patch build purposes #> Write-Host "This module functionality is deprecated and is place-holder only" # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEE...
combined_dataset/train/non-malicious/sample_51_80.ps1
sample_51_80.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/Colorize Subversion SVN_3.ps1
Colorize Subversion SVN_3.ps1
# draw output function drawlines($colors, $lines) { if (!$lines) { return } foreach ($line in $lines) { $color = $colors[[string]$line[0]] if ($color) { write-host $line -Fore $color } else { write-host $line } } } # svn stat function ss { drawlines @{ "A"="Magenta"; "D"="Red"; "C"="Ye...
combined_dataset/train/non-malicious/VMWare Quick Migration_2.ps1
VMWare Quick Migration_2.ps1
######################################### #Name: VMWare Quick Migration Function #Author: Justin Grote <jgrote NOSPAMAT enpointe DOT com> #Credit: Inspired by Mike DiPetrillo's Quick Migration Script: http://www.mikedipetrillo.com/mikedvirtualization/2008/10/quick-migration-for-vmware-the-power-of-powershell.html #...
combined_dataset/train/non-malicious/sample_17_11.ps1
sample_17_11.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\vue-tsc@1.8.27_typescript@5.3.3\node_modules\vue-tsc\bin\node_modules;C:\Users\abder\component-maker\web\node_modul...
combined_dataset/train/non-malicious/sample_38_6.ps1
sample_38_6.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # # Azure File Sync (AFS): repair the corrupted event channels # ...
combined_dataset/train/non-malicious/Get-RebootTime.ps1
Get-RebootTime.ps1
$compres = Read-Host -message "Enter a computer name." $date = Get-WmiObject Win32_OperatingSystem -ComputerName $compres | foreach{$_.LastBootUpTime} $RebootTime = [System.DateTime]::ParseExact($date.split('.')[0],'yyyyMMddHHmmss',$null) $RebootTime
combined_dataset/train/non-malicious/Invoke-RickRoll.ps1
Invoke-RickRoll.ps1
function Invoke-RickRoll { <# .SYNOPSIS Invoke-RickRoll A RickRoll PowerShell Script :) Authors: Chris Campbell (@obscuresec) License: BSD 3-Clause .DESCRIPTION A script to call IE and send it to a URL. .PARAMETER VideoURL Specifies a URL to send IE to. .EXAMPLE ...
combined_dataset/train/non-malicious/sample_8_47.ps1
sample_8_47.ps1
ConvertFrom-StringData @' id_clusteripv6firewallcheck_st=One or more Windows Firewall rules are disabled on nodes with IPv6 enabled '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAI...
combined_dataset/train/non-malicious/46.ps1
46.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 ($AadM...
combined_dataset/train/non-malicious/sample_4_44.ps1
sample_4_44.ps1
# 2023-02-24 WalterE mod Trap #we# $startTime_AutoAdd = Get-Date trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" } Write-Host -Background...
combined_dataset/train/non-malicious/3721.ps1
3721.ps1
Param( [parameter(Mandatory=$true)] [string] $SubscriptionId, [parameter(Mandatory=$true)] [string] $ServicePrincipal , [parameter(Mandatory=$false)] [string] $ServicePrincipalSecret, [parameter(Mandatory=$false)] [string] $TenantId = "24c154bb-0619-4338-b30a-6aad6370ee14", [paramete...
combined_dataset/train/non-malicious/sample_29_26.ps1
sample_29_26.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ##############################################################>...
combined_dataset/train/non-malicious/1625.ps1
1625.ps1
function OnApplicationLoad { if([Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms.DataVisualization") -eq $null) { [void][reflection.assembly]::Load("System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") [void][System.Windows.Forms.MessageBox]::Show("...
combined_dataset/train/non-malicious/sample_50_42.ps1
sample_50_42.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=この名前と種類の環境変数は既に存在します。 EnvironmentErrorDoesNotExists=この名前と種類の環境変数は存在しません。 '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBA...
combined_dataset/train/non-malicious/2652.ps1
2652.ps1
function Set-SQLStartupParameters{ [cmdletbinding(SupportsShouldProcess=$true)] param([parameter(ValueFromPipeline,Mandatory=$true)][string[]] $ServerInstance ,[string[]] $StartupParameters ) [bool]$SystemPaths = $false BEGIN{ If (-not ([Security.Principal.WindowsPrincipal] [Security...
combined_dataset/train/non-malicious/sample_7_95.ps1
sample_7_95.ps1
# Queries EDP WNFs to get current configuration state. # param($scriptOutputPath, $scriptmode) $logpath = $scriptOutputPath + "\\" + $scriptmode + "EdpState.log" Add-Content -Path $logpath -Value ($scriptmode + ": Log EDP config info") # WNF (and other) p/invoke types. Add-Type -Path ($PSScriptRoot + "\\edput...
combined_dataset/train/non-malicious/New-XVM_7.ps1
New-XVM_7.ps1
#Examples <# New-XVM -Name "WS2012-TestServer01" -SwitchName "Switch(192.168.2.0/24)" -VhdType NoVHD New-XVM -Name "WS2012-TestServer02" -SwitchName "Switch(192.168.2.0/24)" -VhdType ExistingVHD -VhdPath 'D:\\vhds\\WS2012-TestServer02.vhdx' New-XVM -Name "WS2012-TestServer03" -SwitchName "Switch(192.168.2.0/24)" ...