full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/New-RandomPassword.ps1
New-RandomPassword.ps1
function New-RandomPassword { [CmdletBinding()] param( [Int16] $Length = 6, [Int16] $NumberOfNonAlphaNumericCharacters = 3, [Switch] $AsSecureString ) Begin { try { # Load required assembly. $assem = [System.Reflection.Assembly]::LoadWithPartialName('System.Web') } catch { th...
combined_dataset/train/non-malicious/PowerWatin 0.1.ps1
PowerWatin 0.1.ps1
## CHANGE this to point to your WatiN.Core.dll $WatinPath = Convert-Path (Resolve-Path "$(Split-Path $Profile)\\Libraries\\Watin2\\WatiN.Core.dll") ## Load the assembly $global:watin = [Reflection.Assembly]::LoadFrom( $WatinPath ) ## initialize the global "Find" functions ... Function Start-Watin { Param([WatiN...
combined_dataset/train/non-malicious/sample_41_63.ps1
sample_41_63.ps1
# # Module manifest for module 'OCI.PSModules.Loganalytics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loganalytics.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/play-note(s).ps1
play-note(s).ps1
function Play-Notes { $defaultduration = 5;if($args[0] -is [int]) {$defaultduration = $args[0]} for($i = 0;$i -lt $args.length;$i++) { $duration = $defaultduration if ($i -lt $args.length-1) { if ($args[$i+1] -is [int]) {$duration = $args[$i+1] } } if ($args[$i] -is [string]) { play-note $args[$...
combined_dataset/train/non-malicious/2639.ps1
2639.ps1
param([string] $ServerInstance) $smosrv = New-Object Microsoft.SqlServer.Management.Smo.Server $ServerInstance $jobs = @('BackupDBs-FULL','BackupDBs-LOGS') foreach($job in $jobs){ $j = New-Object Microsoft.SqlServer.Management.Smo.Agent.Job ($smosrv.JobServer,$job) $jstep = new-object Microsoft.SqlServer.Man...
combined_dataset/train/non-malicious/2421.ps1
2421.ps1
[CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [string]$ApplicationName, [string]$PackageName, [switch]$SkipRequirements, [switch]$DistributeContent, [switch]$OsdFriendlyPowershellSyntax, [array]$AdditionalOptions = @(@{'Package' = @{ 'PkgFlag...
combined_dataset/train/non-malicious/2464.ps1
2464.ps1
function Get-FunctionDefaultParameter { [CmdletBinding()] [OutputType([hashtable])] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$FunctionName ) try { $ast = (Get-Command $FunctionName).ScriptBlock.Ast $select = @{ n = 'Name'; e = { $_.Name.VariablePath.UserPath } }, @{ n =...
combined_dataset/train/non-malicious/664.ps1
664.ps1
Describe "Set-RsDatsSetReference" { Context "Set-RsDatsSetReference with minimun parameters"{ $folderName = 'SutSetRsDataSetReferenceMinParameters' + [guid]::NewGuid() New-RsFolder -Path / -FolderName $folderName $folderPath = '/' + $folderName $localResourcesPath = (Get-Item -...
combined_dataset/train/non-malicious/sample_12_92.ps1
sample_12_92.ps1
#************************************************ # TS_ClusterValidationTests.ps1 # Version 1.0.1 # Date: 07-24-2009 # Author: Andre Teixeira - andret@microsoft.com # Hacked by Jacques Boulet - jaboulet@microsoft.com - 2019-02-21 # Description: This script is used to obtain cluster validation report. # ...
combined_dataset/train/non-malicious/4066.ps1
4066.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()] [string]$LogFile = 'LogonReport.csv' ) $Entries = @() $IPv4 = foreach ($ip in (ipconfig) -like '*IPv4*') {($ip -split ' : ')[-1]} $DT = Get-Date foreach ($IP in $IPv4) { $object = New-Object -TypeName System.Management.Automation.PSObject $object | Add-Member -...
combined_dataset/train/non-malicious/sample_58_60.ps1
sample_58_60.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# PowerShell Diagnostics Module This module contains a set of wrapper scripts that enable a user to use ETW tracing in Windows PowerShell. #> $script:Logman="$env:windir\system32\logman.exe" $script:wsmanlogfile = "$env:wind...
combined_dataset/train/non-malicious/remote helpdesk script.ps1
remote helpdesk script.ps1
Add-PSSnapin quest.activeroles.admanagement $cred = Get-Credential $conn = connect-QADService -service 'x.x.x.x' -credential $cred #region Script Settings #<ScriptSettings xmlns="http://tempuri.org/ScriptSettings.xsd"> # <ScriptPackager> # <process>powershell.exe</process> # <arguments /> # <extract...
combined_dataset/train/non-malicious/sample_18_59.ps1
sample_18_59.ps1
# *********************************************************************************************** # Version 1.0 # Date: 02-17-2012 -- Last edit: 2022-06-01 # Author: Vinay Pamnani - vinpa@microsoft.com # Description: Utility Script to load common functions. # 1. Defines commonly used functions in the Troublesho...
combined_dataset/train/non-malicious/3455.ps1
3455.ps1
function Get-ResourceGroupName { return getAssetName } function Get-DataFactoryName { return getAssetName } function Get-ProviderLocation($provider) { "West Europe" } function CleanUp($rgname, $dfname) { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsof...
combined_dataset/train/non-malicious/List AD Users CSV_1.ps1
List AD Users CSV_1.ps1
$NumDays = 0 $LogDir = ".\\User-Accounts.csv" $currentDate = [System.DateTime]::Now $currentDateUtc = $currentDate.ToUniversalTime() $lltstamplimit = $currentDateUtc.AddDays(- $NumDays) $lltIntLimit = $lltstampLimit.ToFileTime() $adobjroot = [adsi]'' $objstalesearcher = New-Object System.DirectoryServices.Dire...
combined_dataset/train/non-malicious/sample_32_50.ps1
sample_32_50.ps1
@{ GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" FunctionsToExport = @() CmdletsToExport = "Get-Acl", "Set-Acl", "G...
combined_dataset/train/non-malicious/2439.ps1
2439.ps1
[CmdletBinding()] [OutputType('System.Management.Automation.PSCustomObject')] param ( [Parameter(Mandatory)] [string]$DnsZone, [Parameter()] [switch]$CheckValidity, [Parameter()] [string]$DnsServer = (Get-ADDomain).ReplicaDirectoryServers[0], [Parameter()] [int]$WarningDays = 1, [string]$EmailAddress, [Pa...
combined_dataset/train/non-malicious/Out-DataTable_7.ps1
Out-DataTable_7.ps1
####################### function Get-Type { param($type) $types = @( 'System.Boolean', 'System.Byte[]', 'System.Byte', 'System.Char', 'System.Datetime', 'System.Decimal', 'System.Double', 'System.Guid', 'System.Int16', 'System.Int32', 'System.Int64', 'System.Single', 'System.UInt16', 'System.UIn...
combined_dataset/train/non-malicious/sample_65_22.ps1
sample_65_22.ps1
"use strict"; /* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, selec...
combined_dataset/train/non-malicious/3245.ps1
3245.ps1
class CommandAuthorizationResult { [bool]$Authorized [string]$Message CommandAuthorizationResult() { $this.Authorized = $true } CommandAuthorizationResult([bool]$Authorized) { $this.Authorized = $Authorized } CommandAuthorizationResult([bool]$Authorized, [string]$Message)...
combined_dataset/train/non-malicious/3471.ps1
3471.ps1
function EventHubsTests { $location = Get-Location $resourceGroupName = getAssetName "RSG" $namespaceName = getAssetName "Eventhub-Namespace-" $eventHubName = getAssetName "EventHub-" $eventHubName2 = getAssetName "EventHub-" Write-Debug "Create resource group" Write-Debug " Resource Gro...
combined_dataset/train/non-malicious/Resolve-Aliases.ps1
Resolve-Aliases.ps1
#requires -version 2.0 ## Resolve-Aliases Module ######################################################################################################################## ## Sample Use: ## Resolve-Aliases Script.ps1 | Set-Content Script.Resolved.ps1 ## ls *.ps1 | Resolve-Aliases -Inplace ###################...
combined_dataset/train/non-malicious/sample_27_9.ps1
sample_27_9.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 = '79.0.0' # Supported P...
combined_dataset/train/non-malicious/2566.ps1
2566.ps1
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null; $smoObj = [Microsoft.SqlServer.Management.Smo.SmoApplication]; $sql = $smoObj::EnumAvailableSqlServers($false); $xl = New-Object -ComObject Excel.Application; $xl.Visible = $true; $xl = $xl.Workbooks.Add(); $Sheet = $xl.Works...
combined_dataset/train/non-malicious/766.ps1
766.ps1
$fields = @( New-Object "System.Management.Automation.Host.FieldDescription" "Input" New-Object "System.Management.Automation.Host.FieldDescription" "Input List" ) $fields[1].SetParameterType([int[]]) $host.UI.Prompt("Caption", "Message", $fields) Get-Credential Get-Credential -Message "Test!" Get-Credentia...
combined_dataset/train/non-malicious/sample_41_21.ps1
sample_41_21.ps1
# # Module manifest for module 'OCI.PSModules.Databasemanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasemanagement.dll' # Version number of this module. ModuleVersion = '77.0.0' # Suppo...
combined_dataset/train/non-malicious/sample_14_88.ps1
sample_14_88.ps1
#************************************************ # TS_UnableToAddNetworkPrintersErrorCheck.ps1 # Version 1.0.1 # Date: 7/19/2013 # Author: v-kaw # Description: [KSE Rule] [ Windows V3] Presence of lots of folders inside \spool\prtprocs\ causes failure to install print queues # Rule number: d4047602-196c-443f-9...
combined_dataset/train/non-malicious/sample_19_70.ps1
sample_19_70.ps1
### # ==++== # # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
combined_dataset/train/non-malicious/1418.ps1
1418.ps1
function Test-CSslCertificateBinding { [CmdletBinding()] param( [IPAddress] $IPAddress, [Uint16] $Port ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $ge...
combined_dataset/train/non-malicious/3830.ps1
3830.ps1
function HybridConnectionsTests { $location = "West US" $resourceGroupName = getAssetName $namespaceName = getAssetName "Relay-NS" $HybridConnectionsName = getAssetName "Relay-NS" Write-Debug "Create resource group" Write-Debug " Resource Group Name : $resourceGroupName" New-AzResourceGro...
combined_dataset/train/non-malicious/1595.ps1
1595.ps1
function Write-Object { param ( [Parameter( ValueFromPipeline=$True, ValueFromPipelinebyPropertyName=$True)] [object[]]$Object, [string]$Header, [string]$Footer ) if ($input) { $Object = @($input) } if (!$Object) { ...
combined_dataset/train/non-malicious/sample_38_38.ps1
sample_38_38.ps1
ConvertFrom-StringData @' ###PSLOC ErrNoStorageSubsystemFound = No clustered storage subsystem found. Please make sure this command is running on a Failover Cluster node. RemMultipleStoragePoolFound = More than one non-primordial storage pool found. Please check your storage pool configuraion and remove any non-prim...
combined_dataset/train/non-malicious/2093.ps1
2093.ps1
Describe "Test constrained language mode" -Tags "CI" { It "dynamic invocation on non-PowerShell thread should work" { $refAssemblies = @() if (!$IsCoreCLR) { $refAssemblies += "Microsoft.CSharp" } $t,$null = Add-Type -ReferencedAssemblies $refAssemblies -WarningAction...
combined_dataset/train/non-malicious/sample_26_16.ps1
sample_26_16.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> Import-Module $PSScriptRoot\RoleHelpers.psm1 [S...
combined_dataset/train/non-malicious/640.ps1
640.ps1
nal -Name gpc -Value "Get-PPConfiguration" -ErrorAction SilentlyContinue nal -Name grc -Value "Get-RemoteConnection" -ErrorAction SilentlyContinue nal -Name crdp -Value "Connect-RDP" -ErrorAction SilentlyContinue nal -Name crps -Value "Connect-PSS" -ErrorAction SilentlyContinue nal -Name chttp -Value "Connect-Http" ...
combined_dataset/train/non-malicious/3258.ps1
3258.ps1
class Bot : BaseLogger { [string]$Name [Backend]$Backend hidden [string]$_PoshBotDir [StorageProvider]$Storage [PluginManager]$PluginManager [RoleManager]$RoleManager [CommandExecutor]$Executor [Scheduler]$Scheduler [System.Collections.Queue]$MessageQueue = (...
combined_dataset/train/non-malicious/3596.ps1
3596.ps1
function Get-AzureRmSecurityTask-SubscriptionScope { $tasks = Get-AzSecurityTask Validate-Tasks $tasks } function Get-AzureRmSecurityTask-ResourceGroupScope { $rgName = Get-TestResourceGroupName $tasks = Get-AzSecurityTask -ResourceGroupName $rgName Validate-Tasks $tasks } function Get-Az...
combined_dataset/train/non-malicious/sample_21_42.ps1
sample_21_42.ps1
export function setControlAttribute(id, attrName, value) { const fieldElement = document.querySelector("#" + id)?.shadowRoot?.querySelector("#control"); if (!!fieldElement) { fieldElement?.setAttribute(attrName, value); } } export function setDataList(id, datalistid) { const fieldElem...
combined_dataset/train/non-malicious/1194.ps1
1194.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) function GivenANormalDirectory { $path = Join-Path -Path $TestDrive.FullName -ChildPath 'dir' New-Item -Path $path -ItemType 'Directory' } Describe 'Carbon.when getting normal directoryes' { $Global:Error.Clear()...
combined_dataset/train/non-malicious/sample_27_69.ps1
sample_27_69.ps1
$resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent # Import localization helper functions. $helperName = 'PowerShellGet.LocalizationHelper' $dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1" Import-Module -Name $...
combined_dataset/train/non-malicious/ConvertTo-Hex_8.ps1
ConvertTo-Hex_8.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/Add new smtp_set prmary_3.ps1
Add new smtp_set prmary_3.ps1
#alias,addnewemailaddress import-csv .\\source.csv | foreach { $user = Get-Mailbox $_.alias $user.emailAddresses+= $_.addnewemailaddress $user.primarysmtpaddress = $_.addnewemailaddress Set-Mailbox $user -emailAddresses $user.emailAddresses set-Mailbox $user -PrimarySmtpAddress $user.primarysmtpaddress }
combined_dataset/train/non-malicious/sample_50_82.ps1
sample_50_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\@babel+parser@7.23.9\node_modules\@babel\parser\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.p...
combined_dataset/train/non-malicious/Generate New Password.ps1
Generate New Password.ps1
function global:GET-NewPassword($PasswordLength, $Complexity) { <# .SYNOPSIS Generates a New password with varying length and Complexity, .DESCRIPTION Generate a New Password for a User. Defaults to 8 Characters with Moderate Complexity. Usage GET-NEWPASSWORD or GET-NEWPASSWORD $Length $Complexit...
combined_dataset/train/non-malicious/sample_63_81.ps1
sample_63_81.ps1
# # Module manifest for module 'OCI.PSModules.Analytics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Analytics.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/2368.ps1
2368.ps1
function New-IISWebBinding { [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$ComputerName, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$WebsiteName, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateSet('http', 'https')] [string]$P...
combined_dataset/train/non-malicious/Prompt Replacement.ps1
Prompt Replacement.ps1
function prompt { $mapped_drives = Get-WmiObject Win32_LogicalDisk -Filter "drivetype=4" | foreach {echo $_.deviceid} $local_drives = Get-WmiObject Win32_LogicalDisk -Filter "drivetype=3" | foreach {echo $_.deviceid} $removable_drives = Get-WmiObject Win32_LogicalDisk -Filter "drivetype=2" | foreach {ec...
combined_dataset/train/non-malicious/sample_27_78.ps1
sample_27_78.ps1
[CmdletBinding()] param ( [Parameter(Mandatory)] [string]$PullRequestNumber, [Parameter()] [string]$After="$((Get-Date).AddHours(-1))" ) Import-Module $(Join-Path $PSSCriptRoot Helpers.psm1) class PullRequestNumber { [int]$Number, [string]$MergeCommitSha, [b...
combined_dataset/train/non-malicious/2646.ps1
2646.ps1
Configuration SQLServer{ param([string[]] $ComputerName) Import-DscResource -Module cSQLResources Node $ComputerName { File DataDir{ DestinationPath = 'C:\DBFiles\Data' Type = 'Directory' Ensure = 'Present' } File LogDir{ Destinatio...
combined_dataset/train/non-malicious/2491.ps1
2491.ps1
[CmdletBinding()] param ( [Parameter(Mandatory = $True, ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)] [string]$Computername, [Parameter(Mandatory = $False, ValueFromPipeline = $False, ValueFromPipelineByPropertyName = $False)] [string]$ConfigMgrSite = 'UHP', [Parameter(Mandato...
combined_dataset/train/non-malicious/Test-FileLock_1.ps1
Test-FileLock_1.ps1
##################################################################### # Test-FileLock.ps1 # Version 1.0 # # test if file is locked by external program or not # # Vadims Podans (c) 2009 # http://www.sysadmins.lv/ ##################################################################### filter Test-FileLock { ...
combined_dataset/train/non-malicious/3341.ps1
3341.ps1
function Remove-Plugin { [PoshBot.BotCommand( Aliases = ('rp', 'removeplugin'), Permissions = 'manage-plugins' )] [cmdletbinding()] param( [parameter(Mandatory)] $Bot, [parameter(Mandatory, Position = 0)] [string]$Name, [parameter(Position ...
combined_dataset/train/non-malicious/sample_51_68.ps1
sample_51_68.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 = '79.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/1823.ps1
1823.ps1
Describe "Validate Copy-Item locally" -Tags "CI" { It "Copy-Item has non-terminating error if destination is in use" -Skip:(!$IsWindows) { Copy-Item -Path $env:windir\system32\cmd.exe -Destination TestDrive:\ $cmd = Start-Process -FilePath TestDrive:\cmd.exe -PassThru try { { ...
combined_dataset/train/non-malicious/sample_35_73.ps1
sample_35_73.ps1
'************************************************************* ' ' ADOBE SYSTEMS INCORPORATED ' Copyright 2005-2010 Adobe Systems Incorporated ' All Rights Reserved ' NOTICE: Adobe permits you to use, modify, and ' distribute this file in accordance with the terms ' of the Adobe license agreement accompa...
combined_dataset/train/non-malicious/sample_7_2.ps1
sample_7_2.ps1
# # Module manifest for module 'OCI.PSModules.Ocicontrolcenter' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ocicontrolcenter.dll' # Version number of this module. ModuleVersion = '93.0.0' # Supported...
combined_dataset/train/non-malicious/sample_4_19.ps1
sample_4_19.ps1
ConvertFrom-StringData @' id_rdsserverprogress=Gathering RDS Information: id_rdswmiget=Getting Win32_TerminalServiceSetting from WMI. id_rdswmigeterror=ERROR: WMI not working. unable to get Win32_TerminalServiceSetting. id_rdswmigetsolution=Please verify that WMI service running using wbemtest. id_rdsiis=Getting I...
combined_dataset/train/non-malicious/sample_67_74.ps1
sample_67_74.ps1
function EnsureAdminPrivileges([String]$mesageOnError) { $identity = [Security.Principal.WindowsIdentity]::GetCurrent() $principal = new-object Security.Principal.WindowsPrincipal $identity if (!($principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))) { Write-Error $m...
combined_dataset/train/non-malicious/sample_56_84.ps1
sample_56_84.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/sample_52_82.ps1
sample_52_82.ps1
ConvertFrom-StringData @' FailoverClustersModuleRequired=Необходимый модуль PowerShell (FailoverClusters) не найден. Используйте инструмент "Роли и компоненты", чтобы установить следующие элементы: средства удаленного администрирования сервера | Средства администрирования компонентов | Средства отказоустойчивой класте...
combined_dataset/train/non-malicious/sample_27_58.ps1
sample_27_58.ps1
param ( [Parameter(Mandatory = $true)] [string] $TargetPath, $prerelease, $alLanguageVersion ) Set-Variable LinterCopFileName -Option ReadOnly -Value "BusinessCentral.LinterCop.dll" -Scope "Script" $ErrorActionPreference = 'Stop' # Parameter $prerelease can be a string (true/false) or a boolean ($true...
combined_dataset/train/non-malicious/sample_12_35.ps1
sample_12_35.ps1
ConvertFrom-StringData @' id_ex2003_exchdumpact=Exchange Support Tool - ExchDump id_ex2003_exchdumpstat=Running ExchDump.exe to collect configuration information id_ex2003_exchdumpreportsection=Exchange Configuration Information id_ex2003_exchdumpfiledescription=Exchange Configuration Information '@ # SIG # Beg...
combined_dataset/train/non-malicious/sample_44_71.ps1
sample_44_71.ps1
# # Module manifest for module 'OCI.PSModules.Rover' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Rover.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_12_71.ps1
sample_12_71.ps1
ConvertFrom-StringData @' id_virtualization=Virtualization Information id_virtualizationobtaining=Obtaining Information about Virtualization Environment id_virtualizationoutput=Virtualization Information Output '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor ...
combined_dataset/train/non-malicious/4129.ps1
4129.ps1
param ( [string] $OutputFile = 'MissingBitlockerKeys.csv', [string] $Path ) function ProcessTextFile { If ((Test-Path -Path $OutputFile) -eq $true) { Remove-Item -Path $OutputFile -Force } } function Get-Laptops { Set-Variable -Name Item -Scope Local -Force Set-Variable -Name QuerySystems -Scope Local ...
combined_dataset/train/non-malicious/672.ps1
672.ps1
$reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl } Function New-InMemoryFileShareSubscription { [xml]$matchData = '<?xml version="1.0" encoding="utf-16" standalone="yes"?><ScheduleDefinition xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:...
combined_dataset/train/non-malicious/3002.ps1
3002.ps1
function Get-HumanTime($Seconds) { if ($Seconds -gt 0.99) { $time = [math]::Round($Seconds, 2) $unit = 's' } else { $time = [math]::Floor($Seconds * 1000) $unit = 'ms' } return "$time$unit" } function GetFullPath ([string]$Path) { $Folder = & $SafeCommands['Split...
combined_dataset/train/non-malicious/sample_18_27.ps1
sample_18_27.ps1
# # Module manifest for module 'OCI.PSModules.Emwarehouse' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Emwarehouse.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/Read Gmail POP .ps1
Read Gmail POP .ps1
<# .AUTHOR Will Steele (wlsteele@gmail.com) .DEPENDENCIES Powershell v2 (for Out-Gridview cmdlet) .DESCRIPTION This script is a proof of concept. Further work needs to be done. It requires the user to enter a valid username and password for a gmail.com account. It then attempts to form an S...
combined_dataset/train/non-malicious/sample_2_35.ps1
sample_2_35.ps1
# Localized 06/28/2023 07:57 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1 ConvertFrom-StringData @' ###PSLOC AudioDevice_name=Ponto de extremidade de áudio AudioDevice_description=Tipo de dispositivo de áudio sendo diagnosticado. CurrentVolumeLevel_name=Nível de volume CurrentVolumeLevel_description=Nível de ...
combined_dataset/train/non-malicious/2746.ps1
2746.ps1
try { $IEUrlInfo = Get-WmiObject -Namespace 'root\cimv2\IETelemetry' -Class IEURLInfo -ErrorAction Stop $IEUrlInfo } catch [System.Management.ManagementException] { throw 'WMI Namespace root\fimv2\IETelemetry does not exist.' }
combined_dataset/train/non-malicious/1792.ps1
1792.ps1
Describe "Convert-Path tests" -Tag CI { It "Convert-Path should handle provider qualified paths" { Convert-Path -Path "FileSystem::${TestDrive}" | Should -BeExactly "${TestDrive}" } It "Convert-Path should return the proper path" { Convert-Path -Path "$TestDrive" | Should -BeExactly "$Tes...
combined_dataset/train/non-malicious/sample_8_25.ps1
sample_8_25.ps1
# Sample diagnostic function # # Wrapped in a region same name as function name # Change the name and code as needed # # You can test your diagnostic function by running xray in developer mode, e.g.: # .\xray.ps1 -Diagnostic net_dnscli_KB4562541_sample -DevMode #region net_dnscli_KB4562541_sample <# Compone...
combined_dataset/train/non-malicious/sample_23_90.ps1
sample_23_90.ps1
[CmdletBinding()] param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [string]$Path ) Import-Module $(Join-Path $PSSCriptRoot Helpers.psm1) $lastTouched = $(git log -1 --format="format:%ci" -- $Path) try { [datetime]::Parse($lastTouched) } catch { "" } # SIG # Begin signatu...
combined_dataset/train/non-malicious/sample_47_69.ps1
sample_47_69.ps1
# # Module manifest for module 'PowerShellEditorServices' # # Generated by: daviwil # # Generated on: 5/12/2016 # @{ # Script module or binary module file associated with this manifest. RootModule = if ($PSEdition -eq 'Core') { 'bin/Core/Microsoft.PowerShell.EditorServices.Hosting.dll' }...
combined_dataset/train/non-malicious/630.ps1
630.ps1
param( [string]$Version, [string]$Path, [switch]$Force, [switch]$Update, [switch]$Uninstall ) $Configs = @{ Url = "http://psget.net/GetPsGet.ps1" ConditionExclusion = "(Get-Module -ListAvailable | where{`$_.Name -eq `"PsGet`"})" } $Configs | ForEach-Object{ try{ $_.Result = $null i...
combined_dataset/train/non-malicious/1073.ps1
1073.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) Describe 'Get-PathProvider' { It 'should get file system provider' { ((Get-PathProvider -Path 'C:\Windows').Name) | Should Be 'FileSystem' } It 'should get relative path provider' { ((Get...
combined_dataset/train/non-malicious/Check Service.ps1
Check Service.ps1
#################################################################################### #PoSH script to check if a server is up and if it is check for a service. #If the service isn't running, start it and send an email # JK - 7/2009 #################################################################################### ...
combined_dataset/train/non-malicious/sample_22_42.ps1
sample_22_42.ps1
# # Module manifest for module 'OCI.PSModules.Bds' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Bds.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/Disable-SSLValidation_1.ps1
Disable-SSLValidation_1.ps1
function Disable-SSLValidation { <# .SYNOPSIS Disables SSL certificate validation .DESCRIPTION Disable-SSLValidation disables SSL certificate validation by using reflection to implement the System.Net.ICertificatePolicy class. Author: Matthew Graeber (@mattifestation) License: BSD 3-Clause .N...
combined_dataset/train/non-malicious/ASPX Mailbox (1 of 6).ps1
ASPX Mailbox (1 of 6).ps1
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="mailboxTasks.aspx.cs" Inherits="mailboxTasks" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>...
combined_dataset/train/non-malicious/sample_0_67.ps1
sample_0_67.ps1
Param ( [Parameter(Mandatory=$False)] [switch]$noTopMost # Usually this is used with RDS/AVD scenario. ) Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing Add-Type -AssemblyName PresentationFramework # We load WPF for DPI awareness [xml]$Xaml= @" <Window xmlns="ht...
combined_dataset/train/non-malicious/sample_23_46.ps1
sample_23_46.ps1
# # Module manifest for module 'Microsoft.SME.Security' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.Security.psm1' # Version number of this module. ModuleVersion = '4.4.2' # Supported PSEditions # CompatiblePSEditions = @() # ID used to uniqu...
combined_dataset/train/non-malicious/sample_30_79.ps1
sample_30_79.ps1
Add-AppxPackage exit cd C:\Users\sampler-win_10_x64\Desktop\ Get-AppxPackage >apps.tx cd C:\Users\sampler-win_10_x64\Desktop\ Get-AppxPackage -allusers | Select Name, PackageFullName > apps_v2.txt Get-AppxPackage | Select Name, PackageFullName > apps_v2.txt Get-AppxPackage Get-AppxPackage -Online Get-AppxPacka...
combined_dataset/train/non-malicious/3014.ps1
3014.ps1
Set-StrictMode -Version Latest describe 'New-MockObject' { it 'instantiates an object from a class with no public constructors' { $type = 'Microsoft.PowerShell.Commands.Language' New-MockObject -Type $type | should -beoftype $type } }
combined_dataset/train/non-malicious/Compare SQL Tables II.ps1
Compare SQL Tables II.ps1
function Convert-TableToList { param( $t, $colid = 0 ) $t | % {$_.item($colid)} } function Compare-Tables { param( $name, $db1, $db2, $exclude = @() ) # @bernd_k http://pauerschell.blogspot.com/ # requires on sqlise http://sq...
combined_dataset/train/non-malicious/sample_39_56.ps1
sample_39_56.ps1
param($installPath, $toolsPath, $package, $project) Import-Module (Join-Path $toolsPath common.psm1) -Force try { # Indicates if the current project is a VB project if ([string]::IsNullOrEmpty($project.CodeModel.Language)) { $IsVbProject = $project.FullName -like "*.vbproj" } else {...
combined_dataset/train/non-malicious/sample_1_36.ps1
sample_1_36.ps1
#- Enumerate minifilter drivers via Fltmc.exe command Function RunFltmc ($FltmcCommand, [switch]$CollectFile) { $OutputFile = $ComputerName + "_Fltmc.TXT" $CommandLineToExecute = "cmd.exe /c $FltmcCommand >> $OutputFile" #header $date=Get-Date "-" * ($CommandLineToExecute.Length + 35) + "`r`n[$date]...
combined_dataset/train/non-malicious/sample_14_22.ps1
sample_14_22.ps1
ConvertFrom-StringData @' id_b2693877_sophos_befltchecktitle=Checking for Ultimaco Safeware disk encryption id_b2693877_sophos_befltcheckdesc=Checking for Ultimaco Safeware disk encryption version 5.6 id_b2693877_sophos_befltchecksd=Ultimaco Safeware (Sophos) disk encryption version 5.6 is known to cause corruption ...
combined_dataset/train/non-malicious/sample_8_30.ps1
sample_8_30.ps1
#************************************************ # DC_GroupPolicyClient-Component.ps1 # Version 1.0 # Date: 2009 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about the Group Policy client. # Called from: Main Networking Diag #*************************************************...
combined_dataset/train/non-malicious/sample_37_79.ps1
sample_37_79.ps1
# # Module manifest for module 'OCI.PSModules.Osubbillingschedule' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osubbillingschedule.dll' # Version number of this module. ModuleVersion = '83.2.0' # Sup...
combined_dataset/train/non-malicious/sample_46_71.ps1
sample_46_71.ps1
Rem AnimationEncyclopedia.vbs Rem An InDesign VBScript Rem Rem Author: Brenda Burden Rem Creates a 6-page sample doc demonstrating the new InDesign Animation feature Rem Search Reference Rem PAGE ONE - Sample of Animation Properties Rem PAGE TWO - Sample of all Animation Events Rem PAGE THREE - Sample ...
combined_dataset/train/non-malicious/sample_36_91.ps1
sample_36_91.ps1
# # Module manifest for module 'OCI.PSModules.Resourcemanager' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Resourcemanager.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported P...
combined_dataset/train/non-malicious/PurgeFiles script..ps1
PurgeFiles script..ps1
<# .SYNOPSIS PurgeFiles - recursively remove files with given extension and maximum age from a given path. .DESCRIPTION Read the synopsis Example PurgeFiles.psq -path C:\\temp -ext .tmp -max 24 .EXAMPLE PurgeFiles.psq -path C:\\temp -ext .tmp -max 24 #> # HISTORY # 2010/01/29 # rluiten Created para...
combined_dataset/train/non-malicious/sample_40_81.ps1
sample_40_81.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Clear-AMTSystemDefense { <# .Synopsis Clears all Intel Active Management Technology System Defense policies and filters .Description This CmdLet clears the Intel Active Management Technology (AMT) network access policy fro...
combined_dataset/train/non-malicious/3700.ps1
3700.ps1
function Assert-NotNullOrEmpty { param([string]$value) Assert-False { [string]::IsNullOrEmpty($value) } }
combined_dataset/train/non-malicious/sample_22_95.ps1
sample_22_95.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Start-AMTIDER { <# .Synopsis Starts an Intel Active Management Technology IDE redirection session .Description This CmdLet starts an Intel Active Management Technology(AMT) IDE redirection(IDER) session to clients that hav...
combined_dataset/train/non-malicious/sample_17_75.ps1
sample_17_75.ps1
#------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. #------------------------------------------------------------ @{ # Script module or binary module file associated with this manifest ModuleToProcess = 'Microsoft.IdentityManagement.PowerSh...
combined_dataset/train/non-malicious/sample_62_89.ps1
sample_62_89.ps1
<# .SYNOPSIS Simplify data collection and diagnostics for troubleshooting Microsoft Remote Desktop (RDP/RDS/AVD/W365) related issues and a convenient method for submitting and following quick & easy action plans. .DESCRIPTION This script is designed to gather information to assist Microsoft Customer Suppo...
combined_dataset/train/non-malicious/3350.ps1
3350.ps1
[cmdletbinding(DefaultParameterSetName = 'task')] param( [parameter(ParameterSetName = 'task', Position = 0)] [ValidateSet('default','Init','Test','Analyze','Pester','Build','Compile','Clean','Publish','Build-Docker','Publish-Docker','RegenerateHelp','UpdateMarkdownHelp','CreateExternalHelp')] [string...