full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/Invoke-WMSettingsChange.ps1
Invoke-WMSettingsChange.ps1
#requires -version 2 if (-not ("win32.nativemethods" -as [type])) { # import sendmessagetimeout from win32 add-type -Namespace Win32 -Name NativeMethods -MemberDefinition @" [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] public static extern IntPtr SendMessageTimeout( IntPtr ...
combined_dataset/train/non-malicious/sample_58_56.ps1
sample_58_56.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 = '83.3.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/sample_5_30.ps1
sample_5_30.ps1
ConvertFrom-StringData @' id_depdisabled4gbcheck=Checking if DEP settings id_depdisabled4gbcheckdesc=Checking if Data Execution Protection is enabled '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63...
combined_dataset/train/non-malicious/sample_50_54.ps1
sample_50_54.ps1
function getWorldMatrix(element) { return element.getTrait("WorldTransform").value; } var isOrtho = false; function getCameraElement() { var camera = document.elements.findElementByTypeId("Microsoft.VisualStudio.3D.PerspectiveCamera"); if (camera == null) { isOrtho = true; came...
combined_dataset/train/non-malicious/sample_17_52.ps1
sample_17_52.ps1
# # Module manifest for module 'OCI.PSModules.Rover' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Rover.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_29_63.ps1
sample_29_63.ps1
# Compiling Piglit $ProgressPreference = "SilentlyContinue" $MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent . "$MyPath\mesa_init_msvc.ps1" $source_dir = Join-Path -Path "$PWD" -ChildPath "src" $waffle_source = Join-Path -Path "$source_dir" -ChildPath "waffle" $waffle_install = Join-Path -Path "$PWD" -Chil...
combined_dataset/train/non-malicious/sample_17_10.ps1
sample_17_10.ps1
# # Module manifest for module 'OCI.PSModules.Dts' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dts.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/Get-Credential 2.1.ps1
Get-Credential 2.1.ps1
## Get-Credential ## An improvement over the default cmdlet which has no options ... ################################################################################################### ## History ## v 2.1 Fix the comment help and parameter names to agree with each other (whoops) ## v 2.0 Rewrite for v2 to replace...
combined_dataset/train/non-malicious/95.ps1
95.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/sample_17_55.ps1
sample_17_55.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 = '73.1.0' # Supported P...
combined_dataset/train/non-malicious/Bulk Storage vMotion .ps1
Bulk Storage vMotion .ps1
#======================================================================== # Created on: 5/31/2012 4:31 PM # Created by: Clint Jones # Organization: Virtually Genius! # Filename: StorageVMotion-BulkVMs #======================================================================== #Import Plugins and Connect t...
combined_dataset/train/non-malicious/1089.ps1
1089.ps1
Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath 'CarbonDscTest' -Resolve) -Force $credential = New-Credential -User 'CarbonDscTestUser' -Password ([Guid]::NewGuid().ToString()) $tempDir = $null $servicePath = $null $serviceName = 'CarbonDscTestService' Install-CUser -Credential $credential S...
combined_dataset/train/non-malicious/sample_18_94.ps1
sample_18_94.ps1
# Localized 06/28/2023 08:04 AM (GMT) 303:7.0.30723 terminalservices_model.psd1 # # Only add new (name,value) pairs to the end of this table # Do not remove, insert or re-arrange entries # ConvertFrom-StringData @' ###PSLOC start localizing # # ActivationStatusCheck # Activation...
combined_dataset/train/non-malicious/e7cd2cb0-d32a-4631-a081-302f0685887c.ps1
e7cd2cb0-d32a-4631-a081-302f0685887c.ps1
$Mailboxes = Get-CASMailbox -Filter {HasActivesyncDevicePartnership -eq $true} $EASMailboxes = $Mailboxes | Select-Object PrimarySmtpAddress,@{N='DeviceID';E={Get-ActiveSyncDeviceStatistics -Mailbox $_.Identity | Select-Object –ExpandProperty DeviceID}} $EASMailboxes | foreach {Set-CASMailbox $_.PrimarySmtpAddres...
combined_dataset/train/non-malicious/ConvertFrom-Hashtable 2.ps1
ConvertFrom-Hashtable 2.ps1
#function ConvertFrom-Hashtable { [CmdletBinding()] PARAM( [Parameter(ValueFromPipeline=$true, Mandatory=$true)] [HashTable]$hashtable , [switch]$Combine , [switch]$Recurse ) BEGIN { $output = @() } PROCESS { if($recurse) { $keys = $hashta...
combined_dataset/train/non-malicious/sample_63_75.ps1
sample_63_75.ps1
Import-LocalizedData -BindingVariable lanTxt -FileName AzStackHci.AddNode.Strings.psd1 function Test-ADCredential { [CmdletBinding()] param ( [pscredential] $ActiveDirectoryCredential ) try { $severity = 'CRITICAL' $adModuleExists = [bool](Get-Module Activ...
combined_dataset/train/non-malicious/3438.ps1
3438.ps1
. "$PSScriptRoot\TestExplorer.ps1" function Create-HelperModule( [string] $moduleDir, [string] $moduleName, [string] $archiveDir) { if(-not (Test-Path $archiveDir)) { $null = New-Item -ItemType directory -Path $archiveDir -ErrorAction Stop ...
combined_dataset/train/non-malicious/CommandTranscript_1.ps1
CommandTranscript_1.ps1
if(!$global:CommandTranscriptPrompt) { ## Record the original prompt so we can put it back if they change their minds... $global:CommandTranscriptPrompt = ${Function:Prompt} } function Test-CommandTranscript { #.Synopsis # Tests whether or not a current command transcript is in place. return $global:Com...
combined_dataset/train/non-malicious/2993.ps1
2993.ps1
Set-StrictMode -Version Latest function FunctionUnderTest { [CmdletBinding()] param ( [Parameter(Mandatory = $false)] [string] $param1 ) return "I am a real world test" } function FunctionUnderTestWithoutParams([string]$param1) { return "I am a real world test with no para...
combined_dataset/train/non-malicious/sample_57_78.ps1
sample_57_78.ps1
@{ GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" CmdletsToExport = @( 'Export-Alias', 'Get-Alias', 'Import-Alias'...
combined_dataset/train/non-malicious/Test-Transcribing_1.ps1
Test-Transcribing_1.ps1
#requires -version 2.0 function Test-Transcribing { $externalHost = $host.gettype().getproperty("ExternalHost", [reflection.bindingflags]"NonPublic,Instance").getvalue($host, @()) try { $externalHost.gettype().getproperty("IsTranscribing", [reflection.bindingflags]"NonPublic,Instance").getvalue($ex...
combined_dataset/train/non-malicious/3475.ps1
3475.ps1
function SkipTopTests { $location = Get-Location $resourceGroupName = getAssetName "RSG" $namespaceName = getAssetName "Namespace-" $eventHubName = getAssetName "EventHub-" $consumerGroupName = getAssetName "ConsumerGroup-" Write-Debug " Create resource group" Write-Debug " Reso...
combined_dataset/train/non-malicious/1588.ps1
1588.ps1
function PRobocopy { param ( [string]$Source = $PWD, [string]$Destination = 'NULL', [string[]]$Include, [long]$Retries = 1000000, [long]$WaitTime = 30, [string]$ExcludeAttributes, [switch]$ExcludeChanged, [switch]$ExcludeNewer, [switch]$Exc...
combined_dataset/train/non-malicious/sample_11_88.ps1
sample_11_88.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/1887.ps1
1887.ps1
Import-Module HelpersCommon Describe "Export-Csv" -Tags "CI" { BeforeAll { $testObject = @("test","object","array") $testCsv = Join-Path -Path $TestDrive -ChildPath "output.csv" $newLine = [environment]::NewLine $P1 = [pscustomobject]@{"P1" = "first"} $P2 = [pscustomobjec...
combined_dataset/train/non-malicious/Async Sockets.ps1
Async Sockets.ps1
if (-not ("CallbackEventBridge" -as [type])) { Add-Type @" using System; public sealed class CallbackEventBridge { public event AsyncCallback CallbackComplete = delegate { }; private CallbackEventBridge() {} private void CallbackInternal(IAsyncResult...
combined_dataset/train/non-malicious/sample_13_86.ps1
sample_13_86.ps1
#=========================================================================== #DVInstaller.ps1 #---------------------------------------------------------------------------- #Copyright (C) 2021 Intel Corporation #SPDX-License-Identifier: MIT #--------------------------------------------------------------------------...
combined_dataset/train/non-malicious/504.ps1
504.ps1
function Disable-UserAccessControl{ [CmdletBinding()] param( ) Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value 00000000 if(Get-ItemProperty -Path "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\pol...
combined_dataset/train/non-malicious/sample_54_84.ps1
sample_54_84.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_15_27.ps1
sample_15_27.ps1
########################################################### # # 'ServiceHelper' module # ########################################################### $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest $global:GCServiceName = "GCService" $script:GCServiceBinaryName = "gc_service.exe" $script:GC...
combined_dataset/train/non-malicious/4186.ps1
4186.ps1
Set-Variable -Name File -Scope Local -Force Function DeclareGlobalMemory { Set-Variable -Name Files -Scope Global -Force Set-Variable -Name RelativePath -Scope Global -Force } Function GlobalMemoryCleanup { Remove-Variable -Name Files -Scope Global -Force Remove-Variable -Name RelativePath -Scope Globa...
combined_dataset/train/non-malicious/1848.ps1
1848.ps1
$InternalGallery = "https://www.poshtestgallery.com/api/v2/" $InternalSource = 'OneGetTestSource' Describe "PackageManagement Acceptance Test" -Tags "Feature" { BeforeAll{ Register-PackageSource -Name Nugettest -provider NuGet -Location https://www.nuget.org/api/v2 -force Register-PackageSourc...
combined_dataset/train/non-malicious/sample_55_40.ps1
sample_55_40.ps1
#*************************************************** # modified version of tss_ChkSym.ps1 for usage in TSS # Version 1.0.1cmd.exe /c # Date: 7/15/2019 # Author: +waltere 2019.07.15, sabieler 2024.01.29 (TSS version) # Description: This file will use Checksym.exe to list all file versions on the local machine #**...
combined_dataset/train/non-malicious/sample_57_48.ps1
sample_57_48.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ [CmdletBinding(DefaultParamet...
combined_dataset/train/non-malicious/216.ps1
216.ps1
function Expand-ScriptAlias { [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Low')] PARAM ( [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] [ValidateScript({ Test-Path -Path $_ })] [Alias('FullName')] [System.String]$Path ) PROCESS { FOREACH ($File in $Path) { Write-Verbose ...
combined_dataset/train/non-malicious/sample_27_19.ps1
sample_27_19.ps1
# Import the cluster setup utility module $sdkInstallPath = (Get-ItemProperty 'HKLM:\Software\Microsoft\Service Fabric SDK').FabricSDKScriptsPath $modulePath = Join-Path -Path $sdkInstallPath -ChildPath "ClusterSetupUtilities.psm1" Import-Module $modulePath function Set-LocalClusterReady([bool]$createOneNodeC...
combined_dataset/train/non-malicious/sample_64_53.ps1
sample_64_53.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/846.ps1
846.ps1
$resourceGroupName = "<azure resource group name>" $dataFactoryName = "<data factory name>" $dataFactoryRegion = "East US" $storageAccountName = "<Az.Storage account name>" $storageAccountKey = "<Az.Storage account key>" $azureSqlServer = "<azure sql server name>" $azureSqlDatabase = "<azure sql database name>" $a...
combined_dataset/train/non-malicious/sample_35_32.ps1
sample_35_32.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/705.ps1
705.ps1
function New-RsConfigurationSettingObject { [cmdletbinding()] param ( [Alias('SqlServerInstance')] [string] $ReportServerInstance = ([Microsoft.ReportingServicesTools.ConnectionHost]::Instance), [Alias('SqlServerVersion')] [Microsoft.ReportingService...
combined_dataset/train/non-malicious/sample_37_64.ps1
sample_37_64.ps1
<# .SYNOPSIS Pauses all pipelines in an org/project .PARAMETER Organization Organization to pause .PARAMETER Project Project to pause .PARAMETER AzDOPat PAT used to make AzDO modifications. Requires build read/execute. .PARAMETER Resume Resume rather than pause #> param ( [Parameter(Mandatory=$true)][string]$...
combined_dataset/train/non-malicious/3668.ps1
3668.ps1
function GetResourceNames() { return @{ ` "Location" = "Australia East" "ResourceGroupName" = "WIRunnersProd"; ` "ServerName" = "wi-runner-australia-east"; ` "DatabaseName" = "WIRunner"; ` "ElasticPoolName" = "WIRunnerPool"; ` } } function Test-ListServ...
combined_dataset/train/non-malicious/sample_26_29.ps1
sample_26_29.ps1
let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl(); let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/webCore.eventHandlers.js"]; let currentScriptElement = document.querySelector("script[src='Scripts/webCore.plugin.js']"); if (currentScriptElement !== null) { scr...
combined_dataset/train/non-malicious/sample_50_45.ps1
sample_50_45.ps1
# # Module manifest for module 'OCI.PSModules.Ocicontrolcenter' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ocicontrolcenter.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported...
combined_dataset/train/non-malicious/Export-SPListToSQL.ps1
Export-SPListToSQL.ps1
#Change these settings as needed #MS Access 2007 Data Components required $connString = 'Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=2;RetrieveIds=Yes; DATABASE=http://sharepoint.acme.com/;LIST={96801432-2d03-42b8-82b0-ac96ca9fea8a};' #See http://chadwickmiller.spaces.live.com/blog/cns!EA42395138308430!275.entry for ...
combined_dataset/train/non-malicious/Send-HTMLFormattedEmail_8.ps1
Send-HTMLFormattedEmail_8.ps1
#------------------------------------------------- # Send-HTMLFormattedEmail #------------------------------------------------- # Usage: Used to send an HTML Formatted Email that is based on an XSLT template. #------------------------------------------------- function Send-HTMLFormattedEmail{ param ( [string]...
combined_dataset/train/non-malicious/Atlassian Jira Interface.ps1
Atlassian Jira Interface.ps1
# jirafunctions.ps1 # # Note: Some functions are incomplete/untested. Be sure to TEST before placing in production!! # # Dot-source this script to connect to jira and initialize the functions. # Ex: PS C:\\scripts\\jira> . .\\jirafunctions.ps1 # Ex: PS C:\\scripts\\jira> get-JiraReport # # Connects to Jira and ...
combined_dataset/train/non-malicious/sample_8_82.ps1
sample_8_82.ps1
#************************************************ # utils_Exchange_all_exchange_versions_withoutpowershellaccess.ps1 # Version 2.0.1 # Date: 04-12-2013 # Author: Brian Prince - brianpr@microsoft.com # Description: Utility functions for use by Exchange SDP 3.0+ manifests #****************************************...
combined_dataset/train/non-malicious/Compile-Help_2.ps1
Compile-Help_2.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. # # Minor tweak by John Robbins to work on x64 when lo...
combined_dataset/train/non-malicious/Get-InstalledProgram.ps1
Get-InstalledProgram.ps1
function Get-InstalledProgram() { param ( [String[]]$Computer, $User ) ############################################################################################# if ($User -is [String]) { $Connection = Get-Credential -Credential $User } #####################################################################...
combined_dataset/train/non-malicious/sample_23_92.ps1
sample_23_92.ps1
# # Script module for module 'Az.ServiceBus' that is executed when 'Az.ServiceBus' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 05/16/2024 06:33:09 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try { ...
combined_dataset/train/non-malicious/sample_15_49.ps1
sample_15_49.ps1
<# .NOTES Author: @jhowardmsft Summary: Windows native build script. This is similar to functionality provided by hack\make.sh, but uses native Windows PowerShell semantics. It does not support the full set of options provided by the Linux counterpart. For example: ...
combined_dataset/train/non-malicious/sample_18_30.ps1
sample_18_30.ps1
# # Module manifest for module 'OCI.PSModules.Dataintegration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dataintegration.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported P...
combined_dataset/train/non-malicious/sample_37_92.ps1
sample_37_92.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/VMtoolsUpgrade.ps1
VMtoolsUpgrade.ps1
##################################################################### # # Purpose: "Check and upgrade Tools during power cycling" # Author: David Chung # Support: IT Infrastructure # Docs: N/A # # Instruction: 1. Create CSV file with list of servers # 2. Execute script from PowerCLI # 3. E...
combined_dataset/train/non-malicious/sample_35_69.ps1
sample_35_69.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/1972.ps1
1972.ps1
Describe "Remove-PSBreakpoint" -Tags "CI" { $testScript = Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath assets) -ChildPath psbreakpointtestscript.ps1 $script = "`$var = 1 `$var2 = Get-Command Get-Date " $script > $testScript BeforeEach { $line = Set-PSBreakpoint -Line 1,2,...
combined_dataset/train/non-malicious/2695.ps1
2695.ps1
function Get-CSDisassembly { [OutputType([Capstone.Instruction])] [CmdletBinding(DefaultParameterSetName = 'Disassemble')] Param ( [Parameter(Mandatory, ParameterSetName = 'Disassemble')] [Capstone.Architecture] $Architecture, [Parameter(Mandatory, ParameterSetName = 'Disa...
combined_dataset/train/non-malicious/sample_61_32.ps1
sample_61_32.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux builds of Node # are installed in the same directory $exe=".exe" } $ret=0 if (Test-Path "$basedir/node$exe") { # Suppor...
combined_dataset/train/non-malicious/sample_55_46.ps1
sample_55_46.ps1
########################################################### # # 'ServiceHelper' module # ########################################################### $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest $global:GCServiceName = "GCService" $script:GCServiceBinaryName = "gc_service.exe" $script:GC...
combined_dataset/train/non-malicious/Short PS Prompt.ps1
Short PS Prompt.ps1
<# .Synopsis Dynamically shortens the prompt based upon window size .Notes I got really annoyed by having my PowerShell prompt extend across 2/3 of my window when in a deeply-nested directory structure. This shortens the prompt to roughly 1/3 of the window width, at a minimum showing the first and last piece of...
combined_dataset/train/non-malicious/sample_45_51.ps1
sample_45_51.ps1
# # Module manifest for module 'OCI.PSModules.Artifacts' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Artifacts.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/d657a0f0-47e1-4233-9e3b-cffc0495188f.ps1
d657a0f0-47e1-4233-9e3b-cffc0495188f.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_52_50.ps1
sample_52_50.ps1
# # Module manifest for module 'OCI.PSModules.Threatintelligence' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Threatintelligence.dll' # Version number of this module. ModuleVersion = '77.0.0' # Suppo...
combined_dataset/train/non-malicious/3073.ps1
3073.ps1
function Get-Planet ([string]$Name = '*') { $planets = @( @{ Name = 'Mercury' } @{ Name = 'Venus' } @{ Name = 'Earth' } @{ Name = 'Mars' } @{ Name = 'Jupiter' } @{ Name = 'Saturn' } @{ Name = 'Uranus' } @{ Name = 'Neptune' } ) | foreac...
combined_dataset/train/non-malicious/sample_44_93.ps1
sample_44_93.ps1
<# .SYNOPSIS Dump information about installed certificates .DESCRIPTION - Dump certificates from Computer and Personal stores; - In debug mode, dump information about Certificate Authority .PARAMETER outFolder Folder where to save output .PARAMETER outFormat Output format. Can be "txt" (default), "csv" or "stdo...
combined_dataset/train/non-malicious/Reflection Module 4.1.ps1
Reflection Module 4.1.ps1
#requires -version 2.0 # ALSO REQUIRES Autoload for some functionality (Latest version: http://poshcode.org/3173) # You should create a Reflection.psd1 with the contents: # @{ ModuleToProcess="Reflection.psm1"; RequiredModules = @("Autoload"); GUID="64b5f609-970f-4e65-b02f-93ccf3e60cbb"; ModuleVersion="4.1.0.0" ...
combined_dataset/train/non-malicious/sample_60_90.ps1
sample_60_90.ps1
<# # .DESCRIPTION # Run powershell scripts using scheduled task. # # .PARAMETER taskName # The task name. # # .PARAMETER script # The inlined script to execute on remote machine. # #> $ScriptFile = Join-Path -Path $env:LocalAppData -ChildPath "$taskName.ps1" $ResultFile = Join-Path -Path $env:...
combined_dataset/train/non-malicious/WriteFileName.ps1
WriteFileName.ps1
# functions to print overwriting multi-line messages. Test script will accept a file/filespec/dir and iterate through all files in all subdirs printing a test message + file name to demostrate. # e.g. PS>.\\writefilename.ps1 c:\\ # call WriteFileName [string] # after done writing series of overwriting messages, cal...
combined_dataset/train/non-malicious/sample_23_80.ps1
sample_23_80.ps1
# # Module manifest for module 'OCI.PSModules.Osuborganizationsubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll' # Version number of this module. ModuleVersion...
combined_dataset/train/non-malicious/sample_42_16.ps1
sample_42_16.ps1
# # Module manifest for module 'Az.PrivateDns' # # Generated by: Microsoft Corporation # # Generated on: 5/16/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.PrivateDns.psm1' # Version number of this module. ModuleVersion = '1.0.5' # Supported PSEditio...
combined_dataset/train/non-malicious/sample_31_64.ps1
sample_31_64.ps1
# # Module manifest for module 'OCI.PSModules.Databasemanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasemanagement.dll' # Version number of this module. ModuleVersion = '73.1.0' # Suppo...
combined_dataset/train/non-malicious/sample_32_70.ps1
sample_32_70.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/AnalyzeScript.ps1
AnalyzeScript.ps1
<# .SYNOPSIS Analyzes script and gives starting lines & columns of script components .DESCRIPTION AnalyzeScript opens a dialog box for user selection; checks that input is a powershell script; parses and agrigates the script components into the following tokens: Unknown(s) Command(s) ...
combined_dataset/train/non-malicious/sample_65_19.ps1
sample_65_19.ps1
# # Module manifest for module 'ClientContext' # # Generated by: JakubVanak # # Generated on: 01.05.2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'ClientContext.psm1' # Version number of this module. ModuleVersion = '0.0.1' # Supported PSEditions # Comp...
combined_dataset/train/non-malicious/TabExpansion for V2CTP_9.ps1
TabExpansion for V2CTP_9.ps1
## Tab-Completion ################# ## For V2CTP3. ## This won't work on V1 and V2CTP and V2CTP2. ## 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...
combined_dataset/train/non-malicious/sample_66_74.ps1
sample_66_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 = '84.0.0' # Suppo...
combined_dataset/train/non-malicious/3640.ps1
3640.ps1
function Test-CreateJobCredential { $a1 = Create-ElasticJobAgentTestEnvironment try { Test-CreateJobCredentialWithDefaultParam $a1 Test-CreateJobCredentialWithParentObject $a1 Test-CreateJobCredentialWithParentResourceId $a1 Test-CreateJobCredentialWithPiping $a1 } finally { Remove-Resou...
combined_dataset/train/non-malicious/sample_67_67.ps1
sample_67_67.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 Publish-UpgradedServ...
combined_dataset/train/non-malicious/2066.ps1
2066.ps1
Describe "Serialization Tests" -tags "CI" { BeforeAll { $testfileName="SerializationTest.txt" $testPath = Join-Path $TestDrive $testfileName $testfile = New-Item $testPath -Force function SerializeAndDeserialize([PSObject]$inputObject) { $xmlSerializer = New-Obj...
combined_dataset/train/non-malicious/sample_54_93.ps1
sample_54_93.ps1
# ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License...
combined_dataset/train/non-malicious/sample_14_62.ps1
sample_14_62.ps1
# # Module manifest for module 'OCI.PSModules.Queue' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Queue.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_3_23.ps1
sample_3_23.ps1
// Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved. // ================================================================== // DCIM_LocalUserIdentity // ================================================================== [ dynamic, provider("dcismprovider"), Description ( "DCIM...
combined_dataset/train/non-malicious/sample_58_83.ps1
sample_58_83.ps1
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { t...
combined_dataset/train/non-malicious/626.ps1
626.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2%20Setup.exe" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" Executable = "C:\Program Files (x86)\Sublime Text ...
combined_dataset/train/non-malicious/sample_46_18.ps1
sample_46_18.ps1
//// Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this...
combined_dataset/train/non-malicious/Find Local Group Members.ps1
Find Local Group Members.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", "Group Two" $LocalGroup = "Administrators" $MemberName...
combined_dataset/train/non-malicious/2349.ps1
2349.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/298.ps1
298.ps1
function Register-PSFCallback { [CmdletBinding()] param ( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $Name, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $ModuleName, [Parameter(Mandatory = $true, ValueFromPipelineByProperty...
combined_dataset/train/non-malicious/New-XVM_8.ps1
New-XVM_8.ps1
#Examples <# New-XVM -Name "WS2012-TestServer01" -SwitchName "Switch(192.168.2.0/24)" -VhdType NoVHD New-XVM -Name "WS2012-TestServer02" -SwitchName "Switch(192.168.2.0/24)" -VhdType ExistingVHD -VhdPath 'D:\\vhds\\WS2012-TestServer02.vhdx' New-XVM -Name "WS2012-TestServer03" -SwitchName "Switch(192.168.2.0/24)" ...
combined_dataset/train/non-malicious/2524.ps1
2524.ps1
function SQL-Query{ param([string]$Query, [string]$SqlServer = $DEFAULT_SQL_SERVER, [string]$DB = $DEFAULT_SQL_DB, [string]$RecordSeparator = "`t") $conn_options = ("Data Source=$SqlServer; Initial Catalog=$DB;" + "Integrated Security=SSPI") $conn = New-Object System.Data.SqlClient.SqlConnection($...
combined_dataset/train/non-malicious/sample_18_83.ps1
sample_18_83.ps1
# Copyright (c) 2019-2024, The Khronos Group Inc. # SPDX-License-Identifier: Apache-2.0 param( [Parameter(Mandatory = $true, HelpMessage = "Path to unzipped openxr_loader_windows OpenXR-SDK release asset")] $SDKRelease, [Parameter(Mandatory = $true, HelpMessage = "Path to specification Makefile. Needed to e...
combined_dataset/train/non-malicious/172.ps1
172.ps1
function View-Cats { Param( [int]$refreshtime=5 ) $IE = new-object -ComObject internetexplorer.application $IE.visible = $true $IE.FullScreen = $true $shell = New-Object -ComObject wscript.shell $shell.AppActivate("Internet Explorer") while($true){ $request = Invoke-We...
combined_dataset/train/non-malicious/Findup_7.ps1
Findup_7.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; namespace Findup { public class FileInfoExt { public FileInfoExt(FileInfo fi) ...
combined_dataset/train/non-malicious/sample_15_65.ps1
sample_15_65.ps1
<# .SYNOPSIS Scenario module for collecting machine licensing/activation related data .DESCRIPTION Collect machine licensing/activation related troubleshooting data .NOTES Author : Robert Klemencz Requires : MSRD-Collect.ps1 Version : See MSRD-Collect.ps1 version Feedback : htt...
combined_dataset/train/non-malicious/sample_26_66.ps1
sample_26_66.ps1
# virtualenv activation module # Activate with `overlay use activate.nu` # Deactivate with `deactivate`, as usual # # To customize the overlay name, you can call `overlay use activate.nu as foo`, # but then simply `deactivate` won't work because it is just an alias to hide # the "activate" overlay. You'd need to call `...
combined_dataset/train/non-malicious/Enable-RemotePsRemoting..ps1
Enable-RemotePsRemoting..ps1
##############################################################################\n##\n## Enable-RemotePsRemoting\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/Invoke-ResetPassword.ps1
Invoke-ResetPassword.ps1
# From: Brandon Shell # Purpose: To Reset Local User Account # Example: # -- To Reset user Password # PS> Add-User -user Jsmith -password H!Th3r3 -server myserver1 # With Creds # PS> Add-User -user Jsmith -password H!Th3r3 -server myserver1 -luser adminGuy -lPassword HateClearText! ...
combined_dataset/train/non-malicious/sample_49_81.ps1
sample_49_81.ps1
# # Module manifest for module 'OCI.PSModules.Vbsinst' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Vbsinst.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/18072022-fd64-4e12-ae6e-d021defcfff3.ps1
18072022-fd64-4e12-ae6e-d021defcfff3.ps1
# Name: zip.ps1 # Author: Shadow # Created: 05/12/2008 param([string]$zipfilename=$(throw "ZIP archive name needed!"), [string[]]$filetozip=$(throw "Supply the file(s) to compress (wildcards accepted)")) trap [Exception] {break;} #empyt zip file contents $emptyzipfile=80,75,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0...