full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_58_45.ps1
sample_58_45.ps1
######################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # Localized PackageManagement.Resources.psd1 # ######################################################################################### ConvertFrom-StringDa...
combined_dataset/train/non-malicious/471.ps1
471.ps1
[CmdletBinding()] Param ( [string] $Branch = "master", [switch] $UserMode, [ValidateSet('AllUsers', 'CurrentUser')] [string] $Scope = "AllUsers", [switch] $Force ) $ModuleName = "PSFramework" $BaseUrl = "https://github.com/PowershellFrameworkCollective/psframework" $SubFolder = "PSFramework" $...
combined_dataset/train/non-malicious/sample_39_8.ps1
sample_39_8.ps1
@{ GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @('MSFT_MpPerformanceRecording.psm1') FormatsToProcess = @(...
combined_dataset/train/non-malicious/353.ps1
353.ps1
function Register-PSFLoggingProvider { [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFLoggingProvider')] Param ( [Parameter(Mandatory = $true)] [string] $Name, [switch] $Enabled, [System.Management.Automation.ScriptBlock] $RegistrationEvent, ...
combined_dataset/train/non-malicious/sample_15_77.ps1
sample_15_77.ps1
# # Module manifest for module 'OCI.PSModules.Oda' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Oda.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_46_8.ps1
sample_46_8.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Kusto.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Kusto.internal.psm1' if(Test-Path $internalModulePath) { $null = ...
combined_dataset/train/non-malicious/sample_54_66.ps1
sample_54_66.ps1
# Localized 05/08/2024 05:10 AM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=&Sì PromptNoString=&No BundleFound=Pacchetto trovato: {0} PackageFound=Pacchetto trovato: {0} EncryptedBundleFound=Bundle crittografato trovato: {0} EncryptedPackag...
combined_dataset/train/non-malicious/Remove-XmlNamespace.ps1
Remove-XmlNamespace.ps1
function Remove-XmlNamespace { #.Synopsis # Removes namespace definitions and prefixes from xml documents #.Description # Runs an xml document through an XSL Transformation to remove namespaces from it if they exist. # Entities are also naturally expanded #.Parameter Content # Specifies a string that contain...
combined_dataset/train/non-malicious/sample_35_89.ps1
sample_35_89.ps1
# # Script module for module 'Az.OperationalInsights' that is executed when 'Az.OperationalInsights' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 05/16/2024 06:33:09 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { ...
combined_dataset/train/non-malicious/138.ps1
138.ps1
param( [Parameter(HelpMessage = "Azure AD Username", Mandatory = $true)] [string] $Username, [Parameter(HelpMessage = "User principal name to export data for", Mandatory = $true)] [string] $Upn, [Parameter(HelpMessage = "Include AzureAD data in export")] [switch] $IncludeAzureAD,...
combined_dataset/train/non-malicious/sample_52_31.ps1
sample_52_31.ps1
param ( $FilePath, $Type, $Table ) . "$PSScriptRoot\..\project\api.ps1" . "$PSScriptRoot\api.ps1" $FullPath = Get-Full-Path($FilePath) function Run-It { param ( $FilePath, $PhpFile, $Table ) $php=(Get-Php) Set-Location (Get-Project-Root) & ...
combined_dataset/train/non-malicious/28fbc2a5-866d-4bb2-8d93-78099b503621.ps1
28fbc2a5-866d-4bb2-8d93-78099b503621.ps1
function cpu-usage { if ($Args) {$machine=$Args} else {$machine="localhost"} #loop to refresh information cpu usage while($auxiliary -ne 'Q') { #first sample of processes $before = gwmi win32_perfrawdata_perfproc_process -ComputerName $machine sleep -Millis...
combined_dataset/train/non-malicious/sample_33_0.ps1
sample_33_0.ps1
# # Module manifest for module 'OCI.PSModules.Aispeech' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aispeech.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_45_77.ps1
sample_45_77.ps1
#!powershell # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #AnsibleRequires -PowerShell Ansible.ModuleUtils.AddType #AnsibleRequires -CSharpUtil Ansible.Basic #AnsibleRequires -PowerShell ..module_utils.Process $spec = @{ opti...
combined_dataset/train/non-malicious/sample_49_24.ps1
sample_49_24.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the \"License\"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.a...
combined_dataset/train/non-malicious/sample_61_12.ps1
sample_61_12.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...
combined_dataset/train/non-malicious/sample_17_99.ps1
sample_17_99.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_57_1.ps1
sample_57_1.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apa...
combined_dataset/train/non-malicious/FuncionInfo.types.ps1xml.ps1
FuncionInfo.types.ps1xml.ps1
<?xml version="1.0" encoding="utf-8" ?> <Types> <Type> <Name>System.Management.Automation.FunctionInfo</Name> <Members> <ScriptProperty> <Name>Verb</Name> <GetScriptBlock> if ($this.Name.Contains("-")) { $this.Name.Substring(0,$this.Name.Indexof("-")) } else { $null ...
combined_dataset/train/non-malicious/sample_41_1.ps1
sample_41_1.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_33_88.ps1
sample_33_88.ps1
############################################################################## # PREVIEW VERSION OF PSAKE SCRIPT FOR MODULE BUILD & PUBLISH TO THE PSGALLERY ############################################################################## # # We are hoping to add support for publishing modules to the PowerShell galler...
combined_dataset/train/non-malicious/sample_24_66.ps1
sample_24_66.ps1
# # Module manifest for module 'OCI.PSModules.Vault' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Vault.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/New-BootsGadget.ps1
New-BootsGadget.ps1
New-BootsGadget { #.Synopsis # Create desktop gadgets with no window chrome #.Description # Provides a wrapper for generating gadget windows with PowerBoots. It adds two parameters to the usual New-PowerBoots command: RefreshRate and On_Refresh. # # Gadget windows are created with AllowsTransparency, Back...
combined_dataset/train/non-malicious/sample_15_47.ps1
sample_15_47.ps1
# # Module manifest for module 'OCI.PSModules.Aidocument' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aidocument.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/550.ps1
550.ps1
function Set-SPODocumentPermissions { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string]$groupname, [Parameter(Mandatory=$true, Position=2)] [string]$listname, [Parameter(Mandatory=$true, Position=3)] [string]$listItemName, [Parameter(Mandatory=$true, Position...
combined_dataset/train/non-malicious/Get Twitter RSS Feed_3.ps1
Get Twitter RSS Feed_3.ps1
param ([String] $ScreenName) $client = New-Object System.Net.WebClient $idUrl = "https://api.twitter.com/1/users/show.json?screen_name=$ScreenName" $data = $client.DownloadString($idUrl) $start = 0 $findStr = '"id":' do { $start = $data.IndexOf($findStr, $start + 1) if ($start -gt 0) { $s...
combined_dataset/train/non-malicious/sample_7_61.ps1
sample_7_61.ps1
# diag_sha.psm1 # Created by tdimli # March 2020 # # Diagnostic functions for SHA area # version $SHA_version = "1.0.200425.0" # Area and Area/Component arrays # Example: $AREA = @("Component1", "Component2") $SHA = @() #Component/Diagnostic Function arrays # Example: $Component1 = @("Diag_Func1", "Dia...
combined_dataset/train/non-malicious/sample_57_94.ps1
sample_57_94.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 = '84.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_0_62.ps1
sample_0_62.ps1
<# .SYNOPSIS Scenario module for collecting Microsoft Remote Desktop Smart Card related data .DESCRIPTION Collect Smart Card related troubleshooting data .NOTES Author : Robert Klemencz Requires : MSRD-Collect.ps1 Version : See MSRD-Collect.ps1 version Feedback : https://aka.ms...
combined_dataset/train/non-malicious/2782.ps1
2782.ps1
if (Get-Command logparser.exe) { $lpquery = @" SELECT Distinct substr(LocalAddress, 0, last_index_of(substr(LocalAddress, 0, last_index_of(LocalAddress, '.')), '.')) as Local/16 FROM *netstat.csv ORDER BY Local/16 "@ & logparser -stats:off -i:csv -dtlines:0 -rtp:-1 $lpque...
combined_dataset/train/non-malicious/sample_19_9.ps1
sample_19_9.ps1
# *********************************************************************************************************** # Version 1.0 # Date: 03-01-2012 # Author: Vinay Pamnani - vinpa@microsoft.com # Description: # Collects Configuration Manager SQL Server Information. # *************************************************...
combined_dataset/train/non-malicious/sample_7_60.ps1
sample_7_60.ps1
@{ GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" CmdletsToExport = @( 'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al...
combined_dataset/train/non-malicious/2956.ps1
2956.ps1
properties { $x = $null $y = $null $z = $null } task default -depends TestProperties task TestProperties { Assert ($x -ne $null) "x should not be null. Run with -properties @{'x' = '1'; 'y' = '2'}" Assert ($y -ne $null) "y should not be null. Run with -properties @{'x' = '1'; 'y' = '2'}" Assert ($z -eq $...
combined_dataset/train/non-malicious/sample_39_94.ps1
sample_39_94.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_5_6.ps1
sample_5_6.ps1
#************************************************ # TS_DfsrUpdateWorkerThreadCountCheck.ps1 # Version 1.0.1 # Date: 6/15/2012 # Author: v-blchen # Description: [Idea ID 2831] [Windows] DFSR Reg setting UpdateWorkerThreadCount = 64 may cause hang # Rule number: 2831 # Rule URL: http://sharepoint/sites/rules/Ru...
combined_dataset/train/non-malicious/1206.ps1
1206.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) Describe 'ConvertTo-ProviderAccessControlRights' { BeforeAll { } InModuleScope 'Carbon' { It 'should convert file system value' { (ConvertTo-ProviderAccessControlRights -ProviderName 'File...
combined_dataset/train/non-malicious/3941.ps1
3941.ps1
function Test-VirtualNetworkCRUD { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/virtualNetworks" $location = Get-ProviderLocation $res...
combined_dataset/train/non-malicious/sample_19_37.ps1
sample_19_37.ps1
function Disable-WACFWFirewallRule { <# .SYNOPSIS Disable Firewall Rule. .DESCRIPTION Disable Firewall Rule. .ROLE Administrators #> param ( [Parameter(Mandatory = $true)] [String] $instanceId, [Parameter(Mandatory = $true)] [String] $policyStore ) Import-Module net...
combined_dataset/train/non-malicious/sample_24_92.ps1
sample_24_92.ps1
# # Module manifest for module 'OCI.PSModules.Fleetsoftwareupdate' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Fleetsoftwareupdate.dll' # Version number of this module. ModuleVersion = '81.0.0' # Sup...
combined_dataset/train/non-malicious/Inventory_1.ps1
Inventory_1.ps1
############################################################################ # # Collect.ps1 # Version: 0.2 # Script to Collect Information from PCs in a Subnet # By: Brad Blaylock # For: St. Bernards RMC # Date: 3-25-2010 # ############################################################################ #...
combined_dataset/train/non-malicious/sample_43_51.ps1
sample_43_51.ps1
@{ GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" CmdletsToExport = @( 'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al...
combined_dataset/train/non-malicious/Tac (reverse cat).ps1
Tac (reverse cat).ps1
param([string]$path) Set-PSDebug -Strict $fs = New-Object System.IO.FileStream ((Resolve-Path $path), 'Open', 'Read') trap { $fs.Close(); break } $pos = $fs.Length $sb = New-Object System.Text.StringBuilder while (--$pos -ge 0) { [void]$fs.Seek($pos, 'Begin') $ch = [char]$fs.ReadByte() if ($ch ...
combined_dataset/train/non-malicious/Execute-SQLCommand_3.ps1
Execute-SQLCommand_3.ps1
function Execute-SQLCommand {param( [string]$Server, #the host name of the SQL server [string]$Database, #the name of the database [System.Data.SqlClient.SqlCommand]$Command) #the command to execute (name of stored procedure) $sqlConnection = New-Object System.Data.SqlClient.SqlConnection $sqlCo...
combined_dataset/train/non-malicious/h20 -Hashtables 2 object_1.ps1
h20 -Hashtables 2 object_1.ps1
#hashtable to object function. #used to be able to make custom objects with math inside the pipeline #e.g. 1..10 | h20 { @{karl = $_;dude = $_+1} } #gps | h20 { @{name = $_.processname; mem = $_.workingset / 1MB} } function h20([scriptblock]$sb ) { begin {} process{ if ($sb -ne $null) { ...
combined_dataset/train/non-malicious/3931.ps1
3931.ps1
function Test-NetworkServiceTagsList { $location = Get-ProviderLocation ResourceManagement; try { $results = Get-AzNetworkServiceTag -Location $location; Assert-NotNull $results; Assert-AreEqual $results.Type "Microsoft.Network/serviceTags"; Assert-NotNull $r...
combined_dataset/train/non-malicious/3325.ps1
3325.ps1
function Disable-ScheduledCommand { [PoshBot.BotCommand( Aliases = 'disableschedule', Permissions = 'manage-schedules' )] [cmdletbinding()] param( [parameter(Mandatory)] $Bot, [parameter(Mandatory, Position = 0)] [ValidateNotNullOrEmpty()] [...
combined_dataset/train/non-malicious/sample_46_28.ps1
sample_46_28.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Join-ScriptExtent { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding()] [OutputType([System.Management.Automation.Language.IScriptExtent])] param( [Parameter(Value...
combined_dataset/train/non-malicious/113.ps1
113.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 ($Aa...
combined_dataset/train/non-malicious/2251.ps1
2251.ps1
 [CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed.", ParameterSetName="SingleInstance")] [parameter(Mandatory=$true, ParameterSetName="AllInstances")] [ValidateNotNullOrEmpty()] [ValidateScript({Test-Connectio...
combined_dataset/train/non-malicious/sample_43_24.ps1
sample_43_24.ps1
# # Module manifest for module 'OCI.PSModules.Lockbox' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Lockbox.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/368.ps1
368.ps1
function Get-PSFTypeSerializationData { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSPossibleIncorrectUsageOfAssignmentOperator", "")] [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFTypeSerializationData')] Param ( [Parameter(ValueFromPipeline = $true)] [obj...
combined_dataset/train/non-malicious/Get-Sysinternals_1.ps1
Get-Sysinternals_1.ps1
function Get-SysInternals { param ( $sysIntDir=(join-path $env:systemroot "\\Sysinternals\\") ) if(!(Test-Path -Path $sysIntDir -PathType Container)) { $null = New-Item -Type Directory -Path $sysIntDir -Force } $log = join-path $sysIntDir "changes.log" Add-Content ...
combined_dataset/train/non-malicious/sample_16_50.ps1
sample_16_50.ps1
########################################################################### # DC_Disk_Quota # Version 1.0 # Date: 09-26-2012 # Author: mifannin # Description: Collects Disk Quota Data ########################################################################### Import-LocalizedData -BindingVariable Quota -FileNa...
combined_dataset/train/non-malicious/sample_4_64.ps1
sample_4_64.ps1
# Collect-Commons 20230623 Function Write-Log { param( [string] $msg ) $msg = (get-date).ToString("yyyyMMdd HH:mm:ss.fff") + " " + $msg Write-Host $msg $msg | Out-File -FilePath $global:outfile -Append } Function ExecQuery { param( [string] $NameSpace, [string] $Query ) Write-Log...
combined_dataset/train/non-malicious/3259.ps1
3259.ps1
class ScheduledMessage { [string]$Id = (New-Guid).Guid.Split('-')[0] [TimeInterval]$TimeInterval [int]$TimeValue [Message]$Message [bool]$Enabled = $true [bool]$Once = $false [double]$IntervalMS [int]$TimesExecuted = 0 [DateTime]$StartAfter = (Get-Date).ToUniversalTime()...
combined_dataset/train/non-malicious/403.ps1
403.ps1
. Import-ModuleFile -Path "$($script:ModuleRoot)\internal\scripts\cmdlets.ps1" . Import-ModuleFile -Path "$($script:ModuleRoot)\bin\type-aliases.ps1" . Import-ModuleFile -Path "$($script:ModuleRoot)\internal\scripts\strings.ps1" foreach ($file in (Get-ChildItem -Path "$($script:ModuleRoot)\internal\configuration...
combined_dataset/train/non-malicious/sample_51_92.ps1
sample_51_92.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/sample_16_69.ps1
sample_16_69.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 = '77.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/Hash Checker_3.ps1
Hash Checker_3.ps1
#.Synopsis # Test the HMAC hash(es) of a file #.Description # Takes the HMAC hash of a file using specified algorithm, and optionally, compare it to a baseline hash #.Example # Test-Hash npp.5.3.1.Installer.exe -HashFile npp.5.3.1.release.md5 # # Searches the provided hash file for a line matching the "...
combined_dataset/train/non-malicious/TabExpansion_4.ps1
TabExpansion_4.ps1
## Tab-Completion ################# ## Please dot souce this script file. ## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list. ## What this can do is: ## ## [datetime]::n<tab> ## [datetime]::now.d<tab> ## $a = New-Object "Int32[,]" 2,3; $b = "PowerShell","PowerShe...
combined_dataset/train/non-malicious/3813.ps1
3813.ps1
$PLACEHOLDER = "PLACEHOLDER1@" $TestOutputRoot = [System.AppDomain]::CurrentDomain.BaseDirectory; $TemplatesPath = Join-Path $TestOutputRoot "Templates"; $ConfigFilesPath = Join-Path $TestOutputRoot "ConfigFiles"; function Get-ComputeTestResourceName { $stack = Get-PSCallStack $testName = $null;...
combined_dataset/train/non-malicious/858.ps1
858.ps1
function Start-HiveJob { $ErrorActionPreference = "Stop" $context = Get-AzContext if ($context -eq $null) { Connect-AzAccount } $context $clusterName = Read-Host -Prompt "Enter the HDInsight cluster name" $creds=Get-Credential -Message "Enter the login f...
combined_dataset/train/non-malicious/sample_52_49.ps1
sample_52_49.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.SvnInfoOutp...
combined_dataset/train/non-malicious/sample_66_93.ps1
sample_66_93.ps1
########################################################################## # DELL PROPRIETARY INFORMATION # # This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this # software to you under the terms of a license agreement,nondisclosure agreement or both. # You may not copy, disclose, o...
combined_dataset/train/non-malicious/1028.ps1
1028.ps1
Login-AzAccount Get-AzSubscription Set-AzContext -SubscriptionId "<yourSubscriptionID>" $certpwd="Password $certfolder="c:\mycertificates\" $adminuser="vmadmin" $adminpwd="Password $clusterloc="SouthCentralUS" $clustername = "mysftestcluster" $groupname="mysfclustergroup" $vmsku = "Standard_D1_v2" $subname...
combined_dataset/train/non-malicious/sample_47_14.ps1
sample_47_14.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/Reset Time Sync Setting_1.ps1
Reset Time Sync Setting_1.ps1
######################################################## # Created by Brian English # Brian.English@charlottefl.com # eddiephoenix@gmail.com # # for Charlotte County Government # No warranty suggested or implied ######################################################## # Purpose: Cycle through all VMs on a...
combined_dataset/train/non-malicious/sample_36_83.ps1
sample_36_83.ps1
@{ GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" CmdletsToExport = @( 'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al...
combined_dataset/train/non-malicious/2346.ps1
2346.ps1
[CmdletBinding()] [OutputType()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidatePattern('^OU\=')] [string]$OrganizationalUnit, [Parameter()] [string[]]$EventId = @(4647,4648), [Parameter()] [ValidateNotNullOrEmpty()] [string]$EmailToAddress, [Parameter()] [ValidateNotNullOrEmpty()] ...
combined_dataset/train/non-malicious/Add-SqlTable_3.ps1
Add-SqlTable_3.ps1
try {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop} catch {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo"} try {add-type -AssemblyName "Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=8...
combined_dataset/train/non-malicious/finddupe_23.ps1
finddupe_23.ps1
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null $cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider] $hashAlgorithm = new-object $cryptoServiceProvider try { $stream = $file.OpenRead() } ...
combined_dataset/train/non-malicious/sample_10_95.ps1
sample_10_95.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/Computer Inventory_1.ps1
Computer Inventory_1.ps1
# ======================================================== # # Script Information # # Title: Remote Computer Inventory # Author: Assaf Miron # Originally created: 21/06/2008 # Original path: Computer-Inventory.PS1 # Description: Collects Remote Computer Data Using WMI and Registry Access # Outputs...
combined_dataset/train/non-malicious/894.ps1
894.ps1
$resourceGroupName = "myResourceGroup" $webappname = "<replace-with-your-app-name>" Get-AzWebAppBackupList -ResourceGroupName $resourceGroupName -Name $webappname $backup = (Get-AzWebAppBackupList -ResourceGroupName $resourceGroupName -Name $webappname | where {$_.BackupId -eq <replace-with-BackupID>}) $backu...
combined_dataset/train/non-malicious/Get-OpenLDAP.ps1
Get-OpenLDAP.ps1
Param($user, $password = $(Read-Host "Enter Password" -asSec), $filter = "(objectclass=user)", $server = $(throw '$server is required'), $path = $(throw '$path is required'), [switch]$all, [switch]$verbose) function GetSecurePass ($SecurePassword) { $Ptr = [System.Run...
combined_dataset/train/non-malicious/sample_12_42.ps1
sample_12_42.ps1
param( [parameter(Mandatory = $false)] $siteName, [parameter(Mandatory = $false)] $sitePhysicalPath, [parameter(Mandatory = $false)] $siteAppPoolName, [parameter(Mandatory = $false)] [int]$sitePort, [parameter(Mandatory = $false)] $deploymentUserName, [...
combined_dataset/train/non-malicious/sample_14_64.ps1
sample_14_64.ps1
#************************************************ # DC_ClusterResourcesProperties.ps1 # Version 1.1.1 # Date: 11-22-2011 # Author: Andre Teixeira - andret@microsoft.com # Description: This script writes cluster resources properties # on a text file called COMPUTERNAME_ClusterProperties.txt #*******...
combined_dataset/train/non-malicious/sample_18_93.ps1
sample_18_93.ps1
#Volumetric soil moisture content '260185' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 9 ; } #Upper layer soil temperature '260201' = { discipline = 2 ; parameterCategory = 3 ; parameterNumber = 1 ; } #Upper layer soil moisture '260202' = { discipline = 2 ; parameterCategory = 3 ; ...
combined_dataset/train/non-malicious/sample_23_73.ps1
sample_23_73.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=Zmienna środowiskowa o tej nazwie i typie już istnieje. EnvironmentErrorDoesNotExists=Zmienna środowiskowa o tej nazwie i typie nie istnieje. '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEE...
combined_dataset/train/non-malicious/sample_13_19.ps1
sample_13_19.ps1
# # Module manifest for module 'OCI.PSModules.Managementdashboard' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Managementdashboard.dll' # Version number of this module. ModuleVersion = '74.1.0' # Sup...
combined_dataset/train/non-malicious/sample_37_62.ps1
sample_37_62.ps1
function PSConsoleHostReadLine { Microsoft.PowerShell.Core\Set-StrictMode -Off [Microsoft.PowerShell.PSConsoleReadLine]::ReadLine($host.Runspace, $ExecutionContext) } # SIG # Begin signature block # MIInwQYJKoZIhvcNAQcCoIInsjCCJ64CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE...
combined_dataset/train/non-malicious/402.ps1
402.ps1
Register-PSFSessionObjectType -DisplayName CimSession -TypeName Microsoft.Management.Infrastructure.CimSession Register-PSFSessionObjectType -DisplayName PSSession -TypeName System.Management.Automation.Runspaces.PSSession Register-PSFSessionObjectType -DisplayName SmoServer -TypeName Microsoft.SqlServer.Management....
combined_dataset/train/non-malicious/3942.ps1
3942.ps1
function Test-NetworkUsage { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/Usages" $location = Get-ProviderLocation $resourceTypeParent...
combined_dataset/train/non-malicious/4190.ps1
4190.ps1
[CmdletBinding()] param ( [string] $DomainUserName, [string] $DomainPassword, [string] $NetworkPath, [string] $DriveLetter ) function Copy-Folder { [CmdletBinding()] param ( [string] $SourceFolder, [string] $DestinationFolder ) $Executable = $env:windir + "\system32\Robocopy.exe" $Switches ...
combined_dataset/train/non-malicious/546.ps1
546.ps1
function Set-SPOCustomMasterPage { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string]$masterFile ) $masterUrl = Join-SPOParts -Separator '/' -Parts $clientContext.Site.ServerRelativeUrl, "/_catalogs/masterpage/$masterFile" $web = $clientContext.Web Write-Host "Mast...
combined_dataset/train/non-malicious/sample_6_6.ps1
sample_6_6.ps1
// Copyright (c) 2009 DMTF. All rights reserved. [Abstract, Version ( "2.22.0" ), UMLPackagePath ( "CIM::System::Processing" ), Description ( "Status and configuration of a JobQueue. Jobs are held on a " "queue, and can move from queue to queue until being processed." )] class CIM_Job...
combined_dataset/train/non-malicious/3441.ps1
3441.ps1
$scriptFolder = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent . ($scriptFolder + '.\SetupEnv.ps1') $packageFolder="$env:AzurePSRoot\artifacts" if (Test-Path $packageFolder) { Remove-Item -Path $packageFolder -Recurse -Force } $keyPath = "HKLM:\SOFTWARE\Microsoft\Windows Installer XML"...
combined_dataset/train/non-malicious/coolprompt.ps1
coolprompt.ps1
$global:wmilocalcomputer = get-WMIObject -class Win32_OperatingSystem -computer "." $global:lastboottime=[System.Management.ManagementDateTimeconverter]::ToDateTime($wmilocalcomputer.lastbootuptime) $global:originaltitle = [console]::title function prompt { $up=$(get-date)-$lastboottime $upstr="$([dat...
combined_dataset/train/non-malicious/sample_22_3.ps1
sample_22_3.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_26_34.ps1
sample_26_34.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/3514.ps1
3514.ps1
function Test-DataLakeAnalyticsComputePolicy { param ( $resourceGroupName = (Get-ResourceGroupName), $accountName = (Get-DataLakeAnalyticsAccountName), $dataLakeAccountName = (Get-DataLakeStoreAccountName), $location = "West US" ) try { New-AzResourceGroup -Name $resourceGroupName -Location $loc...
combined_dataset/train/non-malicious/sample_44_87.ps1
sample_44_87.ps1
# # Module manifest for module 'OCI.PSModules.Ailanguage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ailanguage.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/d5ae4c48-9aa7-424e-9d74-61c687175d1b.ps1
d5ae4c48-9aa7-424e-9d74-61c687175d1b.ps1
get-vc virtualCenterServerName get-vmhost | Get-VirtualSwitch -Name SwitchName | New-VirtualPortGroup -Name VLAN_12 -VLANID 12
combined_dataset/train/non-malicious/999.ps1
999.ps1
$myEndpoint = "<your-endpoint-URL>" $topicName = "<your-topic-name>" $myResourceGroup= "<resource-group-name>" New-AzResourceGroup -Name $myResourceGroup -Location westus2 New-AzEventGridTopic -ResourceGroupName $myResourceGroup -Location westus2 -Name $topicName $topicid = (Get-AzEventGridTopic -Resourc...
combined_dataset/train/non-malicious/sample_61_79.ps1
sample_61_79.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 = '86.2.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/Set-SecureAutoLogon.ps1
Set-SecureAutoLogon.ps1
[cmdletbinding()] param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Username, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [System.Security.SecureString] $Password, [Parameter()] [string] $Domain, [Parameter()] [Int] $AutoLogonCount, [Parameter()] [switch...
combined_dataset/train/non-malicious/4079.ps1
4079.ps1
Clear-Host Add-Type -AssemblyName System.Windows.Forms $PowershellConsole = (Get-Host).UI.RawUI $PowershellConsole.WindowTitle = "Secure Screen Stopper" $button = $null $Global:MainProcess $Global:RelativePath $Global:MMProcess Function GetRelativePath{ $Global:RelativePath=(split-path $SCRIPT:MyInvocation.MyCom...
combined_dataset/train/non-malicious/784.ps1
784.ps1
function Test-ScriptExtent { [OutputType([bool], ParameterSetName='__AllParameterSets')] [OutputType([System.Management.Automation.Language.IScriptExtent], ParameterSetName='PassThru')] [CmdletBinding()] param( [Parameter(Position=0, ValueFromPipeline, ValueFromPipelineByPropertyName)]...
combined_dataset/train/non-malicious/Get-FileTail 1.0.ps1
Get-FileTail 1.0.ps1
#.Synopsis # Show the last n lines of a text file #.Description # This is just a tail script for PowerShell, using seekable streams to avoid reading the whole file and using v2 eventing to detect changes and provide a -Continuous mode. #.Parameter Name # The file name to tail #.Parameter Lines # The number ...
combined_dataset/train/non-malicious/2721.ps1
2721.ps1
Get-WmiObject Win32_Product