full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_13_96.ps1
sample_13_96.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_20_80.ps1
sample_20_80.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\cssesc@3.0.0\node_modules\cssesc\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\cssesc@3.0....
combined_dataset/train/non-malicious/sample_45_96.ps1
sample_45_96.ps1
# # Module manifest for module 'OCI.PSModules.Core' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Core.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/sample_46_55.ps1
sample_46_55.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_3_77.ps1
sample_3_77.ps1
Vigor2865 Series User’s Guide 796 TTeellnneett CCoommmmaanndd:: aaddssll ppvvccbbiinnddiinngg This command can configure PVC to PVC binding. Such command is available only for PPPoE and MPoA 1483 Bridge mode. SSyynnttaaxx adsl pvcbinding [pvc_x pvc_y | status | -1 ] SSyynnttaaxx DDeessccrriippttiioonn Param...
combined_dataset/train/non-malicious/848.ps1
848.ps1
$SubscriptionName = "[your Azure subscription name]" $ResourceGroupName = "[your Azure resource group name]" $DataFactoryName = "[your data factory name]" $DataFactoryLocation = "EastUS" $AzureSSISName = "[your Azure-SSIS Integration Runtime name]" $AzureSSISDescription = "This is my Azure-SSIS Integration Runtime...
combined_dataset/train/non-malicious/3808.ps1
3808.ps1
function Test-SimpleNewVm { $vmname = Get-ResourceName try { $username = "admin01" $password = Get-PasswordForVM | ConvertTo-SecureString -AsPlainText -Force $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password...
combined_dataset/train/non-malicious/3476.ps1
3476.ps1
function Get-Cluster-Location { return Get-Location "Microsoft.Kusto" "operations" "Central US" } function Get-RG-Location { Get-Location "Microsoft.Resources" "resourceGroups" "Central US" } function Get-RG-Name { return getAssetname } function Get-Cluster-Default-Capacity { return 2 } functi...
combined_dataset/train/non-malicious/d0047a4f-cc03-41f0-ba05-197bd8b5f759.ps1
d0047a4f-cc03-41f0-ba05-197bd8b5f759.ps1
Coresponding to the Scripting Guy blog "How Can I Both Save Information in a File and Display It on the Screen? " (http://blogs.technet.com/heyscriptingguy/archive/2009/07/07/hey-scripting-guy-how-can-i-both-save-information-in-a-file-and-display-it-on-the-screen.aspx): My comment is: "All of the above is cool but c...
combined_dataset/train/non-malicious/sample_20_6.ps1
sample_20_6.ps1
# VK_ICD_FILENAMES environment variable is not used when running with # elevated privileges. Add a key to the registry instead. $hkey_path = "HKLM:\SOFTWARE\Khronos\Vulkan\Drivers\" $hkey_name = Join-Path -Path $pwd -ChildPath "_install\share\vulkan\icd.d\dzn_icd.x86_64.json" New-Item -Path $hkey_path -force New-ItemPr...
combined_dataset/train/non-malicious/ScheduleGPOBackups_2.ps1
ScheduleGPOBackups_2.ps1
Import-Module grouppolicy #region ConfigBlock # What domain are we going to backup GPOs for? $domain = "mydomain.com" # Where are we going to store the backups? $gpoBackupRootDir = "c:\\gpoBackups" # As I plan to do a new backup set each month I'll setup the directory names to reflect # the year and month in a n...
combined_dataset/train/non-malicious/Get-BogonList_1.ps1
Get-BogonList_1.ps1
function Get-BogonList { <# .SYNOPSIS Gets the bogon list. .DESCRIPTION The Get-BogonList function retrieves the bogon prefix list maintained by Team Cymru. A bogon prefix is a route that should never appear in the Internet routing table. A packet routed over the public Internet (not including o...
combined_dataset/train/non-malicious/sample_44_94.ps1
sample_44_94.ps1
// // show all meshes in the scene by setting Hidden=false // var c = document.elements.elementCount; for (var i = 0; i < c; i++) { var element = document.elements.getElement(i); if (element.typeId == "Microsoft.VisualStudio.3D.Mesh") { element.getTrait("Hidden").value = false; } } /...
combined_dataset/train/non-malicious/sample_13_2.ps1
sample_13_2.ps1
#region 'Old Code' <# if ($OSVersion.Major -eq 5) { # Disabling running on Win2K3 x64 due some reports of crashes for specific controllers "[San.exe] - Skipping running san.exe on Windows prior to Server 2008" | WriteTo-StdOut } else { Import-LocalizedData -BindingVariable SanStorageInfoStrings Write-Diag...
combined_dataset/train/non-malicious/sample_1_43.ps1
sample_1_43.ps1
# Name tss_FindUserBadPwdAttempts.ps1 <# .SYNOPSIS Script to find sAMAccountName, pwdLastSet, lockoutTime, DC, lastLogon, logonCount, badPwdCount, badPasswordTime for a username. .DESCRIPTION Script to assist in troubleshooting accounts experiencing bad password attempts. It can also be used to investiga...
combined_dataset/train/non-malicious/sample_16_61.ps1
sample_16_61.ps1
ConvertFrom-StringData @' IPAddressDisplayNameFormat=IP-адрес: {0} NetworkNameDisplayNameFormat=Имя: {0} NetworkNameOfflineDisplayNameFormat=IP-адрес: адрес в сети "{0}" CreateClusterProgressValidationStart=Проверяется пригодность серверов для отказоустойчивого кластера. CreateClusterProgressValidationEnd=Пригодно...
combined_dataset/train/non-malicious/sample_8_15.ps1
sample_8_15.ps1
ConvertFrom-StringData @' id_sccm_activity_iisvdirinfo=Gathering IIS Virtual Directories Information id_sccm_iisvdirinfo_vdir=Obtaining a list of IIS Virtual Directories '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYC...
combined_dataset/train/non-malicious/2602.ps1
2602.ps1
function Measure-SQLExecution{ param($instancename ,$databasename = 'tempdb' ,[Parameter(ParameterSetName = 'SQLCmd',Mandatory=$true)]$sqlcmd ,[Parameter(ParameterSetName = 'SQLScript',Mandatory=$true)]$sqlscript) $output = New-Object System.Object $errval = $null $output | Add...
combined_dataset/train/non-malicious/1037.ps1
1037.ps1
[CmdletBinding()] param( [string[]] $Path, [Parameter()] [string[]] $Test, [Switch] $Recurse, [Switch] $PassThru ) Set-StrictMode -Version 'Latest' $prependFormats = @( (Join-Path -Path $PSScriptRoot -ChildPath 'System.Management.Automation....
combined_dataset/train/non-malicious/3883.ps1
3883.ps1
function Test-SearchGetSearchResultsAndUpdate { $rgname = "mms-eus" $wsname = "188087e4-5850-4d8b-9d08-3e5b448eaecd" $top = 5 $searchResult = Get-AzOperationalInsightsSearchResults -ResourceGroupName $rgname -WorkspaceName $wsname -Top $top -Query "*" Assert-NotNull $searchResult Assert-No...
combined_dataset/train/non-malicious/sample_58_81.ps1
sample_58_81.ps1
# # Module manifest for module 'OCI.PSModules.Loggingingestion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported...
combined_dataset/train/non-malicious/sample_55_29.ps1
sample_55_29.ps1
# # Module manifest for module 'OCI.PSModules.Osmanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osmanagement.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/Check Service on Servers.ps1
Check Service on Servers.ps1
<# Author: Matt Schmitt Date: 11/29/12 Version: 1.0 From: USA Email: ithink2020@gmail.com Website: http://about.me/schmittmatt Twitter: @MatthewASchmitt Description A script for checking the status of a service on a group of servers, from a list in a file. #> $...
combined_dataset/train/non-malicious/sample_35_39.ps1
sample_35_39.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.MonitorWorkspace.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module]::Instance # Export nothing to...
combined_dataset/train/non-malicious/sample_6_37.ps1
sample_6_37.ps1
#************************************************ # DC_RDG-Component.ps1 # Version 1.0 # Date: 2009 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about RDG. # Called from: Main Networking Diag #******************************************************* Trap [Exception] { ...
combined_dataset/train/non-malicious/sample_59_29.ps1
sample_59_29.ps1
# # Module manifest for module 'OCI.PSModules.Onesubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported P...
combined_dataset/train/non-malicious/sample_2_37.ps1
sample_2_37.ps1
<# .SYNOPSIS DEV Components and Scenarios module for learning and demoing TSS Framework usage. This is NOT related to any specific POD and not designed for learning and troubleshooting. .DESCRIPTION DEV Components and Scenarios module for learning and demoing TSS Framework usage. This is NOT related...
combined_dataset/train/non-malicious/1688.ps1
1688.ps1
$a1 = New-Object System.Collections.ArrayList $a2 = New-Object System.Collections.ArrayList $a3 = New-Object System.Collections.ArrayList $a4 = New-Object System.Collections.ArrayList 1..100 | % { $null = $a1.Add( (Measure-Command { $null = $(1..100) }).Ticks ) $null = $a2.Add...
combined_dataset/train/non-malicious/Issue-PendingRequest_1.ps1
Issue-PendingRequest_1.ps1
##################################################################### # Issue certificate.ps1 # Version 1.0 # # Issues certificate request from a pending request # # For this function to succeed, the certificate request must be pending # # Vadims Podans (c) 2010 # http://en-us.sysadmins.lv/ ##################...
combined_dataset/train/non-malicious/Set-IPConfigv2.ps1
Set-IPConfigv2.ps1
# script parameters param( [string[]] $Computers = $env:computername, [switch] $ChangeSettings, [switch] $EnableDHCP, [switch] $Batch ) $nl = [Environment]::NewLine # check for Admin rights if ($ChangeSettings -or $EnableDHCP){ If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdenti...
combined_dataset/train/non-malicious/sample_50_65.ps1
sample_50_65.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/Set-Domain_7.ps1
Set-Domain_7.ps1
function Set-Domain { param( [switch]$help, [string]$domain=$(read-host "Please specify the domain to join"), [System.Management.Automation.PSCredential]$credential = $(Get-Crdential) ) $usage = "`$cred = get-credential `n" $usage += "Set-Domain -domain MyDomain -credential `$cred`n" if ($help...
combined_dataset/train/non-malicious/sample_49_11.ps1
sample_49_11.ps1
"use strict"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. Object.defineProperty(exports, "__esModule", { value: true }); exports.Debug = void 0; const switch_1 = require("../switch"); class Debug extends switch_1.Switch { switch = 'debug'; } exports.Debug = Debug; //# sourceMappingURL...
combined_dataset/train/non-malicious/Inovke command exclusive.ps1
Inovke command exclusive.ps1
function Invoke-CommandEx { param ( [String] $MutexName = $(throw "Name is required."), [ScriptBlock] $Scriptblock = $(throw "Scriptblock is required."), [Object[]] $ArgumentList ) $MutexWasCreated = $false; $Mutex = $null; Write-Host "Waiting to acquire lock [$MutexName]..." -f Cyan [System.Ref...
combined_dataset/train/non-malicious/sample_44_53.ps1
sample_44_53.ps1
# # Module manifest for module 'OCI.PSModules.Ocvp' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ocvp.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/sample_47_54.ps1
sample_47_54.ps1
function Invoke-TestRunnerService { param ( [Parameter(Mandatory = $false)] [string]$FileName = '', [Parameter(Mandatory = $false)] [int]$SelectionStart = 0, [Parameter(Mandatory = $false)] [switch]$Init ) $Credential = Get-ALTestRunnerCredentia...
combined_dataset/train/non-malicious/3108.ps1
3108.ps1
function Get-ConsoleColor { [CmdletBinding()] param( ) Begin{ } Process{ $Colors = [Enum]::GetValues([ConsoleColor]) foreach($Color in $Colors) { [pscustomobject] @{ ConsoleColor = $Color } } } ...
combined_dataset/train/non-malicious/sample_55_63.ps1
sample_55_63.ps1
<# .SYNOPSIS Modern Standby Performance Assessment .DESCRIPTION Automates Modern Standby power transitions and measures entry/exit latency metrics .PARAMETER iterations Number of Modern Standby transitions to automate .PARAMETER sleeptimeout_sec Duration in seconds of the Modern Standby session .PARAM...
combined_dataset/train/non-malicious/sample_49_9.ps1
sample_49_9.ps1
param( [String] $InstallPath = "$($HOME)\Downloads", [String] $projPath ) $ErrorActionPreference = "Stop" $Stopwatch = [System.Diagnostics.Stopwatch]::new() function ElegantExit([String]$Result) { if (![string]::IsNullOrEmpty($Result)) { & "$($PSScriptRoot)/sendMetrics.ps1" -...
combined_dataset/train/non-malicious/Impersonation 1.1.ps1
Impersonation 1.1.ps1
# Version History # 1.1 - Added aliases, error handling, help, and cleanup $MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = { while($script:ImpContextStack.Count) { Pop-ImpersonationContext } } $script:UserToysClass = Add-Type -Namespace Huddled -Name UserToys -MemberDefinition @" // http://msdn....
combined_dataset/train/non-malicious/foreach-withexception_1.ps1
foreach-withexception_1.ps1
function foreach-withexception ([scriptblock]$process,$outputexception) { begin { $global:foreachex = @() } process { try { $local:inputitem = $_ &$process } catch { $local:exceptionitem = 1 | select-object...
combined_dataset/train/non-malicious/PowerBot _2.0.ps1
PowerBot _2.0.ps1
## PowerBot 2.0 ## A simple framework to get you started writing your own IRC bots in PowerShell #################################################################################################### ## Requires Meebey.SmartIrc4net.dll to be in your ...\\WindowsPowerShell\\Libraries\\ ## You can get Meebey.SmartIrc4n...
combined_dataset/train/non-malicious/sample_40_70.ps1
sample_40_70.ps1
<# # .DESCRIPTION # Run powershell scripts using scheduled task. # # .PARAMETER taskName # The task name. # # .PARAMETER script # The inlined script to execute on remote machine. # #> $ScriptFile = Join-Path -Path $env:LocalAppData -ChildPath "$taskName.ps1" $ResultFile = Join-Path -Path $env:...
combined_dataset/train/non-malicious/3413.ps1
3413.ps1
function Test-GetWebAppSlot { $rgname = Get-ResourceGroupName $appname = Get-WebsiteName $slotname1 = "staging" $slotname2 = "testing" $location = Get-Location $planName = Get-WebHostPlanName $tier = "Standard" $apiversion = "2015-08-01" $resourceType = "Microsoft.Web/sites" try { New-...
combined_dataset/train/non-malicious/331.ps1
331.ps1
function Set-PSFScriptblock { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory = $true)] [string] $Name, [Parameter(Position = 1, Mandatory = $true)] [System.Management.Automation.ScriptBl...
combined_dataset/train/non-malicious/304.ps1
304.ps1
function Set-PSFDynamicContentObject { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] [OutputType([PSFramework.Utility.DynamicContentObject])] [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Set-PSFDynamicContentObject')] ...
combined_dataset/train/non-malicious/sample_45_75.ps1
sample_45_75.ps1
# # Module manifest for module 'OCI.PSModules.Sch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Sch.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_41_96.ps1
sample_41_96.ps1
/////////////////////////////////////////////////////////////////////////////// // Helper to set a designer prop /////////////////////////////////////////////////////////////////////////////// function setDesignerProp(tname, ttype, tvalue) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)...
combined_dataset/train/non-malicious/1607.ps1
1607.ps1
$a1 = New-Object System.Collections.ArrayList $a2 = New-Object System.Collections.ArrayList $a3 = New-Object System.Collections.ArrayList $a4 = New-Object System.Collections.ArrayList $a5 = New-Object System.Collections.ArrayList $a6 = New-Object System.Collections.ArrayList $a7 = New-Object System.Collections.Arr...
combined_dataset/train/non-malicious/sudo for Powershell_4.ps1
sudo for Powershell_4.ps1
## sudo.ps1 # # Authors: rbellamy, pezhore, mrigns, This guy: http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell, # other powershell peoples # # Sources: # http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell # http://www.ainotenshi.org/%E2%80%98sud...
combined_dataset/train/non-malicious/sample_36_16.ps1
sample_36_16.ps1
# # Module manifest for module 'OCI.PSModules.Computecloudatcustomer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Computecloudatcustomer.dll' # Version number of this module. ModuleVersion = '83.1.0' ...
combined_dataset/train/non-malicious/Get-Environment.ps1
Get-Environment.ps1
Param($srv=$env:ComputerName) $regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine,$Srv) $key = $regKey.OpenSubkey("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment",$false) $key.GetValueNames() | Select-Object @{n="ValueName";e={$_}},@{n="Value";e={...
combined_dataset/train/non-malicious/out-playlist.ps1
out-playlist.ps1
param( [parameter(Mandatory=$true)] [string] $name, [parameter(Mandatory=$true,ValueFromPipeline=$true)] $file ) begin { $script:files = @(); } process { $script:files += $file.fullname; } end { $count = $script:files.length; $mediaElements = $script:files | foreach{ "<media src='$...
combined_dataset/train/non-malicious/sample_5_67.ps1
sample_5_67.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 = '93.0.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/3456.ps1
3456.ps1
function Test-Dataset { $dfname = Get-DataFactoryName $rgname = Get-ResourceGroupName $rglocation = Get-ProviderLocation ResourceManagement $dflocation = Get-ProviderLocation DataFactoryManagement New-AzResourceGroup -Name $rgname -Location $rglocation -Force try { ...
combined_dataset/train/non-malicious/1871.ps1
1871.ps1
Describe "Write-Debug tests" -Tags "CI" { It "Should not have added line breaks" { $text = "0123456789" while ($text.Length -lt [Console]::WindowWidth) { $text += $text } $origDebugPref = $DebugPreference $DebugPreference = "Continue" try { $...
combined_dataset/train/non-malicious/sample_66_97.ps1
sample_66_97.ps1
# Import the helper functions Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [parameter(Mandatory = $true)] [System.String] $Category ) #Write-Verbose "Use this cmdlet t...
combined_dataset/train/non-malicious/sample_44_62.ps1
sample_44_62.ps1
Set-Variable BACKGROUNDAPPUPDATE_TIMEOUT_SECONDS -option Constant -value 1800 Set-Variable PHASE2_TIMEOUT_SECONDS -option Constant -value 60 Set-Variable APPINSTALL_WINDOW_SECONDS -Option Constant -Value 60 Set-Variable SKYPE_PROCESS_NAME -option Constant -value "Microsoft.SkypeRoomSystem" Set-Variable WATCHDOG_PRO...
combined_dataset/train/non-malicious/Backup-ModifiedGPOsv_1.1.ps1
Backup-ModifiedGPOsv_1.1.ps1
###########################################################################" # # NAME: Backup-ModifiedGPOs.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # # COMMENT: All Group Policy Objects modified in the specified timespan are backup up to the specified backup path. # For more d...
combined_dataset/train/non-malicious/ef87bae5-0285-4381-94e0-6da00a3d4525.ps1
ef87bae5-0285-4381-94e0-6da00a3d4525.ps1
while($cell.value2.length -ge 0) { $name = $cell.value2 $sam = $cell.offset(0,1).value2 $givenName = $cell.offset(0,2).value2 $surName = $cell.offset(0,3).value2 $displayName = $cell.offset(0,4).value2 $password = $cell.offset(0, 5).value2 write-host "navn:" $name "`t`t,sam:" $sam "`t,GivenName...
combined_dataset/train/non-malicious/sample_12_10.ps1
sample_12_10.ps1
# # Module manifest for module 'OCI.PSModules.Blockchain' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Blockchain.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_66_92.ps1
sample_66_92.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 # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEE...
combined_dataset/train/non-malicious/sample_46_47.ps1
sample_46_47.ps1
# # Module manifest for module 'OCI.PSModules.Governancerulescontrolplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Governancerulescontrolplane.dll' # Version number of this module. ModuleVersion =...
combined_dataset/train/non-malicious/sample_45_23.ps1
sample_45_23.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/sample_44_13.ps1
sample_44_13.ps1
# # Module manifest for module 'OCI.PSModules.Servicecatalog' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicecatalog.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSE...
combined_dataset/train/non-malicious/sample_43_17.ps1
sample_43_17.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_0_31.ps1
sample_0_31.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/sample_62_96.ps1
sample_62_96.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # RemoveMDS.ps1 # Kill all Monitoring processes and clean up tra...
combined_dataset/train/non-malicious/sample_31_67.ps1
sample_31_67.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 = '80.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_12_97.ps1
sample_12_97.ps1
# # # Rule to look for organizations that are newer than the deployment # # Created: 5/24/2012 # Author: Jonathan Randall #****************************************************************************************************************** #region Functions function GetOrganizationData([string] $conn_string) ...
combined_dataset/train/non-malicious/DefaultParameterValues.ps1
DefaultParameterValues.ps1
#requires -Version 3.0 function Join-Hashtable { param( [Hashtable]$First, [Hashtable]$Second, [Switch]$Force ) $Firsts = $First.Keys $Output = @{} + $First foreach($key in $Second.Keys) { if($Firsts -notcontains $Key) { $Output.$Key = $Second.$Key } elseif($Force...
combined_dataset/train/non-malicious/sample_24_55.ps1
sample_24_55.ps1
function Connect-VirtuaNetworkSubnet { <# .SYNOPSIS Link Subnet .DESCRIPTION This script is used to Link the subnet to the Route Table .ROLE Administrators #> Param ( [Parameter(Mandatory = $True)] [ValidateNotNullOrEmpty()] [string] $uri, [Parameter(Mandatory = $true)] [V...
combined_dataset/train/non-malicious/User Obj ProxyAddresses.ps1
User Obj ProxyAddresses.ps1
Function Get-Proxy() { Process { $objDomain = New-Object System.DirectoryServices.DirectoryEntry $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.PageSize = 1000 $objSearcher.Filter = "(cn=$_)" $objSearcher.SearchScope = "Subtree" $objUser ...
combined_dataset/train/non-malicious/sample_2_98.ps1
sample_2_98.ps1
# You may use this code and information and create derivative works of it, # provided that the following conditions are met: # 1. This code and information and any derivative works may only be used for # troubleshooting a) Windows and b) products for Windows, in either case using # the Windows Troubleshooting Platf...
combined_dataset/train/non-malicious/CSV-DVS.ps1
CSV-DVS.ps1
$vmlist = Import-Csv toolboxesx.csv #vsphere settings $vsphere_server = "" $cluster_name = "" #dvSwitch Names to connect each side to $prod_net = "" $aux_net = "" #Networks to temporarally add the vmxnet3 nics to before connecting to dvSwitch $prod_temp_net = "" $aux_temp_net = "" #Folder to add VM's ...
combined_dataset/train/non-malicious/sample_62_24.ps1
sample_62_24.ps1
layout modernObjectSelectionToolOptions { constant: // These are the same values as the SelectionMode enum smReplace: 0; smAdd: 1; smSubtract: 2; smRefine: 3; interface: view modern_object_selection_tool_options( name : '$$$/private/AutoMaskingTool/ToolOptio...
combined_dataset/train/non-malicious/sample_66_35.ps1
sample_66_35.ps1
Get-Module | ForEach-Object { Remove-Module -Name $_.Name -Force } $PSModuleAutoloadingPreference = 'none' Import-Module Microsoft.PowerShell.Utility #Enforcing default PSModulePath to avoid getting unexpected modules to run instead of built-in modules $env:PSModulePath = "C:\Program Files\WindowsPowerShell\Modules...
combined_dataset/train/non-malicious/Get-NestedGroups v_1.ps1
Get-NestedGroups v_1.ps1
Function Global:Get-NestedGroups { <# .SYNOPSIS Enumerate all AD group memberships of an account (including nested membership). .DESCRIPTION This script will return the AD group objects for each group the user is a member of. .PARAMETER UserName The username whose group memberships to find. .E...
combined_dataset/train/non-malicious/Import-Delimited.ps1
Import-Delimited.ps1
################################################################################ ## Convert-Delimiter - A function to convert between different delimiters. ## E.g.: commas to tabs, tabs to spaces, spaces to commas, etc. ################################################################################ ## Written pri...
combined_dataset/train/non-malicious/2506.ps1
2506.ps1
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") | Out-Null [System.Reflection.Assembly]::LoadWit...
combined_dataset/train/non-malicious/3112.ps1
3112.ps1
function Get-RandomPassword { [CmdletBinding(DefaultParameterSetName='NoClipboard')] param( [Parameter( Position=0, HelpMessage='Length of the Password (Default=8)')] [ValidateScript({ if($_ -eq 0) { throw "Length of the password can not be 0!" } else { return $true } ...
combined_dataset/train/non-malicious/sample_42_54.ps1
sample_42_54.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/map network drive.ps1
map network drive.ps1
# map2_gps_prod.ps1 # Maps a network drive using PowerShell # # # # $Drive = "O:" $UNC = "\\\\ampwcsqlsvr2\\nam401k" cls # if the drive exists just remove it if (((New-Object -Com WScript.Network).EnumNetworkDrives() | Where-Object ` {$_ -eq $Drive})) { # true remove drive # Create the C...
combined_dataset/train/non-malicious/4334.ps1
4334.ps1
function ValidateAndSet-PATHVariableIfUserAccepts { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [string] $Scope, [Parameter(Mandatory=$true)] [string] $ScopePath, [Parameter()] [Switch] $NoPathUpdate, [Parameter()]...
combined_dataset/train/non-malicious/393.ps1
393.ps1
$global:BannedCommands = @( 'Write-Host', 'Write-Verbose', 'Write-Warning', 'Write-Error', 'Write-Output', 'Write-Information', 'Write-Debug' ) $global:MayContainCommand = @{ "Write-Host" = @('Write-PSFHostColor.ps1') "Write-Verbose" = @() "Write-Warning" = @() "Write-Error" = @('Invoke-PSFCommand.ps1',...
combined_dataset/train/non-malicious/sample_15_61.ps1
sample_15_61.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" AliasesTo...
combined_dataset/train/non-malicious/4145.ps1
4145.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()][string]$ReferenceTS = '\\DeploymentShare\Control\WIN10REF\ts.xml', [ValidateNotNullOrEmpty()][string]$ProductionTS = '\\DeploymentShareTST\Control\WINDOWS10PROD\ts.xml', [string]$ARPExclusionsFile = "\\InstalledApplications\ARPExclusions.txt", [string]$TSExclusi...
combined_dataset/train/non-malicious/Convert-PowerPack2Ps_2.ps1
Convert-PowerPack2Ps_2.ps1
####################################################################### # Convert-PowerPack2Ps1 # # Converts PowerGUI .PowerPack files to ps1 PowerShell script library # v1 - raw conversion, no name changes, only script elements converted ###################################################################### # E...
combined_dataset/train/non-malicious/sample_6_59.ps1
sample_6_59.ps1
# # Module manifest for module 'OCI.PSModules.Optimizer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Optimizer.dll' # Version number of this module. ModuleVersion = '93.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/New-GenericType.ps1
New-GenericType.ps1
## New-GenericObject.ps1 ## Creates an object of a generic type: ## ## Usage: ## ## # Simple generic collection ## $list = New-GenericObject System.Collections.ObjectModel.Collection System.Int32 ## ## # Generic dictionary with two types ## New-GenericObject System.Collections.Generic.Dictionary System...
combined_dataset/train/non-malicious/Set Logfile length_2.ps1
Set Logfile length_2.ps1
################################################################################ # Set-FileLines.ps1 (V 1003) # This script will maintain the PS Transcript file (default setting), or any # text file, at a fixed length, ie matching the number of lines entered. # However, setting no lines will just remove any blank ...
combined_dataset/train/non-malicious/sample_12_84.ps1
sample_12_84.ps1
#************************************************ # TS_2K3PoolUsageMaximum.ps1 # Version 1.0.1 # Date: 5/8/2012 # Author: v-kaw # Description: [Idea ID 2446] [Windows] Determining the trimming threshold set by the Memory Manager # Rule number: 2446 # Rule URL: //sharepoint/sites/rules/Rule%20Submissions/Forms...
combined_dataset/train/non-malicious/2240.ps1
2240.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server name with SMS Provider installed")] [string]$SiteServer, [parameter(Mandatory=$true, HelpMessage="Path to where the Driver Source root directory is located")] [ValidatePattern("^\\\\\w+\\\w+")] ...
combined_dataset/train/non-malicious/sample_26_24.ps1
sample_26_24.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/sample_27_49.ps1
sample_27_49.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/329.ps1
329.ps1
function Import-PSFPowerShellDataFile { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingInvokeExpression", "")] [CmdletBinding()] Param ( [Parameter(ParameterSetName = 'ByPath')] [string[]] $Path, [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'ByLiteralPath')] [...
combined_dataset/train/non-malicious/Backup-DatabaseObject.ps1
Backup-DatabaseObject.ps1
add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" add-type -AssemblyName "Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" add-type -AssemblyName "Microsoft.SqlServer.SMOExtended, Version=10.0.0.0...
combined_dataset/train/non-malicious/sample_10_17.ps1
sample_10_17.ps1
#************************************************ # Function.ps1 # Version 1.0.0 # Date: 03-01-2012 # Author: Wilson Souza - wsouza@microsoft.com # Description: This script contains functions used by others ps1 files #************************************************ Import-LocalizedData -BindingVariable ScriptSt...
combined_dataset/train/non-malicious/193.ps1
193.ps1
function Set-PowerShellWindowTitle { PARAM($Title) $Host.UI.RawUI.WindowTitle = $Title }
combined_dataset/train/non-malicious/sample_50_55.ps1
sample_50_55.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 = '83.1.0' # Supported PSEditions Compatible...