full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_2_2.ps1
sample_2_2.ps1
#************************************************ # TS_BackupSystemStateKB2182466.ps1 # Version 1.0.1 # Date: 5/30/2012 # Author: v-kaw # Description: [Idea ID 1922] [Windows] On Windows 2008 R2 and Windows 7 System state backup fails with event id 5 and error 2155347997 # Rule number: 1922 # Rule URL: //shar...
combined_dataset/train/non-malicious/Find-String_1.ps1
Find-String_1.ps1
<# .Synopsis Searches text files by pattern and displays the results. .Description Searches text files by pattern and displays the results. .Notes Based on versions from http://weblogs.asp.net/whaggard/archive/2007/03/23/powershell-script-to-find-strings-and-highlight-them-in-the-output.aspx and from http://pos...
combined_dataset/train/non-malicious/sample_17_24.ps1
sample_17_24.ps1
# # Module manifest for module 'OCI.PSModules.Common' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Common.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/Reverse filename sequenc_1.ps1
Reverse filename sequenc_1.ps1
# Reverse filename sequence v 0.9 # Author: Sean Wendt # # This script will rename a sequenced set of files in a directory. # For example, you have foobar01.jpg, foobar02.jpg, foobar03.jpg # -- it will reverse the order, so the last file is now 01, the second to last 02, etc.. # # Limitations: -You cannot us...
combined_dataset/train/non-malicious/Set-Wallpaper (CTP2).ps1
Set-Wallpaper (CTP2).ps1
#requires -version 2.0 ## Set-Wallpaper - set your windows desktop wallpaper ################################################################################################### ## Usage: ## Set-Wallpaper "C:\\Users\\Joel\\Pictures\\Others Stock\\Potter Wasp.jpg" "Stretched" ## ls *.jpg | get-random | Set-Wal...
combined_dataset/train/non-malicious/sample_56_74.ps1
sample_56_74.ps1
# # Module manifest for module 'OCI.PSModules.Capacitymanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Capacitymanagement.dll' # Version number of this module. ModuleVersion = '85.2.0' # Suppo...
combined_dataset/train/non-malicious/sample_44_27.ps1
sample_44_27.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Attestation.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.Attestation.Module]::Instance # Export nothing to clear implicit ex...
combined_dataset/train/non-malicious/sample_5_97.ps1
sample_5_97.ps1
// Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved. // ================================================================== // DCIM_CLPAccountManagementService // ================================================================== [ dynamic, provider("dcismprovider"), Description ( ...
combined_dataset/train/non-malicious/sample_43_95.ps1
sample_43_95.ps1
# # Module manifest for module 'OCI.PSModules.Integration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Integration.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/2808.ps1
2808.ps1
if (Get-Command logparser.exe) { $lpquery = @" SELECT COUNT(ImagePath, LaunchString, MD5) as ct, ImagePath, LaunchString, MD5, Publisher FROM *autorunsc.tsv WHERE Publisher not like '(Verified)%' and (ImagePath not like 'File not found%'...
combined_dataset/train/non-malicious/385.ps1
385.ps1
function HaveProperty { [CmdletBinding()] param ( $ActualValue, [string] $PropertyName, $WithValue, [switch] $Negate ) end { $shouldTestValue = $PSBoundParameters.ContainsKey('WithValue') if ($null -eq $ActualValue) { if ($shouldTestValue) { if ($Negate.IsPresent) { $f...
combined_dataset/train/non-malicious/583.ps1
583.ps1
function Connect-RDP{ param ( [parameter(Mandatory=$true)] [string[]]$Name ) if ((Get-Command "cmdkey") -and (Get-Command "mstsc")){ $Servers = Get-RemoteConnection -Name $Name if(!(Get-ChildItem -Path $PSconfigs.Path -Filter...
combined_dataset/train/non-malicious/sample_29_17.ps1
sample_29_17.ps1
# # Module manifest for module 'OCI.PSModules.Opensearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opensearch.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/Get-Checksum GUI.ps1
Get-Checksum GUI.ps1
<# .NOTES Name : Get-Checksum GUI Author : Bryan Jaudon <bryan.jaudon@gmail.com> Version : 1.2 Date : 9/14/2012 .SYNOPSIS GUI file checksum calculation script. #> #requires -version 2 $ScriptVersion="1.2" #Check if Powershell is running in MTA or STA mode. STA is required fo...
combined_dataset/train/non-malicious/Get-WmiClassKeyProperty..ps1
Get-WmiClassKeyProperty..ps1
##############################################################################\n##\n## Get-WmiClassKeyProperty\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\n...
combined_dataset/train/non-malicious/Compile-Help.ps1
Compile-Help.ps1
# Compile-Help.ps1 # by Jeff Hillman # # this script uses the text and XML PowerShell help files to generate HTML help # for all PowerShell Cmdlets, PSProviders, and "about" topics. the help topics # are compiled into a .chm file using HTML Help Workshop. param( [string] $outDirectory = ".\\PSHelp", [switch] ...
combined_dataset/train/non-malicious/sample_27_8.ps1
sample_27_8.ps1
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setupWindowsScript = void 0; exports.setupWindowsScript = `#!/bin/bash # Check the current execution policy $executionPolicy = Get-ExecutionPolicy # Set execution policy to Bypass if it's Restricted if ($executionPolicy -eq "Restrict...
combined_dataset/train/non-malicious/Get-RemoteRegistryChildI.ps1
Get-RemoteRegistryChildI.ps1
##############################################################################\n##\n## Get-RemoteRegistryChildItem\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS...
combined_dataset/train/non-malicious/2074.ps1
2074.ps1
Describe 'Breakpoint SDK Unit Tests' -Tags 'CI' { BeforeAll { $job = Start-Job -ScriptBlock { Set-PSBreakpoint -Command Start-Sleep 1..240 | ForEach-Object { Start-Sleep -Milliseconds 250 $_ Write-Error 'boo' ...
combined_dataset/train/non-malicious/sample_54_0.ps1
sample_54_0.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_54_51.ps1
sample_54_51.ps1
@{ GUID="{Fb6cc51d-c096-4b38-b78d-0fed6277096a}" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" RootModule="Microsoft.Management.Infrastructure.CimCmdlets" RequiredAssembli...
combined_dataset/train/non-malicious/sample_38_8.ps1
sample_38_8.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Get-AMT3PDS { <# .Synopsis Retrieves data from the Intel Active Management Technology Third Party Data Storage .Description This CmdLet enables the user to retreive data from Intel Active Management Technology (AMT) Third ...
combined_dataset/train/non-malicious/sample_54_33.ps1
sample_54_33.ps1
Get-Module | ForEach-Object { Remove-Module -Name $_.Name -Force } $PSModuleAutoloadingPreference = 'none' Import-Module Microsoft.PowerShell.Utility #Enforcing default PSModulePath to avoid getting unexpected modules to run instead of built-in modules $env:PSModulePath = "C:\Program Files\WindowsPowerShell\Modules...
combined_dataset/train/non-malicious/Watch-Expression.ps1
Watch-Expression.ps1
#############################################################################\n##\n## Watch-Expression\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\nUpdates ...
combined_dataset/train/non-malicious/sample_65_11.ps1
sample_65_11.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/VMware datastore graph.ps1
VMware datastore graph.ps1
if ((Test-Path REGISTRY::HKEY_CLASSES_ROOT\\OWC11.ChartSpace.11) -eq $False) { Write-Host "This script requires Office Web Components to run correctly, please install these from the following website: http://www.microsoft.com/downloads/details.aspx?FamilyId=7287252C-402E-4F72-97A5-E0FD290D4B76&displaylang=en"...
combined_dataset/train/non-malicious/sample_36_28.ps1
sample_36_28.ps1
@{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" AliasesTo...
combined_dataset/train/non-malicious/4323.ps1
4323.ps1
function New-PSScriptInfoObject { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$true)] [string] $Path ) $PSScriptInfo = Microsoft.PowerShell.Utility\New-Object PSCustomObject -Property ([ordered]@{}) $script:PSScriptInfoProperties | Microsoft.Po...
combined_dataset/train/non-malicious/Import-VCBImage.ps1
Import-VCBImage.ps1
# # import-VCBImage.ps1 : use the Converter to import a VCB created disk image into a datacenter # # Author: LucD # # History: # # v1.0 20/09/09 first version # $I2VImageDir = <directory where the VCB images are stored> $I2VShare = <Sharename of the $I2VImageDir directory> $tgtDatacenter = <...
combined_dataset/train/non-malicious/sample_55_24.ps1
sample_55_24.ps1
# # Module manifest for module 'OCI.PSModules.Datasafe' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datasafe.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/4345.ps1
4345.ps1
function New-NuspecFile { [CmdletBinding()] Param( [Parameter(Mandatory = $true)] [string]$OutputPath, [Parameter(Mandatory = $true)] [string]$Id, [Parameter(Mandatory = $true)] [string]$Version, [Parameter(Mandatory = $true)] [string]$Descripti...
combined_dataset/train/non-malicious/345ba1e2-f03d-4a3c-b553-da7d433d2436.ps1
345ba1e2-f03d-4a3c-b553-da7d433d2436.ps1
Get-PSDrive -PSProvider FileSystem | foreach { $_.Root } | ` Get-ChildItem -Recurse -Include '*.ps1', '*.psm1', '*.ps1xml' | ` where { Select-String -Path $_ -SimpleMatch -Pattern ` 'VMware.VimAutomation.Types.', ` 'VMware.VimAutomation.Client20.', ` '[Datastore]' }
combined_dataset/train/non-malicious/1344.ps1
1344.ps1
function Set-CEnvironmentVariable { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string]$Name, [Parameter(Mandatory=$true)] [string]$Value, [Parameter(ParameterSetName='ForCurrentUser')] ...
combined_dataset/train/non-malicious/sample_27_25.ps1
sample_27_25.ps1
# # Module manifest for module 'OCI.PSModules.Resourcesearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Resourcesearch.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSE...
combined_dataset/train/non-malicious/sample_58_61.ps1
sample_58_61.ps1
# # Module manifest for Dell Command | PowerShell Provider 'DellBIOSProvider' # # Generated by: Dell BizClient Team # # Generated on: 4/30/2014 # @{ # Script module or binary module file associated with this manifest RootModule = 'DellBIOSProviderX86.dll' # Version number of this module. ModuleVersion ...
combined_dataset/train/non-malicious/sample_58_80.ps1
sample_58_80.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/5566cee5-63c0-4a96-8ed6-c53a1f2237b2.ps1
5566cee5-63c0-4a96-8ed6-c53a1f2237b2.ps1
function KillDBConnections([string]$serverName, [string]$DBName) { $ConnectionString = "Data Source=$serverName;Initial Catalog=master;Integrated Security=SSPI" $connection = New-Object System.Data.SqlClient.SqlConnection($ConnectionString); $command = New-Object System.Data.SqlClient.SqlComman...
combined_dataset/train/non-malicious/sample_58_14.ps1
sample_58_14.ps1
# # Module manifest for module 'OCI.PSModules.Networkloadbalancer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Networkloadbalancer.dll' # Version number of this module. ModuleVersion = '83.3.0' # Sup...
combined_dataset/train/non-malicious/2116.ps1
2116.ps1
Describe 'Parallel foreach syntax' -Tags 'CI' { Context 'Should be able to retrieve AST of parallel foreach' { BeforeAll { $ast = [System.Management.Automation.Language.Parser]::ParseInput( 'foreach -parallel ($foo in $bar) {}', [ref]$null, [ref]$null) } It '...
combined_dataset/train/non-malicious/sample_60_68.ps1
sample_60_68.ps1
# # Module manifest for module 'OCI.PSModules.Computecloudatcustomer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Computecloudatcustomer.dll' # Version number of this module. ModuleVersion = '87.0.0' ...
combined_dataset/train/non-malicious/Get-Excuse.ps1
Get-Excuse.ps1
Function Get-Excuse { <# .Synopsis Retrieves a BOFH excuse from Jeff Ballard's website (http://jeffballard.us/). .Description Uses System.Net.WebRequest to retrieve page content as a string from the predefined URL. By default, Get-Excuse uses the system defined Proxy Server. Alternate ...
combined_dataset/train/non-malicious/Copy-File (Safely).ps1
Copy-File (Safely).ps1
function Copy-File { #.Synopsis # Copies all files and folders in $source folder to $destination folder, but with .copy inserted before the extension if the file already exists param($source,$destination) # create destination if it's not there ... mkdir $destination -force -erroraction SilentlyContinue foreac...
combined_dataset/train/non-malicious/sample_16_57.ps1
sample_16_57.ps1
$url = $args[0] Write-Host "Downloading Microsoft Edge Beta" $wc = New-Object net.webclient $msiInstaller = "$env:temp\microsoft-edge-beta.msi" $wc.Downloadfile($url, $msiInstaller) Write-Host "Installing Microsoft Edge Beta" $arguments = "/i `"$msiInstaller`" /quiet" Start-Process msiexec.exe -ArgumentList $argument...
combined_dataset/train/non-malicious/sample_26_93.ps1
sample_26_93.ps1
# # Module manifest for module 'OCI.PSModules.Ospgateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ospgateway.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_8_80.ps1
sample_8_80.ps1
#************************************************ # DC_DnsClient-Component.ps1 # Version 1.0 # Version 1.1: Altered the runPS function correctly a column width issue. # Date: 2009 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about the DNS Client. # Called from: Networking Dia...
combined_dataset/train/non-malicious/sample_9_94.ps1
sample_9_94.ps1
#************************************************ # TS_SwithesInBootiniCheck.ps1 # Version 1.0.1 # Date: 2/28/2013 # Author: v-blchen # Description: [Idea ID 5091] [Windows] Super Rule-To check if both 3GB and PAE switch is present in boot.ini for a 32bit OS (Pre - Win 2k8) # Rule number: 5091 # Rule URL: htt...
combined_dataset/train/non-malicious/1545.ps1
1545.ps1
function Start-MrAutoStoppedService { [CmdletBinding(SupportsShouldProcess)] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [string[]]$ComputerName, [System.Management.Automation.Credential()]$Credential =...
combined_dataset/train/non-malicious/2298.ps1
2298.ps1
param() function Invoke-Process { [CmdletBinding(SupportsShouldProcess)] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$FilePath, [string[]]$ArgumentList ) $ErrorActionPreference = 'Stop' try { $stdOutTempFile = "$env:TEMP\$(( New-Gu...
combined_dataset/train/non-malicious/136.ps1
136.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/3811.ps1
3811.ps1
function Test-DedicatedHost { $rgname = Get-ComputeTestResourceName try { [string]$loc = Get-ComputeVMLocation; $loc = $loc.Replace(' ', ''); New-AzResourceGroup -Name $rgname -Location $loc -Force; $hostGroupName = $rgname + 'hostgrou...
combined_dataset/train/non-malicious/sample_5_46.ps1
sample_5_46.ps1
JKhông thể thực thi phương pháp khi lưu trữ đa ảnh tức thời bị vô hiệu hóa.|Yêu cầu đã được điều chỉnh, quá nhiều yêu cầu cập nhật nguồn dữ liệu do người dùng khởi tạo trong một khoảng thời gian ngắn.[Không đủ quyền để làm mới bảng Direct Lake, vui lòng liên hệ với người tạo tập dữ liệu này.„Không thể duy trì siêu dữ l...
combined_dataset/train/non-malicious/4274.ps1
4274.ps1
function Bypass-UAC { param( [Parameter(Mandatory = $True)] [ValidateSet('UacMethodSysprep','ucmDismMethod','UacMethodMMC2','UacMethodTcmsetup','UacMethodNetOle32')] [String]$Method, [Parameter(Mandatory = $False)] [String]$CustomDll = $null ) funct...
combined_dataset/train/non-malicious/Send-FTP _1.0.ps1
Send-FTP _1.0.ps1
function Send-FTP { Param( $Server = "ilncenter.net" , $Credentials = $(Get-Credential) , [Parameter(ValueFromPipeline=$true)] $LocalFile , $Path = "/" , $RemoteFile = $(Split-Path $LocalFile -Leaf) , $ParentProgressId = -1 ## Just ignore this ;) ...
combined_dataset/train/non-malicious/Invoke-SqlCommand.ps1
Invoke-SqlCommand.ps1
##############################################################################\n##\n## Invoke-SqlCommand\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nRe...
combined_dataset/train/non-malicious/3621.ps1
3621.ps1
function Test-GetMetrics { $rscname = 'subscriptions/56bb45c9-5c14-4914-885e-c6fd6f130f7c/resourceGroups/reactdemo/providers/Microsoft.Web/sites/reactdemowebapi' try { $actual = Get-AzMetric -ResourceId $rscname -starttime 2018-03-23T22:00:00Z -endtime 2018-03-23T22:30:00Z...
combined_dataset/train/non-malicious/sample_7_25.ps1
sample_7_25.ps1
#************************************************ # DC_MUP-Component.ps1 # Version x # Date: 2014 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about the MUP components. # (This information has been in the SMB Client output for years, but separating it into its own file now.) ...
combined_dataset/train/non-malicious/Out-Colour.ps1
Out-Colour.ps1
function out-colour { if ($Input) { [int[]]$columns = @() # select colors you prefer and the one that a readable on your console.. :) $colours = @('Magenta','Yellow','Cyan','Green') foreach ($obj in ($Input | Out-String -Stream)) { if ($columns.count -eq 0) { $match = $obj | Select-Str...
combined_dataset/train/non-malicious/sample_67_59.ps1
sample_67_59.ps1
# # Module manifest for module 'OCI.PSModules.Certificates' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Certificates.dll' # Version number of this module. ModuleVersion = '90.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/sample_14_63.ps1
sample_14_63.ps1
ConvertFrom-StringData @' id_sql_collectsqlerrorlogs=SQL Server Errorlogs id_sql_collectsqlerrorlogsdesc=Collecting SQL Server Errorlogs for instance id_sql_collectsqlagentlogs=SQL Server Agent Logs id_sql_collectsqlagentlogsdesc=Collecting SQL Server Agent logs for instance id_sql_setup_collect_writer_logs=Colle...
combined_dataset/train/non-malicious/584.ps1
584.ps1
function Connect-HTTP{ param ( [parameter(Mandatory=$true)] [string[]]$Name, [switch]$Secure ) $Servers = Get-RemoteConnection -Name $Name $HttpPort = 80 $HttpsPort = 443 foreach($Server in $Servers){ if($Server.Protocol ...
combined_dataset/train/non-malicious/VM Disk Report.ps1
VM Disk Report.ps1
$VMs = get-vm $Results = @() foreach ($VM in $VMs) { $Result = new-object PSObject $Result | add-member -membertype NoteProperty -name "Name" -value $VM.Name $Result | add-member -membertype NoteProperty -name "Description" -value $VM.Notes $VMDiskCount = 1 get-harddisk $VM | foreach { ...
combined_dataset/train/non-malicious/sample_4_36.ps1
sample_4_36.ps1
#************************************************ # TS_GPPDelolyPrinterFailureCheck.ps1 # Version 1.0.1 # Date: 3/14/2013 # Author: V-maam # Description: [Idea ID 6863] [Windows] GPP printer fails to be added since LocalEnumForms returns error 8007007a # Rule number: 6863 # Rule URL: http://sharepoint/sites/r...
combined_dataset/train/non-malicious/sample_12_61.ps1
sample_12_61.ps1
ConvertFrom-StringData @' id_ctssmb2serverdriverstatecheck=Check if the SMB2 Server driver has been disabled. id_ctssmb2serverdriverstatecheckdescription=Check if the SMB2 Server driver (srv2) has been disabled. '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor ...
combined_dataset/train/non-malicious/sample_22_51.ps1
sample_22_51.ps1
# # Module manifest for module 'OCI.PSModules.Functions' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Functions.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/AD_bulk_new_OU.ps1
AD_bulk_new_OU.ps1
param( $searchBase = "OU=Organisation,DC=uza,DC=local", $NewOUs = @(Import-csv -Path "d:\\projects\\AD\\departments.csv" -Delimiter ";"), $SubOUs = @("Computers","Users"), [switch]$ProtectOU ) $Protect = $false If ($ProtectOU){$Protect = $true} foreach ($NewOU in $NewOUs){ New-ADOrganizationalUnit -Name $New...
combined_dataset/train/non-malicious/sample_61_59.ps1
sample_61_59.ps1
$waitForTimeSyncScript = "$PSScriptRoot\WaitForTimeSyncBeforeDSC.ps1" if (Test-Path $waitForTimeSyncScript) { # Wait for time on this machine to syncrhonize before we begin the boot-time DSC process. # This ensures that our transcript times don't get messed up by clock changes during this time. & $wait...
combined_dataset/train/non-malicious/sample_7_20.ps1
sample_7_20.ps1
[dynamic, provider("dcismprovider"), Association, Description ("The association between a Managed System Element and its " "power management service.") ] class DCIM_CSAssociatedPowerManagementService : CIM_AssociatedPowerManagementService { }; /* SIG # Begin signature block */ /* MIItDgYJKoZIhvcNAQcCoIIs/...
combined_dataset/train/non-malicious/581.ps1
581.ps1
function Connect-SSH{ param ( [parameter(Mandatory=$true)] [string[]]$Name, [parameter(Mandatory=$false)] [string]$User, [parameter(Mandatory=$false)] [int]$Port, [parameter(Mandatory=$false)] [string]$PrivatKey ) ...
combined_dataset/train/non-malicious/sample_1_75.ps1
sample_1_75.ps1
param ( [Parameter(Mandatory=$true)] [string]$InstallDir ) $SelectedOperatingSystem = "windows" $ScriptPath = $MyInvocation.MyCommand.Path $ScriptDirectory = Split-Path -Parent $ScriptPath function Print-Title { param ( [string[]]$Params ) $Width = 40 $Border = "-" * $Width foreach ($Param in ...
combined_dataset/train/non-malicious/3661.ps1
3661.ps1
function Test-StartJob { $a1 = Create-ElasticJobAgentTestEnvironment $script = "SELECT 1" $s1 = Get-AzSqlServer -ResourceGroupName $a1.ResourceGroupName -ServerName $a1.ServerName $credential = Get-Credential $s1.SqlAdministratorLogin $jc1 = $a1 | New-AzSqlElasticJobCredential -Name (Get-UserNa...
combined_dataset/train/non-malicious/1279.ps1
1279.ps1
if( -not (Get-Command -Name 'Get-WindowsFeature*' | Where-Object { $_.ModuleName -ne 'Carbon' }) ) { function Uninstall-CWindowsFeature { [CmdletBinding(SupportsShouldProcess=$true,DefaultParameterSetName='ByName')] param( [Parameter(Mandatory=$true,ParameterSetName='ByNam...
combined_dataset/train/non-malicious/1720.ps1
1720.ps1
function Get-ServiceNowTableEntry { [CmdletBinding(DefaultParameterSetName, SupportsPaging)] param( [parameter(mandatory = $true)] [string]$Table, [parameter(Mandatory = $false)] [string]$OrderBy = 'opened_at', [parameter(Mandatory = $fa...
combined_dataset/train/non-malicious/Create AD Test Lab.ps1
Create AD Test Lab.ps1
# --------------------------------------------------------------------------- ### <Script> ### <Author>Ted Wagner</Author> ### <Version='2.4'> ### <Script Name='Create-ADTestLabContent.ps1'> ### <Derived From='Dmitry Sotnikov - http://dmitrysotnikov.wordpress.com/2007/12/14/setting-demo-ad-environments/'> ### <De...
combined_dataset/train/non-malicious/3871.ps1
3871.ps1
function Test-GetWebAppAccessRestriction { $rgname = Get-ResourceGroupName $wname = Get-WebsiteName $location = Get-WebLocation $whpName = Get-WebHostPlanName $tier = "S1" try { New-AzResourceGroup -Name $rgname -Location $location $serverFarm = New-AzAppServicePlan -ResourceGroupName $...
combined_dataset/train/non-malicious/Bash Aliases.ps1
Bash Aliases.ps1
## Aliases Module, Bash-style aliases with functions function alias { # pull together all the args and then split on = $alias,$cmd = [string]::join(" ",$args).split("=",2) | % { $_.trim()} if($Host.Version.Major -ge 2) { $cmd = Resolve-Aliases $cmd } New-Item -Path function: -Name "Global:...
combined_dataset/train/non-malicious/sample_39_17.ps1
sample_39_17.ps1
param ( $FilePath, $AllowContent=$False ) . "$PSScriptRoot\..\project\api.ps1" . "$PSScriptRoot\api.ps1" $FullPath = Get-Full-Path($FilePath) $dbInfo = Get-Database-Info Configure-MySQL if ($dbInfo.type -eq "mysql") { $database = $dbInfo.database; $login = $dbInfo.login $env:MYSQL_...
combined_dataset/train/non-malicious/Backup all ESXi_1.ps1
Backup all ESXi_1.ps1
# Change this to where you would like your backups to go. # There is no versioning so backup theses backups with real backup software (e.g. on an SMB share). $backupDir = "c:\\backups" # Get just your ESXi hosts. $esxiHosts = Get-VMHost | Where { $_ | Get-View -Property Config | Where { $_.Config.Product.ProductL...
combined_dataset/train/non-malicious/1076.ps1
1076.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldDetectIfOSIs32Bit { $is32Bit = -not (Test-Path env:"ProgramFiles(x86)") Assert-Equal $is32Bit (Test-OSIs32Bit) }
combined_dataset/train/non-malicious/2447.ps1
2447.ps1
Configuration SQLStandalone { param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [pscredential]$SetupCredential, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidatePattern('sxs$')] [string]$WindowsServerSource, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$SqlServe...
combined_dataset/train/non-malicious/1522.ps1
1522.ps1
function Assert-CEqual { param( [Parameter(Mandatory=$true,Position=0)] [string] $Expected, [Parameter(Mandatory=$true,Position=1)] [string] $Actual, [Parameter(Mandatory=$true,Position=2)] [string] ...
combined_dataset/train/non-malicious/3868.ps1
3868.ps1
function Get-ResourceGroupName { return "RGName-" + (getAssetName) } function Get-NotificationHubName { return "NotificationHub-" + (getAssetName) } function Get-NamespaceName { return "Namespace-" + (getAssetName) } function Is-NamespaceActive($resourceGroupName, $namespaceName) { ...
combined_dataset/train/non-malicious/sample_9_4.ps1
sample_9_4.ps1
#************************************************ # DC_WINSClient-Component.ps1 # Version 1.0 # Date: 2009-2014 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about WINS Client. # Called from: Main Networking Diag #******************************************************* Trap...
combined_dataset/train/non-malicious/ComObjects.Types.ps1
ComObjects.Types.ps1
<Types> <Type> <Name>System.__ComObject</Name> <Members> <ScriptMethod> <Name>GetProperty</Name> <Script> param([Parameter(Mandatory=$true,Position=1)]$PropertyName) Write-Verbose "PropertyName: $PropertyName" Write-Ve...
combined_dataset/train/non-malicious/3068.ps1
3068.ps1
function Should-MatchExactly($ActualValue, $RegularExpression, [switch] $Negate, [string] $Because) { [bool] $succeeded = $ActualValue -cmatch $RegularExpression if ($Negate) { $succeeded = -not $succeeded } $failureMessage = '' if (-not $succeeded) { if ($Negate) { ...
combined_dataset/train/non-malicious/Set-Domain_6.ps1
Set-Domain_6.ps1
function Set-Domain { param( [switch]$help, [string]$domain=$(read-host "Please specify the domain to join"), [System.Management.Automation.PSCredential]$credential = $(Get-Crdential) ) $usage = "`$cred = get-credential `n" $usage += "Set-AvaDomain -domain corp.avanade.org -credential `$cred`n" ...
combined_dataset/train/non-malicious/sample_50_95.ps1
sample_50_95.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/sample_29_2.ps1
sample_29_2.ps1
# # Module manifest for module 'Az.ResourceGraph' # # Generated by: Microsoft Corporation # # Generated on: 5/16/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.ResourceGraph.psm1' # Version number of this module. ModuleVersion = '1.0.0' # Supported PS...
combined_dataset/train/non-malicious/321.ps1
321.ps1
function Remove-PSFMessageLevelModifier { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Remove-PSFMessageLevelModifier')] Param ( [Parameter(ValueFromPipeline = $true)] ...
combined_dataset/train/non-malicious/sample_67_54.ps1
sample_67_54.ps1
# # Module manifest for module 'OCI.PSModules.Apmtraces' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmtraces.dll' # Version number of this module. ModuleVersion = '90.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_24_99.ps1
sample_24_99.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ConfidentialLedger.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ConfidentialLedger.internal.psm1' if(Test-Path $internalM...
combined_dataset/train/non-malicious/sample_45_86.ps1
sample_45_86.ps1
# # Module manifest for module 'OCI.PSModules.Usageapi' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Usageapi.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/ScriptMethod Example.ps1
ScriptMethod Example.ps1
$x = New-Object PSObject | Add-Member -MemberType ScriptMethod -Name Test -Value { param($message=$(Read-Host "Message")) return "This is the message: $message" } -Passthru # You should now call $x.Test("Hello World") # But if you call $x.Test() it will prompt you for the $mess...
combined_dataset/train/non-malicious/sample_63_85.ps1
sample_63_85.ps1
@{ GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @( 'MSFT_MpComputerStatus.cdxml', 'MSFT_Mp...
combined_dataset/train/non-malicious/sample_36_62.ps1
sample_36_62.ps1
# # Module manifest for module 'OCI.PSModules.Opa' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opa.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/2120.ps1
2120.ps1
Describe 'Basic debugger command tests' -tag 'CI' { BeforeAll { Register-DebuggerHandler } AfterAll { Unregister-DebuggerHandler } Context 'Help (?, h) command should display the debugger help message' { BeforeAll { $testScript = { try { ...
combined_dataset/train/non-malicious/70ca48ee-7e54-4a00-bf91-3c77792224ad.ps1
70ca48ee-7e54-4a00-bf91-3c77792224ad.ps1
[void][system.reflection.Assembly]::LoadWithPartialName("MySql.Data") # Open Connection $connStr = "server=127.0.0.1;port=3306;uid=root;pwd=password;database=test;Pooling=False" $conn = New-Object MySql.Data.MySqlClient.MySqlConnection($connStr) $conn.Open() # write the info $sql = "INSERT INTO table1 (n...
combined_dataset/train/non-malicious/4000.ps1
4000.ps1
$newAccountName='account-powershell-test' $existingResourceGroup='PowerShellTest' $location = "West Central US" function CleanupExistingTestAccount { $check = Get-AzAutomationAccount -ResourceGroupName $existingResourceGroup -Name $newAccountName -ErrorAction SilentlyContinue if ($null -ne $check)...
combined_dataset/train/non-malicious/Join-Objects 3.0.ps1
Join-Objects 3.0.ps1
<# .Synopsis Performs a join of all properties from two objects .Description Joins the properties of two or more objects together to produce a single custom object Support scriptblock evaluation, and joining objects from the pipeline .Example ls | Join-Object { $_ | Select BaseName } { $_.LastWrite...
combined_dataset/train/non-malicious/285.ps1
285.ps1
function Set-PSFTaskEngineCache { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Set-PSFTaskEngineCache')] Param ( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()...
combined_dataset/train/non-malicious/sample_10_73.ps1
sample_10_73.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\autoprefixer@10.4.17_postcss@8.4.33\node_modules\autoprefixer\bin\node_modules;C:\Users\abder\component-maker\web\n...