full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/Write-Log_7.ps1
Write-Log_7.ps1
function Write-Log { #.Synopsis # Write to a rotating log file #.Example # Get-ChildItem C:\\ -Recurse | Select FullName, CreationTimeUtc, LastWriteTimeUtc | Write-Log Files.txt -Rotate 5mb # # Writes a file list to disc, breaking it into multiple files of approximately 5MB of data each [CmdletB...
combined_dataset/train/non-malicious/sample_42_0.ps1
sample_42_0.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; // services.debug.trace(tname + "=" + val); } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("showEm...
combined_dataset/train/non-malicious/Invoke-WindowsUpdate.ps1
Invoke-WindowsUpdate.ps1
###########################################################################" # # NAME: Invoke-WindowsUpdate.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # # COMMENT: Script to download and install updates from Windows Update/WSUS. Reporting and rebooting may be customized. # For m...
combined_dataset/train/non-malicious/sample_60_23.ps1
sample_60_23.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 = '89.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_48_82.ps1
sample_48_82.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apach...
combined_dataset/train/non-malicious/3769.ps1
3769.ps1
function Test-NewIntegrationAccountAssembly { $localAssemblyFilePath = Join-Path (Join-Path $TestOutputRoot "Resources") "SampleAssembly.dll" $assemblyContent = [IO.File]::ReadAllBytes($localAssemblyFilePath) $resourceGroup = TestSetup-CreateResourceGroup $integrationAccountName = "IA-" + (getAssetn...
combined_dataset/train/non-malicious/sample_1_51.ps1
sample_1_51.ps1
// ================================================================== // DCIM_CSCapacitiesConcreteCollection // ================================================================== [dynamic, provider("dcismprovider"), Description( "DCIM_CSCapacitiesConcreteCollection is a" "trivial deriva...
combined_dataset/train/non-malicious/sample_48_99.ps1
sample_48_99.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=Variabel lingkungan nama dan tipe ini sudah ada. EnvironmentErrorDoesNotExists=Variabel lingkungan nama dan tipe ini tidak ada. '@ # SIG # Begin signature block # MIIoPQYJKoZIhvcNAQcCoIIoLjCCKCoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBg...
combined_dataset/train/non-malicious/sample_26_74.ps1
sample_26_74.ps1
# Localized 05/08/2024 05:10 AM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=Д&а PromptNoString=&Нет BundleFound=Найденный набор: {0} PackageFound=Обнаружен пакет: {0} EncryptedBundleFound=Найден зашифрованный набор: {0} EncryptedPackageFoun...
combined_dataset/train/non-malicious/sample_0_2.ps1
sample_0_2.ps1
##---------------------------------------------------------------------------- ## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved. ##---------------------------------------------------------------------------- # Import string constants . ./StringConstants.ps1 Stop-Service -Name $ServiceConsta...
combined_dataset/train/non-malicious/sample_18_77.ps1
sample_18_77.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 = '74.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_65_7.ps1
sample_65_7.ps1
function Write-InstallationCheckToFile { Param($installationchecks) if (Get-Module AzureRM.Profile -ListAvailable -ErrorAction Ignore) { Write-Warning ("Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same s...
combined_dataset/train/non-malicious/2714.ps1
2714.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$False,Position=1)] [String]$BasePath="C:\" ) if (Test-Path "$env:SystemRoot\du.exe") { & $env:SystemRoot\du.exe -q -c -l 3 $BasePath 2> $null | ConvertFrom-Csv } else { Write-Error "du.exe not found in $env:SystemRoot." }
combined_dataset/train/non-malicious/group-byobject_1.ps1
group-byobject_1.ps1
#groups by a set of properties, but returns then rather than as a string, as seperate properties on an object with _count , and _group for the original #ones returned from group object function group-byobject { [CmdletBinding()] param( [Parameter(ValueFromPipeline=$true,Mandatory=$true)] $InputObject , ...
combined_dataset/train/non-malicious/sample_49_74.ps1
sample_49_74.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ResourceGraph.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ResourceGraph.internal.psm1' if(Test-Path $internalModulePath)...
combined_dataset/train/non-malicious/4325.ps1
4325.ps1
function Send-EnvironmentChangeMessage { if($Script:IsWindows) { if (-not ('Microsoft.PowerShell.Commands.PowerShellGet.Win32.NativeMethods' -as [type])) { Add-Type -Namespace Microsoft.PowerShell.Commands.PowerShellGet.Win32 ` -Name NativeMethods ` ...
combined_dataset/train/non-malicious/SharpSsh 5.ps1
SharpSsh 5.ps1
#requires -version 2.0 ## A simple SSH Scripting module for PowerShell ## Retrieved from ## History: ## v1 - Initial Script ## v2 - Capture default prompt in New-SshSession ## v3 - Update to advanced functions, require 2.0, and add basic help ## v4(modification by Tao Klerks) - Update to reference modified Shar...
combined_dataset/train/non-malicious/Help Differ 10000 v0.01.ps1
Help Differ 10000 v0.01.ps1
# These functions are meant to help generate a table that shows differences between # cmdlets among different versions of a module. # You will need a MoinMoin wiki to render the output. # If you don't have a MoinMoin wiki you might be able to use the sandbox at http://moinmo.in/WikiSandBox # Extracts some data fr...
combined_dataset/train/non-malicious/get-DiskVolumeInfo.ps1
get-DiskVolumeInfo.ps1
function get-DiskVolumeInfo { <# .SYNOPSIS Returns information about disk volumes including freespace .DESCRIPTION Returns information about disk volumes including freespace .EXAMPLE show-InnerException ExceptionObject Shows the in...
combined_dataset/train/non-malicious/2125.ps1
2125.ps1
Describe "Test trap" -Tags "CI" { Context "Trap with flow control" { It "Line after exception should NOT be continued when it's from a nested script block" { $a = . {trap {"trapped"; continue;}; . {"hello"; throw "exception"; "world"}} $a.Length | Should -Be 2 $a -join...
combined_dataset/train/non-malicious/sample_50_91.ps1
sample_50_91.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=An environment variable of this name and type already exists. EnvironmentErrorDoesNotExists=An environment variable of this name and type does not exist. '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # ...
combined_dataset/train/non-malicious/sample_27_32.ps1
sample_27_32.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=Er bestaat al een omgevingsvariabele met deze naam en dit type. EnvironmentErrorDoesNotExists=Er bestaat geen omgevingsvariabele met deze naam en dit type. '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor ...
combined_dataset/train/non-malicious/2692.ps1
2692.ps1
function Get-PEB { [CmdletBinding()] Param ( [Parameter(Position = 0, Mandatory = $True, ValueFromPipelineByPropertyName = $True)] [Alias('PID')] [UInt16[]] $Id ) BEGIN { Set-StrictMode -Version 2 $mscorlib = [AppDomain]::CurrentDomain.GetAssemblies() ...
combined_dataset/train/non-malicious/2250.ps1
2250.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Set the URI for the ConfigMgr WebService.")] [ValidateNotNullOrEmpty()] [string]$URI, [parameter(Mandatory=$true, HelpMessage="Specify the known secret key for the ConfigMgr WebService.")] [ValidateNotNull...
combined_dataset/train/non-malicious/sample_22_54.ps1
sample_22_54.ps1
15KnownLimitations15.1ExperimentalFeaturesSomeOracleVMVirtualBoxfeaturesarelabeledasexperimental.Suchfeaturesareprovidedonan“as-is”basisandarenotformallysupported.However,feedbackandsuggestionsaboutsuchfeaturesarewelcome.Acomprehensivelistofexperimentalfeaturesisasfollows:Hardware3DaccelerationsupportforWindows,Linux,...
combined_dataset/train/non-malicious/sample_23_83.ps1
sample_23_83.ps1
# # Module manifest for module 'OCI.PSModules.Aianomalydetection' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aianomalydetection.dll' # Version number of this module. ModuleVersion = '81.0.0' # Suppo...
combined_dataset/train/non-malicious/New-XVM_5.ps1
New-XVM_5.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/sample_42_37.ps1
sample_42_37.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_34_74.ps1
sample_34_74.ps1
@{ GUID="766204A6-330E-4263-A7AB-46C87AFC366C" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManC...
combined_dataset/train/non-malicious/134032f9-0687-4d0a-b267-6a42e5c116df.ps1
134032f9-0687-4d0a-b267-6a42e5c116df.ps1
#'*********************************************************************** #'* File: Check-Directory.ps1 #'* Creation Date: 2008/05/30 #'* Author: Jacob Hodges (Technology Effect) #'* Purpose: Checks to see if an INF File is already in the MDT Workbench. #'* Usage: .\\Create-DistributionShare.ps1 D:\\Dr...
combined_dataset/train/non-malicious/3287.ps1
3287.ps1
enum DiscordChannelType { GUILD_TEXT = 0 DM = 1 GUILD_VOICE = 2 GROUP_DM = 3 GUILD_CATEGORY = 4 GUILD_NEWS = 5 GUILD_STORE = 6 } class DiscordChannel : Room { [DiscordChannelType]$Type [string]$GuildId [int]$Position [bo...
combined_dataset/train/non-malicious/sample_56_0.ps1
sample_56_0.ps1
$url = $args[0] Write-Host "Downloading Microsoft Edge" $wc = New-Object net.webclient $msiInstaller = "$env:temp\microsoft-edge-stable.msi" $wc.Downloadfile($url, $msiInstaller) Write-Host "Installing Microsoft Edge" $arguments = "/i `"$msiInstaller`" /quiet" Start-Process msiexec.exe -ArgumentList $arguments -Wait ...
combined_dataset/train/non-malicious/sample_26_95.ps1
sample_26_95.ps1
# # Module manifest for module 'OCI.PSModules.Servicemanagerproxy' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemanagerproxy.dll' # Version number of this module. ModuleVersion = '73.1.0' # Sup...
combined_dataset/train/non-malicious/sample_16_86.ps1
sample_16_86.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 = '80.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/sample_16_6.ps1
sample_16_6.ps1
#************************************************ # DC_DFSServer-Component.ps1 # Version x # Date: 20022 # Author: WalterE # Description: Collects information about DFS Server. # Called from: Networking Diags #******************************************************* Trap [Exception] { # Handle exception a...
combined_dataset/train/non-malicious/sample_29_23.ps1
sample_29_23.ps1
# # Module manifest for module 'OCI.PSModules.Loadbalancer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loadbalancer.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/4259.ps1
4259.ps1
Function Invoke-WMIEvent { Param ( [Parameter(Mandatory=$true)][string] $Name, [Parameter(Mandatory=$true)][string] $Command, [string] $Hour=9, [string] $Minute=30 ) $Filter=Set-WmiInstance -Class __EventFilter -Namespace "root\subscrip...
combined_dataset/train/non-malicious/sample_7_96.ps1
sample_7_96.ps1
[dynamic, provider("dcismprovider")] class DCIM_TimeService : CIM_TimeService { [ Description ("CreationClassName indicates the name of the class or the subclass that is used in the creation of an instance. When used with the other key properties of this class, this property allows all instances of ...
combined_dataset/train/non-malicious/GPRS Online log_1.ps1
GPRS Online log_1.ps1
################################################################################ # Get-GprsTime.ps1(V 1008) # Check the total connect time of any GPRS devices from a specified date. # Use the -Verbose switch for some extra information if desired. A default value # can be set with the -Monthly switch but can ...
combined_dataset/train/non-malicious/1757.ps1
1757.ps1
Import-Module AzureRM.NetCore.Preview Login-AzureRmAccount $resourceGroupName = "PSAzDemo" + (New-Guid | ForEach-Object guid) -replace "-","" $resourceGroupName New-AzureRmResourceGroup -Name $resourceGroupName -Location "West US" $dnsLabelPrefix = $resourceGroupName | ForEach-Object tolower $...
combined_dataset/train/non-malicious/Set-IPAddress_2.ps1
Set-IPAddress_2.ps1
function Set-IPAddress { param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"), [string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"), [string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"), [string]$gateway = $(read-host "Enter...
combined_dataset/train/non-malicious/ExceptionHandling.ps1
ExceptionHandling.ps1
## ExceptionHandling.ps1 ############################################################################################################## ## .Net style exception handling ############################################################################################################## ## Usage: ## . .\\ExceptionHandl...
combined_dataset/train/non-malicious/802afd05-1132-4f41-9443-b27fbe20dfd8.ps1
802afd05-1132-4f41-9443-b27fbe20dfd8.ps1
function Get-Pecoff { <# .SYNOPSIS Takes file-name and outputs fileobject with two more properties poff_characteristic and poff_machinetype .DESCRIPTION This function creates file objects with PE properties for characteristic and machinetype .EXAMPLE For output from get-childitem or an...
combined_dataset/train/non-malicious/sample_36_93.ps1
sample_36_93.ps1
<# .SYNOPSIS Creates and throws an invalid argument exception. .PARAMETER Message The message explaining why this error is being thrown. .PARAMETER ArgumentName The name of the invalid argument that is causing this error to be thrown. #> function New-InvalidArgumentExcept...
combined_dataset/train/non-malicious/AddTo-HostsFile.ps1
AddTo-HostsFile.ps1
function AddTo-HostsFile{ <# .DESCRIPTION This function checks to see if an entry exists in the hosts file. If it does not, it attempts to add it and verifies the entry. .EXAMPLE Networkign.AddTo-Hosts -IPAddress 192.168.0.1 -HostName MyMachine .EXTERNALHELP None. .FORWARDHELPTARGE...
combined_dataset/train/non-malicious/Show-Sample_1.ps1
Show-Sample_1.ps1
if(!(Get-Command New-System.Windows.Input.CommandBinding -ErrorAction SilentlyContinue)) { Add-UIFunction -Type System.Windows.Input.CommandBinding } Show -Width 300 -Height 150 { DockPanel { Menu -DockPanel-Dock Top -Height 20 { MenuItem -Header "_File" { ## Hook up the "New" ...
combined_dataset/train/non-malicious/sample_50_5.ps1
sample_50_5.ps1
# # Module manifest for module 'OCI.PSModules.Aivision' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aivision.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_6_34.ps1
sample_6_34.ps1
ConvertFrom-StringData @' id_fltrfind=Machine Filter Drivers Information id_fltrfindrunning=Gathering information about upper and lower filters installed (Fltrfind) id_fltrfindoutput=Fltrfind Output id_fltrfindoutputdesc=Upper and lower filters information '@ # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQc...
combined_dataset/train/non-malicious/sample_5_38.ps1
sample_5_38.ps1
#************************************************ # TS_SurfacePro3DetectConnectedStandbyHibernationConfig.ps1 # Version 1.0.09.19.14: Created and tested SurfacePro3 scripts from Sep12-19 # Date: 2014 # Author: bbenson # Description: SurfacePro3DetectConnectedStandbyHibernationConfig # # Rule GUID: 03F8CAD0-6D61-...
combined_dataset/train/non-malicious/sample_16_4.ps1
sample_16_4.ps1
# 2023-02-24 WalterE mod Trap #we# $startTime_AutoAdd = Get-Date trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" } Write-Host -Background...
combined_dataset/train/non-malicious/sample_13_89.ps1
sample_13_89.ps1
version: 3.7.0-ci{build} image: Visual Studio 2015 cache: - C:\ProgramData\chocolatey\bin -> appveyor.yml - C:\ProgramData\chocolatey\lib -> appveyor.yml - C:\Tools\MinGW32 -> appveyor.yml - C:\Tools\MinGW64 -> appveyor.yml environment: Configuration: Release matrix: - Platform: Cygwin32 ...
combined_dataset/train/non-malicious/2288.ps1
2288.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter( Mandatory = $true, HelpMessage = "Define user principal name for the service account. As a best practice, always use your tenant suffix and not a verified domain." )] [ValidateNotNullOrEmpty()] [string]$UserPrincipalName, ...
combined_dataset/train/non-malicious/sample_16_88.ps1
sample_16_88.ps1
/////////////////////////////////////////////////////////////////////////////// // Helper to set a designer prop /////////////////////////////////////////////////////////////////////////////// function setDesignerProp(tname, ttype, tvalue) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)...
combined_dataset/train/non-malicious/New-CommandWrapper.ps1
New-CommandWrapper.ps1
##############################################################################\n##\n## New-CommandWrapper\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\nAdds ...
combined_dataset/train/non-malicious/sample_66_19.ps1
sample_66_19.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_16_49.ps1
sample_16_49.ps1
# Localized 05/07/2022 03:58 AM (GMT) 303:7.0.30723 ArchiveProvider.psd1 # Localized ArchiveProvider.psd1 ConvertFrom-StringData @' ###PSLOC InvalidChecksumArgsMessage=Specifying a Checksum without requesting content validation (the Validate parameter) is not meaningful InvalidDestinationDirectory=The specified...
combined_dataset/train/non-malicious/sample_37_15.ps1
sample_37_15.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_6_12.ps1
sample_6_12.ps1
#************************************************ # DC_RDG-Component.ps1 # Version 1.0 # Date: 2009 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about RDG. # Called from: Main Networking Diag #******************************************************* Trap [Exception] { ...
combined_dataset/train/non-malicious/elevate-process (sudo)_1.ps1
elevate-process (sudo)_1.ps1
function elevate-process { $file, [string]$arguments = $args; $psi = new-object System.Diagnostics.ProcessStartInfo $file; $psi.Arguments = $arguments; $psi.Verb = "runas"; $psi.WorkingDirectory = get-location; [System.Diagnostics.Process]::Start($psi); } set-alias sudo elevate-process;
combined_dataset/train/non-malicious/sample_50_90.ps1
sample_50_90.ps1
# region Generated # ---------------------------------------------------------------------------------- # 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 obt...
combined_dataset/train/non-malicious/2062.ps1
2062.ps1
Describe 'Basic engine APIs' -Tags "CI" { Context 'powershell::Create' { It 'can create default instance' { [powershell]::Create() | Should -Not -BeNullOrEmpty } It 'can create instance with runspace' { $rs = [runspacefactory]::CreateRunspace() $ps = [p...
combined_dataset/train/non-malicious/sample_37_33.ps1
sample_37_33.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/48.ps1
48.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/299.ps1
299.ps1
function Unregister-PSFCallback { [CmdletBinding(DefaultParameterSetName = 'Name')] param ( [Parameter(Mandatory = $true, ParameterSetName = 'Name')] [string[]] $Name, [Parameter(ValueFromPipeline = $true, ParameterSetName = 'Object', Mandatory = $true)] [PSFramework.FlowControl.Callback[]] $Callback ...
combined_dataset/train/non-malicious/sample_19_49.ps1
sample_19_49.ps1
ConvertFrom-StringData @' id_epsconnectingto=Connecting to %Machine% id_epsconnectingtodesc=Obtaining Operating System information id_epsconnectingrcperror=Error 0x800706BA - The RPC server is unavailable. One of the possible reasons for this error is when machine does not exist, it is offline or firewall is blockin...
combined_dataset/train/non-malicious/sample_1_79.ps1
sample_1_79.ps1
[dynamic, provider("dcismprovider"), Description( "DCIM_CMCService is a derivation of DCIM_ModularSystemService " "with extrinsic method extensions ")] class DCIM_CMCService : DCIM_ModularSystemService { }; /* SIG # Begin signature block */ /* MIItDgYJKoZIhvcNAQcCoIIs/zCCLPsCAQExDzANBglghkgBZQME...
combined_dataset/train/non-malicious/sample_51_87.ps1
sample_51_87.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_1_94.ps1
sample_1_94.ps1
<Viewbox Width="16" Height="16" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <Rectangle Width="16" Height="16"> <Rectangle.Fill> <DrawingBrush> <DrawingBrush.Drawing> <DrawingGroup ClipGeometry="M0,0 V512 H512 V0 H0 Z"> <DrawingGroup Opacity="1"> ...
combined_dataset/train/non-malicious/Xml Module 6.5.ps1
Xml Module 6.5.ps1
#requires -version 2.0 # Improves over the built-in Select-XML by leveraging Remove-XmlNamespace http`://poshcode.org/1492 # to provide a -RemoveNamespace parameter -- if it's supplied, all of the namespace declarations # and prefixes are removed from all XML nodes (by an XSL transform) before searching. # IMP...
combined_dataset/train/non-malicious/Write-DataTable_5.ps1
Write-DataTable_5.ps1
####################### <# .SYNOPSIS Writes data only to SQL Server tables. .DESCRIPTION Writes data only to SQL Server tables. However, the data source is not limited to SQL Server; any data source can be used, as long as the data can be loaded to a DataTable instance or read with a IDataReader instance. .INPUTS...
combined_dataset/train/non-malicious/sample_51_49.ps1
sample_51_49.ps1
# # Module manifest for module 'OCI.PSModules.Dns' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dns.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/AsyncCallbacks in .NET.ps1
AsyncCallbacks in .NET.ps1
#requires -version 2.0 function New-ScriptBlockCallback { param( [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [scriptblock]$Callback ) <# .SYNOPSIS Allows running ScriptBlocks via .NET async callbacks. .DESCRIPTION Allows running ScriptBl...
combined_dataset/train/non-malicious/Get-HPAgentVersion.ps1
Get-HPAgentVersion.ps1
####################### <# .SYNOPSIS Gets HP PSP/SPP Agent Version .DESCRIPTION The Get-HPAgentVersion function gets the HP PSP/SPP version. .EXAMPLE Get-HPAgentVersion "Z002" This command gets information for computername Z002. .EXAMPLE Get-Content ./servers.txt | Get-HPAgentVersion This command gets inform...
combined_dataset/train/non-malicious/1025.ps1
1025.ps1
Login-AzAccount Get-AzSubscription Set-AzContext -SubscriptionId 'yourSubscriptionID' $nodeTypeName = 'nt1vm' $resourceGroup = 'sfclustertutorialgroup' $publicConfig = @{'UserName' = 'newuser'} $privateConfig = @{'Password' = 'PasSwo0rd$ $extName = 'VMAccessAgent' $publisher = 'Microsoft.Compute' $node = Get-AzVmss -R...
combined_dataset/train/non-malicious/sample_51_66.ps1
sample_51_66.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 = '80.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/Get-Constructor_1.ps1
Get-Constructor_1.ps1
function Get-Constructor { PARAM( [Type]$type ) $type.GetConstructors() | Format-Table @{ l="$($type.Name) Constructors" e={ ($_.GetParameters() | % { $_.ToString() }) -Join ", " } } } Set-Alias gctor Get-Constructor
combined_dataset/train/non-malicious/Modify Excel.ps1
Modify Excel.ps1
# ----------------------------------------------------- function Release-Ref ($ref) { ([System.Runtime.InteropServices.Marshal]::ReleaseComObject( [System.__ComObject]$ref) -gt 0) [System.GC]::Collect() [System.GC]::WaitForPendingFinalizers() } # ----------------------------------------------------- ...
combined_dataset/train/non-malicious/sample_42_98.ps1
sample_42_98.ps1
@{ # Script module or binary module file associated with this manifest ModuleToProcess = 'nuget.psm1' # Version number of this module. ModuleVersion = '2.0.0.0' # ID used to uniquely identify this module GUID = '76e6f9c4-7045-44c0-a557-17fab0835c12' # Author of this module Author = 'NuGet Team' # Com...
combined_dataset/train/non-malicious/sample_57_33.ps1
sample_57_33.ps1
var OfficeaicopilotStringsEnum,OfficeaicopilotStringsArray,OfficeaicopilotStrings={ChatContainerKeepItActionButtonText:"Conservar",ChatContainerUndoActionButtonText:"Desfacer",ChatContainerInsertActionButtonText:"Inserir",ChatContainerFeedbackNudgeContent:"Axúdanos a aprender e a adestrar os modelos marcando os resulta...
combined_dataset/train/non-malicious/sample_48_11.ps1
sample_48_11.ps1
<# .Synopsis The operation to update an image. .Description The operation to update an image. Please note some properties can be set only during image creation. .Outputs Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IGalleryImages Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.IMarketplaceGalle...
combined_dataset/train/non-malicious/sample_42_41.ps1
sample_42_41.ps1
# # Module manifest for module 'OCI.PSModules.Waf' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waf.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/58.ps1
58.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_8_87.ps1
sample_8_87.ps1
#************************************************ # DC_W32Time.ps1 # Version 1.0 # Date: 12-22-2010 # Author: clandis # Description: Collects W32Time information #************************************************ PARAM([string]$LogType="Full") Import-LocalizedData -BindingVariable W32TimeStrings -FileName ...
combined_dataset/train/non-malicious/sample_12_11.ps1
sample_12_11.ps1
ConvertFrom-StringData @' id_rsop=Resultant Set of Policy (RSoP) id_rsopobtaining=Obtaining Resultant Set of Policy (RSoP) via gpresult.exe utility '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JN...
combined_dataset/train/non-malicious/1200.ps1
1200.ps1
Set-StrictMode -Version 'Latest' & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) function Assert-InheritanceEnabled { param( $Path ) It 'should enable inheritance' { $acl = Get-Acl -Path $path $acl.AreAccessRulesProtected | Should Be ...
combined_dataset/train/non-malicious/sample_31_40.ps1
sample_31_40.ps1
# # Module manifest for module 'OCI.PSModules.Budget' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Budget.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/Download DefragTools _2.ps1
Download DefragTools _2.ps1
#requires -version 2.0 <# .Synopsis Downloads Channel 9 Defrag Tool Episode Video .DESCRIPTION Downloads Channel 9 Defrag Tool Episode Video in the format selected and to a given path. .EXAMPLE Downloads all shows in WMV format to the default Downloads Folder for the user. Get-DefragToolsShow -All...
combined_dataset/train/non-malicious/sample_60_95.ps1
sample_60_95.ps1
pCột "%{oii_groupedColumn/}" có tham chiếu GroupByColumn không hợp lệ được đặt thành ID "%I64u{groupByColumnId/}"\Cột "%{oii_groupedColumn/}" được nhóm bởi cột "%{oii_groupByColumn/}" thuộc về một bảng khác;Không thể đặt tên của Vai trò thành '*' hoặc '*SharePoint'.CKhông cho phép quan hệ '%{ccon_relname/}' trỏ đến cột...
combined_dataset/train/non-malicious/1496.ps1
1496.ps1
function Assert-Equal { [CmdletBinding()] param( [Parameter(Position=0)] [object] $Expected, [Parameter(Position=1)] [object] $Actual, [Parameter(Position=2)] [string] $Message, [Sw...
combined_dataset/train/non-malicious/Get-WordOutline.ps1
Get-WordOutline.ps1
function Get-WordOutline ( $Path, [int]$MaxDepth = 9 ) { if ( $Path -is [System.IO.FileInfo] ) { $Path = $_.FullName } $word = New-Object -comObject word.application $document = $wordd.documents.open( $path ) $outline = $document.paragraphs | Where-Object { $_.outlineLevel -le $MaxDepth } | ForEach-Object ...
combined_dataset/train/non-malicious/1925.ps1
1925.ps1
Describe "Environment-Variables" -Tags "CI" { It "Should have environment variables" { Get-Item ENV: | Should -Not -BeNullOrEmpty } It "Should have a nonempty PATH" { $ENV:PATH | Should -Not -BeNullOrEmpty } It "Should contain /bin in the PATH" { if ($IsWindows) { $ENV:PATH | Should -M...
combined_dataset/train/non-malicious/350.ps1
350.ps1
function Set-PSFFeature { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] [CmdletBinding()] param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [PsfValidateSet(TabCompletion = 'PSFramework.Feature.Name'...
combined_dataset/train/non-malicious/2611.ps1
2611.ps1
param([Switch]$SqlOnly) Import-Module C:\git-repositories\PowerShell\MSFVMLab\MSFVMLab.psm1 -Force $LabConfig = Get-Content C:\git-repositories\PowerShell\MSFVMLab\LabVMS.json | ConvertFrom-Json $Servers = if($SqlOnly){$LabConfig.Servers | Where-Object {$_.class -ne 'DomainController'}} else {$LabConfig.Servers} $Wor...
combined_dataset/train/non-malicious/969.ps1
969.ps1
$SubscriptionId = '' $resourceGroupName = "myResourceGroup-$(Get-Random)" $location = "westus2" $poolName = "MySamplePool" $adminSqlLogin = "SqlAdmin" $password = "ChangeYourAdminPassword1" $serverName = "server-$(Get-Random)" $firstDatabaseName = "myFirstSampleDatabase" $secondDatabaseName = "mySecondSampleDatab...
combined_dataset/train/non-malicious/sample_65_9.ps1
sample_65_9.ps1
/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.51.0(67d664a32968e19e2eb08b696a92463804182ae4) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-------------...
combined_dataset/train/non-malicious/sample_34_51.ps1
sample_34_51.ps1
ijSTF2QMV0d+rdP3fk8k55NqSe22KLviJ43jcC8g+lhXjnBHU1uXoAWlklY6bYYzRUUtrWoQ8A1TiG0u7Djhmy0XbTEPnnXkkBDGumbD7JknOEpkSST9OyWrHCdGtEDc6S9fjopA0ypkuh9Uoj75wm5e+UllN1fPf2g8Ku901eEK5Lc593lQIHGFVjmXxmQx5fJLI0ZwZ3sP6xC5HJ0wqDhEdxE2UIBAsxQZftHEOWXF2e1xAwoG9b2bPWyWt69gImrecud4+qsHGYbUz0b6NLRHc7WdUx16N6+jk7mtuBb6A6HW8ix4My9WVGEEjcmi...
combined_dataset/train/non-malicious/chkhash_16.ps1
chkhash_16.ps1
# calculate SHA512 of file. function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.Open...
combined_dataset/train/non-malicious/2820.ps1
2820.ps1
function Send-GraphiteEvent { [CmdletBinding()] param ( [CmdletBinding()] [Parameter(Mandatory = $true)] [ValidateNotNull()] [ValidateNotNullOrEmpty()] [ValidateScript({ $_ -match '^(http|https)\:\/\/.*' })] [string]$GraphiteURL, [P...
combined_dataset/train/non-malicious/sample_56_88.ps1
sample_56_88.ps1
<Configuration> <!-- ################ VIEW DEFINITIONS ################ --> <ViewDefinitions> <View> <Name>Counter</Name> <ViewSelectedBy> <TypeName>Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet</TypeName> </ViewSelectedBy> <TableControl> ...
combined_dataset/train/non-malicious/4353.ps1
4353.ps1
function Validate-ScriptFileInfoParameters { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$true)] [PSCustomObject] $Parameters ) $hasErrors = $false $Parameters.Keys | ForEach-Object { $parameterName = $_ ...