full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_19_92.ps1
sample_19_92.ps1
# # Module manifest for module 'OCI.PSModules.Events' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Events.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/OpsMgr State Changes.ps1
OpsMgr State Changes.ps1
# Description: State Changes for specified OpsMgr Monitor # Date: 09-12-2009 # Author: Stefan Stranger # Explanation: If you want to know the State Changes for a specific Monitor you can run the next PowerShell script # You need to have db permissions to the OperationsManagerdw databa...
combined_dataset/train/non-malicious/sample_36_0.ps1
sample_36_0.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/sample_63_56.ps1
sample_63_56.ps1
# # Module manifest for module 'OCI.PSModules.Governancerulescontrolplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Governancerulescontrolplane.dll' # Version number of this module. ModuleVersion =...
combined_dataset/train/non-malicious/sample_27_22.ps1
sample_27_22.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("embedMedia", "bool", true); } else { command.get...
combined_dataset/train/non-malicious/sample_58_22.ps1
sample_58_22.ps1
# # Module manifest for module 'OCI.PSModules.Jmsjavadownloads' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported...
combined_dataset/train/non-malicious/3025.ps1
3025.ps1
function New-Fixture { param ( [String]$Path = $PWD, [Parameter(Mandatory = $true)] [String]$Name ) $Name = $Name -replace '.ps1', '' $scriptCode = "function $Name {$([System.Environment]::NewLine)$([System.Environment]::NewLine)}" $testCode = '$here = Spli...
combined_dataset/train/non-malicious/sample_10_78.ps1
sample_10_78.ps1
#************************************************ # DC_Setup_AppCompat.ps1 # Version 1.0 # Date: 2009-2019 # Author: Walter Eder (waltere@microsoft.com) # Description: Collects additional AppCompat information. # Called from: TS_AutoAddCommands_Setup.ps1 #******************************************************* ...
combined_dataset/train/non-malicious/1990.ps1
1990.ps1
Describe "New-CimSession" -Tag @("CI","RequireAdminOnWindows") { BeforeAll { $sessions = @() } AfterEach { $sessions | Remove-CimSession -ErrorAction SilentlyContinue $sessions = @() } It "A cim session can be created" -Pending:(-not $IsWindows) { $sessio...
combined_dataset/train/non-malicious/Add-NetworkPrinter.ps1
Add-NetworkPrinter.ps1
###########################################################################" # # NAME: Add-NetworkPrinter.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # # COMMENT: Windows PowerShell script to map a network printer based on Active Directory group membership. # The get-GroupMembers...
combined_dataset/train/non-malicious/Remove-FTPFile_1.ps1
Remove-FTPFile_1.ps1
function Remove-FTPFile ($Source,$UserName,$Password) { #Create FTP Web Request Object to handle connnection to the FTP Server $ftprequest = [System.Net.FtpWebRequest]::Create($Source) # set the request's network credentials for an authenticated connection $ftprequest.Credentials = New-Object System.N...
combined_dataset/train/non-malicious/1501.ps1
1501.ps1
function Assert-FileDoesNotExist { [CmdletBinding()] param( [Parameter(Position=0)] [string] $Path, [Parameter(Position=1)] [string] $Message ) Set-StrictMode -Version 'Latest' if( Test-Path -Path $Path -PathType...
combined_dataset/train/non-malicious/sample_36_39.ps1
sample_36_39.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_2_29.ps1
sample_2_29.ps1
#************************************************ # DC_SmbClient-Component.ps1 # Version 1.1 # Date: 2009-2019 # Author: Boyd Benson (bbenson@microsoft.com) +WalterE # Description: Collects information about the SMB Client. # Called from: Main Networking Diag, etc. #**********************************************...
combined_dataset/train/non-malicious/sample_32_90.ps1
sample_32_90.ps1
[CmdletBinding()] param ( [string]$OutFile, [string]$AltDownload, [string]$Proxy, [string]$AltHisEndpoint ) $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' $refVersion = [version] '4.5' $provider = 'Microsoft.HybridCompute' # Error codes used by azcmagent are in r...
combined_dataset/train/non-malicious/sample_61_6.ps1
sample_61_6.ps1
<# .SYNOPSIS Scenario module for collecting Microsoft Remote Desktop input method related data .DESCRIPTION Collect input method related troubleshooting data .NOTES Author : Robert Klemencz Requires : MSRD-Collect.ps1 Version : See MSRD-Collect.ps1 version Feedback : https://ak...
combined_dataset/train/non-malicious/3149.ps1
3149.ps1
[CmdletBinding()] param( [Parameter( Position=0, HelpMessage='Maximum number of threads at the same time (Default=100)')] [Int32]$Threads=100 ) Begin{ } Process{ [System.Management.Automation.ScriptBlock]$ScriptBlock = { Param( $Parameter1, $Parameter2 ) ...
combined_dataset/train/non-malicious/3360.ps1
3360.ps1
function Assert-Throws { param([ScriptBlock] $script, [string] $message) try { &$script } catch { if ($message -ne "") { $actualMessage = $_.Exception.Message Write-Output ("Caught exception: '$actualMessage'") if ($actualMessage -eq $message) { ...
combined_dataset/train/non-malicious/1707.ps1
1707.ps1
function Update-ServiceNowIncident { Param ( [parameter(mandatory=$true)] [parameter(ParameterSetName='SpecifyConnectionFields', mandatory=$true)] [parameter(ParameterSetName='UseConnectionObject', mandatory=$true)] [parameter(ParameterSetName='SetGlobalAuth', mandator...
combined_dataset/train/non-malicious/1180.ps1
1180.ps1
$iniPath = $null function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { $iniPath = [IO.Path]::GetRandomFileName() $iniContent = @" [section1] option1=value1 option2 = value2 [section2] [section3] option3=v ...
combined_dataset/train/non-malicious/4457.ps1
4457.ps1
function Get-PSResource { [OutputType([PsCustomObject])] [cmdletbinding(SupportsShouldProcess = $true)] Param ( [Parameter(ValueFromPipelineByPropertyName = $true, Position = 0)] [ValidateNotNullOrEmpty()] [String[]] $Name, [Paramete...
combined_dataset/train/non-malicious/sample_10_96.ps1
sample_10_96.ps1
ConvertFrom-StringData @' id_dpm_eventlog_activity=Gathering Eventlogs id_dpm_status_eventlogs=Running DC_DPMEventLogs.ps1 '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAI...
combined_dataset/train/non-malicious/sample_15_5.ps1
sample_15_5.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
combined_dataset/train/non-malicious/892.ps1
892.ps1
$resourceGroupNameSub1 = "<replace-with-your-group-name>" $resourceGroupNameSub2 = "<replace-with-desired-new-group-name>" $webAppNameSub1 = "<replace-with-your-app-name>" $webAppNameSub2 = "<replace-with-desired-new-app-name>" $appServicePlanSub2 = "<replace-with-desired-new-plan-name>" $locationSub2 = "West Europe" ...
combined_dataset/train/non-malicious/3011.ps1
3011.ps1
if (($PSVersionTable.ContainsKey('PSEdition')) -and ($PSVersionTable.PSEdition -eq 'Core')) { & $SafeCommands["Add-Type"] -Path "${Script:PesterRoot}/lib/Gherkin/core/Gherkin.dll" } else { & $SafeCommands["Import-Module"] -Name "${Script:PesterRoot}/lib/Gherkin/legacy/Gherkin.dll" } $GherkinSteps = @{} $Gherki...
combined_dataset/train/non-malicious/sample_26_28.ps1
sample_26_28.ps1
About EMCO SoftwareEMCO UnLock IT 7Copyright © 2001-2024 EMCO. All rights reserved.51Chapter 9: About EMCO SoftwareEMCO creates mission-critical software to manage network computers remotely and automatenetwork administration.Our company was founded in 2001 in Reykjavik, Iceland. Managing Windows networks as networkadm...
combined_dataset/train/non-malicious/2311.ps1
2311.ps1
$userName = 'adbertram@gmail.com' $password = 'Ilikegmail.' Add-Type -Path "C:\Program Files (x86)\Google\Google Data API SDK\Redist\Google.GData.Client.dll" Add-Type -Path "C:\Program Files (x86)\Google\Google Data API SDK\Redist\Google.GData.Extensions.dll" Add-Type -Path "C:\Program Fil...
combined_dataset/train/non-malicious/2428.ps1
2428.ps1
param( [Parameter(Mandatory=$true)][string]$FolderPath, [Parameter(Mandatory=$true)][string]$TfsUrl, [PSCredential]$Credential = (Get-Credential), [switch]$Overwrite = $false ) param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateScript({ if (-not (Test-Path -Path $_ -PathType Container)...
combined_dataset/train/non-malicious/3973.ps1
3973.ps1
function Test-NotFound { $rgLocation = Get-ProviderLocation ResourceManagement $rgName = Get-ResourceGroupName $pipName = Get-ResourceName try { New-AzResourceGroup -Name $rgName -Location $rgLocation Assert-ThrowsLike { Get-AzPublicIpAddress -Resou...
combined_dataset/train/non-malicious/4097.ps1
4097.ps1
[CmdletBinding()] param () function Get-RelativePath { [CmdletBinding()][OutputType([string])] param () $Path = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent) + "\" Return $Path } Function Install-Fonts { Param ([String]$SourceDirectory, [String]$FontType) $FontType = "*." + $FontT...
combined_dataset/train/non-malicious/Add-TnsAdminEntry.ps1
Add-TnsAdminEntry.ps1
param ( [string] $Name = $(Read-Host "Provide a value for parameter 'Name'"), [string] $Protocol = 'TCP', [string] $Hostname = $(Read-Host "Provide a value for parameter 'Hostname'"), [string] $Port = '1521', [string] $Sid = $(Read-Host "Provide a value for parameter 'Sid'"), [System.IO.F...
combined_dataset/train/non-malicious/1442.ps1
1442.ps1
function Install-CIisVirtualDirectory { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $SiteName, [Parameter(Mandatory=$true)] [Alias('Name')] [string] $VirtualPath, [Parameter(Mandatory=$tr...
combined_dataset/train/non-malicious/sample_62_79.ps1
sample_62_79.ps1
# # Copyright 2018-2024 HP Development Company, L.P. # All Rights Reserved. # # NOTICE: All information contained herein is, and remains the property of HP Development Company, L.P. # # The intellectual and technical concepts contained herein are proprietary to HP Development Company, L.P # and may be cove...
combined_dataset/train/non-malicious/sample_34_26.ps1
sample_34_26.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=Det finns redan en miljövariabel med det här namnet och av den här typen. EnvironmentErrorDoesNotExists=Det finns ingen miljövariabel med det här namnet och av den här typen. '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkg...
combined_dataset/train/non-malicious/sample_28_13.ps1
sample_28_13.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/4252.ps1
4252.ps1
function Invoke-Shellcode { [CmdletBinding( DefaultParameterSetName = 'RunLocal', SupportsShouldProcess = $True , ConfirmImpact = 'High')] Param ( [ValidateNotNullOrEmpty()] [UInt16] $ProcessID, [Parameter( ParameterSetName = 'RunLocal' )] [ValidateNotNullOrEmpty()] [Byte[]] $Shellcod...
combined_dataset/train/non-malicious/sample_38_45.ps1
sample_38_45.ps1
function Unzip-Product { if (-Not (Test-Path -Path "\$PSScriptRoot/version.txt")) { \$actualVersion = "" } else { \$actualVersion = Get-Content -Path "\$PSScriptRoot/version.txt" -Raw } if (\$actualVersion -ne "${version}") { Write-Host -NoNewline "Unzipping... " Expand-Archive -Pa...
combined_dataset/train/non-malicious/sample_50_69.ps1
sample_50_69.ps1
# # Module manifest for module 'OCI.PSModules.Keymanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Keymanagement.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_15_37.ps1
sample_15_37.ps1
#************************************************ # TS_ServicingPendingXml.ps1 # Version 1.0.1 # Date: 6/6/2012 # Author: v-alyao # Description: [Idea ID 3472] [Windows] Pending Transactions Rule Idea - Pending.xml # Rule number: 3472 # Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.a...
combined_dataset/train/non-malicious/3200.ps1
3200.ps1
function Invoke-Parallel { [cmdletbinding(DefaultParameterSetName='ScriptBlock')] Param ( [Parameter(Mandatory=$false,position=0,ParameterSetName='ScriptBlock')] [System.Management.Automation.ScriptBlock]$ScriptBlock, [Parameter(Mandatory=$false,ParameterSetName='ScriptFile')] ...
combined_dataset/train/non-malicious/sample_6_39.ps1
sample_6_39.ps1
// Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved. // ================================================================== // DCIM_AccountOnSystem // ================================================================== [dynamic, provider("dcismprovider"), Association, Description ( "D...
combined_dataset/train/non-malicious/2450.ps1
2450.ps1
function Remove-OnlineVM { [CmdletBinding(SupportsShouldProcess)] param ( [Parameter(Mandatory, ValueFromPipeline)] [ValidateNotNullOrEmpty()] [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VirtualMachineImpl[]]$VM ) process { foreach ($v in $VM) { $vmName = $v.Name if ($PSCmdlet.ShouldProcess...
combined_dataset/train/non-malicious/sample_32_88.ps1
sample_32_88.ps1
# # Module manifest for module 'OCI.PSModules.Audit' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Audit.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_15_86.ps1
sample_15_86.ps1
# # Module manifest for module 'OCI.PSModules.Visualbuilder' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Visualbuilder.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_27_18.ps1
sample_27_18.ps1
)이 설정은 네트워크 보호에 대한 DNS TCP 구문 분석을 비활성화합니다.%이 설정은 네트워크 보호에 대한 SSH 구문 분석을 비활성화합니다.i관리자가 특정 채널(링)에서 Microsoft Defender 플랫폼 업데이트를 수신하도록 장치를 구성할 수 있도록 허용 - 고객이 점진적 릴리스 프로세스를 일부 제어할 수 있도록 합니다.베타미리 보기준비됨넓은지연됨h관리자가 특정 채널(링)에서 Microsoft Defender 엔진 업데이트를 수신하도록 장치를 구성할 수 있도록 허용 - 고객이 점진적 릴리스 프로세스를 일부 제어할 수 있도록 합니다.n관리자가 특정 ...
combined_dataset/train/non-malicious/sample_51_61.ps1
sample_51_61.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/sample_57_53.ps1
sample_57_53.ps1
Test-xDscResource..\DSCResources\DCPP_POSTBehavior Test-xDscSchema..\DSCResources\DCPP_POSTBehavior\DCPP_POSTBehavior.schema.mof # SIG # Begin signature block # MIIutQYJKoZIhvcNAQcCoIIupjCCLqICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBA...
combined_dataset/train/non-malicious/Get-Entropy_2.ps1
Get-Entropy_2.ps1
function Get-Entropy { <# .SYNOPSIS Calculate the entropy of a byte array. Author: Matthew Graeber (@mattifestation) .PARAMETER ByteArray Specifies the byte array containing the data from which entropy will be calculated. .EXAMPLE C:\\PS> $RandArray = New-Object Byte[](10000) C...
combined_dataset/train/non-malicious/sample_16_43.ps1
sample_16_43.ps1
# # Module manifest for module 'Microsoft.SME.DeviceManager' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.DeviceManager.psm1' # Version number of this module. ModuleVersion = '4.10.2' # Supported PSEditions # CompatiblePSEditions = @() # ID us...
combined_dataset/train/non-malicious/1118.ps1
1118.ps1
$windowsAuthWasLocked = $false $windowsAuthConfigPath = 'system.webServer/security/authentication/windowsAuthentication' $cgiConfigPath = 'system.webServer/cgi' function Start-TestFixture { & (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { $windowsAu...
combined_dataset/train/non-malicious/New-Zip.ps1
New-Zip.ps1
Function New-Zip { <# .SYNOPSIS Create a Zip File from any files piped in. .DESCRIPTION Requires that you have the SharpZipLib installed, which is available from http://www.icsharpcode.net/OpenSource/SharpZipLib/ .NOTES File Name : PowerZip.psm1 Author : Christophe CREMON (uxone) - http://powershel...
combined_dataset/train/non-malicious/sample_25_67.ps1
sample_25_67.ps1
""" Microsoft certificate management via the PKI Client PowerShell module. https://technet.microsoft.com/en-us/itpro/powershell/windows/pkiclient/pkiclient The PKI Client PowerShell module is only available on Windows 8+ and Windows Server 2012+. https://technet.microsoft.com/en-us/library/hh848636(v=wps.620).aspx :p...
combined_dataset/train/non-malicious/sample_16_29.ps1
sample_16_29.ps1
# Rule ID: 3416 # # Rule checking to see if Power Plan of the server is set to High Performance # # Created: 7/19/2012 # Author: Jonathan Randall #****************************************************************************************************************** Import-LocalizedData -BindingVariable Localized...
combined_dataset/train/non-malicious/1881.ps1
1881.ps1
Describe "Wait-Event" -Tags "CI" { Context "Validate Wait-Event is waiting for events" { It "Should time out when it does not receive a FakeEvent" { $stopwatch = [System.Diagnostics.Stopwatch]::startNew() Wait-Event -Timeout 1 -SourceIdentifier "FakeEvent" $stopwatch.Stop() $stopwatch.ElapsedMillisecond...
combined_dataset/train/non-malicious/1891.ps1
1891.ps1
Describe 'ForEach-Object -Parallel Basic Tests' -Tags 'CI' { BeforeAll { $skipTest = -not $EnabledExperimentalFeatures.Contains('PSForEachObjectParallel') if ($skipTest) { Write-Verbose "Test Suite Skipped. The test suite requires the experimental feature 'PSForEachObjectParallel' t...
combined_dataset/train/non-malicious/sample_10_58.ps1
sample_10_58.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function ConvertFrom-ScriptExtent { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding()] [OutputType([Microsoft.PowerShell.EditorServices.Extensions.IFileRange, Microsoft.PowerShell.Edito...
combined_dataset/train/non-malicious/4202.ps1
4202.ps1
[CmdletBinding()] param ( [string]$LogFileLocation, [string]$LogFileName, [string]$EventLogName, [string]$LogMessage ) Set-Variable -Name Logs -Value $null -Scope Local -Force cls $ReportFile = $LogFileLocation + $LogFileName $LogMessage = [char]42 + $LogMessage + [char]42 $Logs = Get-EventLog -LogName $Eve...
combined_dataset/train/non-malicious/2272.ps1
2272.ps1
function Validate-OS { $ProductType = Get-WmiObject -Namespace "Root\CIMV2" -Class Win32_OperatingSystem | Select-Object -ExpandProperty ProductType if ($ProductType -eq 3) { Load-Form } else { if ($ProductType -eq 2) { $ShellObject = New-Object -ComObject Wscript.Shell $PopupValid...
combined_dataset/train/non-malicious/sample_58_66.ps1
sample_58_66.ps1
# # Module manifest for module 'OCI.PSModules.Loggingingestion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll' # Version number of this module. ModuleVersion = '86.2.0' # Supported...
combined_dataset/train/non-malicious/1581.ps1
1581.ps1
function Get-MrSavedCredential { [CmdletBinding()] param ( [ValidateScript({ If ($_ -notmatch '^\/') { $True } else { Throw "$_ is not valid. Target cannot begin with a forward slash." } })] [string]$Target...
combined_dataset/train/non-malicious/sample_11_65.ps1
sample_11_65.ps1
#region 'Old Code' <# if ($OSVersion.Major -eq 5) { # Disabling running on Win2K3 x64 due some reports of crashes for specific controllers "[San.exe] - Skipping running san.exe on Windows prior to Server 2008" | WriteTo-StdOut } else { Import-LocalizedData -BindingVariable SanStorageInfoStrings Write-Diag...
combined_dataset/train/non-malicious/rss2email.ps1
rss2email.ps1
# --------------------------------------------------------------------------- ### <Script> ### <Author> ### Chad Miller ### </Author> ### <Description> ### Checks an RSS feed and sends the feed information through email if it hasn't ### been seen before. ### </Description> ### <Usage> ### ./rss2email.ps1 'm...
combined_dataset/train/non-malicious/sample_19_91.ps1
sample_19_91.ps1
if (!$Global:SQL:SqlConnConfigFile) { #_# avoid errors when running report a second time in same PS session # SQL Connectivity configuration file New-Variable SQL:SqlConnConfigFile -Value 'App.config' -Option ReadOnly -Scope 'Global' # SQL Connectivity Global XML DOM Object - containing configuration info...
combined_dataset/train/non-malicious/New-Task.ps1
New-Task.ps1
<# .SYNOPSIS Creates a task in Outlook .DESCRIPTION Allows for the creation of tasks in Microsoft Outlook from Windows PowerShell. The majority of task options available can be configured with the function. .LINK http://www.leeholmes.com/blog/GettingThingsDoneOutlookTaskAutomationWithPowerShell.aspx .EXAMPLE C...
combined_dataset/train/non-malicious/4373.ps1
4373.ps1
function Get-AvailableRoleCapabilityName { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [PSModuleInfo] $PSModuleInfo ) $RoleCapabilityNames = @() $RoleCapabilitiesDir = Join-PathUtility -Path $PSModule...
combined_dataset/train/non-malicious/sample_63_51.ps1
sample_63_51.ps1
(this.webpackJsonp=this.webpackJsonp||[]).push([[206],{237:function(e,t){Prism.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:{function:{pattern:/(^|[^`])\$\((?:\$\(.*?\)|(?!\$\()[^\r\n)])*\)/,...
combined_dataset/train/non-malicious/sudo for Powershell.ps1
sudo for Powershell.ps1
# sudo.ps1 # # Authors: Brian Marsh, mrigns, This guy: http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell # # Sources: # http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell # http://www.ainotenshi.org/%E2%80%98sudo%E2%80%99-for-powershell-sorta # # Version: ...
combined_dataset/train/non-malicious/sample_36_68.ps1
sample_36_68.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 = '83.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/4414.ps1
4414.ps1
function Test-ScriptFileInfo { [CmdletBinding(PositionalBinding = $false, DefaultParameterSetName = 'PathParameterSet', HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=619791')] Param ( [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPro...
combined_dataset/train/non-malicious/1265.ps1
1265.ps1
function Resolve-CFullPath { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Path ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState if( -not ( [System.IO.Path]::IsPathRoo...
combined_dataset/train/non-malicious/Get-FirewallStatus.ps1
Get-FirewallStatus.ps1
# returns true if windows firewall is enabled, false if it is disabled filter global:get-firewallstatus ([string]$computer = $env:computername) { if ($_) { $computer = $_ } $HKLM = 2147483650 $reg = get-wmiobject -list -namespace root\\default -computer $computer | where-object { $_.name -eq "StdRegProv" }...
combined_dataset/train/non-malicious/Import-CmdEnvironment.ps1
Import-CmdEnvironment.ps1
# .SYNOPSIS # Import environment variables from cmd to PowerShell # .DESCRIPTION # Invoke the specified command (with parameters) in cmd.exe, and import any environment variable changes back to PowerShell # .EXAMPLE # Import-CmdEnvironment "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat" ...
combined_dataset/train/non-malicious/ConvertTo-Hex_3.ps1
ConvertTo-Hex_3.ps1
# Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx param ( [string]$SidString ) # Create SID .NET object using SID string provided $sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring # Create a byte array of the proper length $sidBytes = New-Object byte[] ...
combined_dataset/train/non-malicious/Install-Bginfo.ps1
Install-Bginfo.ps1
#Install and run BGInfo at startup using registry method as described here: #http://forum.sysinternals.com/bginfo-at-startup_topic2081.html #Setup #1. Download BgInfo http://technet.microsoft.com/en-us/sysinternals/bb897557 #2. Create a bginfo folder and copy bginfo.exe #3. Create a bginfo.bgi file by running bgi...
combined_dataset/train/non-malicious/New-Script.ps1
New-Script.ps1
## New-Script function ## Creates a new script from the most recent commands in history ################################################################################################## ## Example Usage: ## New-Script ScriptName 4 ## creates a script from the most recent four commands ## New-Script...
combined_dataset/train/non-malicious/4365.ps1
4365.ps1
function Get-SourceName { [CmdletBinding()] [OutputType("string")] Param ( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $Location ) Set-ModuleSourcesVariable foreach ($psModuleSource in $script:PSGetModuleSources.Values) { if ((...
combined_dataset/train/non-malicious/sample_7_84.ps1
sample_7_84.ps1
ConvertFrom-StringData @' id_windowssearchlenovorapidbootcheck_st=The Windows Search service is stopped and the HyperW7Svc64.exe service was detected '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63J...
combined_dataset/train/non-malicious/1042.ps1
1042.ps1
[CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $WebRoot, [Switch] $SkipCommandHelp ) Set-StrictMode -Version 'Latest' function Out-HtmlPage { param( [Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [...
combined_dataset/train/non-malicious/2405.ps1
2405.ps1
function Deploy-Vnc { [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateScript({ Test-Connection -ComputerName $_ -Quiet -Count 1 })] [string]$ComputerName, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateScript({ Test-Path -Path $_ -PathType Containe...
combined_dataset/train/non-malicious/FixInvalidVMs.ps1
FixInvalidVMs.ps1
#====================================================================================== # File Name : FixInvalidVMs.ps1 # Original Author : Kenneth C. Mazie # Description : Resets all "invald" or "inaccessible" virtual machines # : # Notes ...
combined_dataset/train/non-malicious/Find Local Group Members_2.ps1
Find Local Group Members_2.ps1
# Author: Hal Rottenberg # Purpose: Find matching members in a local group # Used tip from RichS here: http://powershellcommunity.org/Forums/tabid/54/view/topic/postid/1528/Default.aspx # Change these two to suit your needs $ChildGroups = "Domain Admins", $LocalGroup = "Administrators" $error.clear() $MemberNa...
combined_dataset/train/non-malicious/sample_49_19.ps1
sample_49_19.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/2420.ps1
2420.ps1
[CmdletBinding()] param ( [Parameter(Mandatory = $False, ValueFromPipeline = $False, ValueFromPipelineByPropertyName = $False, HelpMessage = 'What site server would you like to connect to?')] [string]$Server = 'CONFIGMANAGER', [Parameter(Mandatory = $False, ValueFromPipeline = $False, ...
combined_dataset/train/non-malicious/Get-CalendarWeek_1.ps1
Get-CalendarWeek_1.ps1
# Get-CalendarWeek by Holger Adam # Simple function to retrieve the calendar week to a given or the current date. function Get-CalendarWeek { param( $Date ) # check date input if ($Date -eq $null) { $Date = Get-Date } # get current culture object $Culture = [System.Globalization.CultureIn...
combined_dataset/train/non-malicious/2372.ps1
2372.ps1
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string[]]$FolderPath, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [int]$DaysOld, [Parameter()] [ValidateNotNullOrEmpty()] [ValidateLength(1, 3)] [string]$FileExtension ) $Now ...
combined_dataset/train/non-malicious/sample_43_81.ps1
sample_43_81.ps1
# # Module manifest for module 'OCI.PSModules.Marketplaceprivateoffer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Marketplaceprivateoffer.dll' # Version number of this module. ModuleVersion = '83.2.0...
combined_dataset/train/non-malicious/sample_6_24.ps1
sample_6_24.ps1
Get-ChildItem -Path $PSScriptRoot\*.ps1 | Foreach-Object{ . $_.FullName } # SIG # Begin signature block # MIItDQYJKoZIhvcNAQcCoIIs/jCCLPoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDfA60pZ8m/WODa # 6KPKEwub...
combined_dataset/train/non-malicious/1099.ps1
1099.ps1
$SiteName = 'TestSite' function Start-TestFixture { & (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { Remove-TestWebsite } function Stop-Test { Remove-TestWebsite } function Remove-TestWebsite { if( Test-IisWebsite -Name $SiteName ) { ...
combined_dataset/train/non-malicious/1102.ps1
1102.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldGetIISVersion { $props = get-itemproperty hklm:\Software\Microsoft\InetStp $expectedVersion = $props.MajorVersion.ToString() + '.' + $props.MinorVersion.ToString() $a...
combined_dataset/train/non-malicious/ciao.ps1
ciao.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_32_35.ps1
sample_32_35.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/sample_36_85.ps1
sample_36_85.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\@babel+parser@7.23.9\node_modules\@babel\parser\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.p...
combined_dataset/train/non-malicious/sample_67_86.ps1
sample_67_86.ps1
@{ GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" FunctionsToExport = @() CmdletsToExport = "Get-Acl", "Set-Acl", "G...
combined_dataset/train/non-malicious/sample_59_46.ps1
sample_59_46.ps1
# # Module manifest for module 'OCI.PSModules.Sch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Sch.dll' # Version number of this module. ModuleVersion = '86.2.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/856.ps1
856.ps1
$rsVaultName = "myRsVault" $rgName = "myResourceGroup" $location = "East US" Register-AzResourceProvider -ProviderNamespace "Microsoft.RecoveryServices" New-AzResourceGroup -Location $location -Name $rgName New-AzRecoveryServicesVault ` -Name $rsVaultName ` -ResourceGroupName $rgName ` -Location $locat...
combined_dataset/train/non-malicious/sample_34_35.ps1
sample_34_35.ps1
Rem AnimationEncyclopedia.vbs Rem An InDesign VBScript Rem Rem Author: Brenda Burden Rem Creates a 6-page sample doc demonstrating the new InDesign Animation feature Rem Search Reference Rem PAGE ONE - Sample of Animation Properties Rem PAGE TWO - Sample of all Animation Events Rem PAGE THREE - Sample ...
combined_dataset/train/non-malicious/sample_54_57.ps1
sample_54_57.ps1
# # Module manifest for module 'OCI.PSModules.Tenantmanagercontrolplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Tenantmanagercontrolplane.dll' # Version number of this module. ModuleVersion = '83...
combined_dataset/train/non-malicious/Resolve-Aliases _2.7.ps1
Resolve-Aliases _2.7.ps1
#requires -version 2.0 ## ResolveAliases Module v 1.6 ######################################################################################################################## ## Sample Use: ## Resolve-Aliases Script.ps1 | Set-Content Script.Resolved.ps1 ## ls *.ps1 | Resolve-Aliases -Inplace ##############...
combined_dataset/train/non-malicious/Decrypt Psi Password_1.ps1
Decrypt Psi Password_1.ps1
function decrypt-psi ($jid, $pw) { $OFS = ""; $u = 0; for($p=0;$p -lt $pw.Length;$p+=4) { [char]([int]"0x$($pw[$p..$($p+3)])" -bxor [int]$jid[$u++]) } } $accounts = ([xml](cat ~\\psidata\\profiles\\default\\accounts.xml))["accounts"]["accounts"] foreach($account in ($accounts | gm a[0-9]*)) { ...
combined_dataset/train/non-malicious/sample_67_58.ps1
sample_67_58.ps1
@{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.ServiceFabric.Powershell' # Version number of this module. ModuleVersion = '3.1.0.0' # ID used to uniquely identify this module GUID = 'd2c42633-5254-4a82-a312-1dc0697a55cd' # Author of this module Author = '...