full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_37_31.ps1
sample_37_31.ps1
# # Module manifest for module 'OCI.PSModules.Apigateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apigateway.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/3587.ps1
3587.ps1
function Get-ResourceGroupName { return getAssetName } function Get-ResourceName { return getAssetName } function Get-ProviderLocation($provider) { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { ...
combined_dataset/train/non-malicious/2836.ps1
2836.ps1
function FormatErrorMessage { [CmdletBinding()] param( [Parameter(ValueFromPipeline=$true)] $ErrorRecord = $Error[0] ) $currentConfig = GetCurrentConfigurationOrDefault if ($currentConfig.verboseError) { $error_message = "{0}: An Error Occurred. See Error Details Below: $($s...
combined_dataset/train/non-malicious/sample_48_5.ps1
sample_48_5.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ManagedServices.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ManagedServices.internal.psm1' if(Test-Path $internalModuleP...
combined_dataset/train/non-malicious/2696.ps1
2696.ps1
function Get-Entropy { [CmdletBinding()] Param ( [Parameter(Mandatory = $True, Position = 0, ValueFromPipeline = $True, ParameterSetName = 'Bytes')] [ValidateNotNullOrEmpty()] [Byte[]] $ByteArray, [Parameter(Mandatory = $True, Position = 0, ParameterSetName = 'File')] ...
combined_dataset/train/non-malicious/sample_45_60.ps1
sample_45_60.ps1
# # Module manifest for module 'OCI.PSModules.Oda' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Oda.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_32_78.ps1
sample_32_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', 'New-Al...
combined_dataset/train/non-malicious/sample_2_1.ps1
sample_2_1.ps1
# File DC_RegistryStorage.ps1 # Copyright 2020, Microsoft Corporation. All rights reserved. Import-LocalizedData -BindingVariable UtilsRegistrySetupPerf $OutputFile= $Computername + "_reg_MountedDevices.TXT" RegQuery -RegistryKeys "HKLM\System\MountedDevices" -OutputFile $OutputFile -fileDescription "MountedDev...
combined_dataset/train/non-malicious/Test-SqlConnection_1.ps1
Test-SqlConnection_1.ps1
####################### <# Version History v1.0 - Chad Miller - Initial release v1.1 - Chad Miller - Fixed issues, added colorized HTML output #> Add-Type -AssemblyName System.Xml.Linq $Script:CMServer = 'MyServer' ####################### function Test-Ping { param([Parameter(Mandatory=$true, V...
combined_dataset/train/non-malicious/sample_3_21.ps1
sample_3_21.ps1
ConvertFrom-StringData @' id_pstat=Process and Driver Information (pstat) id_pstatrunning=Running pstat tool to obtain process information id_pstatoutput=Pstat Output '@ # SIG # Begin signature block # MIIoQgYJKoZIhvcNAQcCoIIoMzCCKC8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAw...
combined_dataset/train/non-malicious/sample_24_29.ps1
sample_24_29.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=此名稱和類型的環境變數已存在。 EnvironmentErrorDoesNotExists=此名稱和類型的環境變數不存在。 '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIB...
combined_dataset/train/non-malicious/sample_41_39.ps1
sample_41_39.ps1
# # Module manifest for module 'OCI.PSModules.Announcementsservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Announcementsservice.dll' # Version number of this module. ModuleVersion = '83.1.0' # S...
combined_dataset/train/non-malicious/Get-WindowsExperience_1.ps1
Get-WindowsExperience_1.ps1
function Get-WindowsExperienceRating { #.Synopsis # Gets the Windows Experience Ratings #.Parameter ComputerName # The name(s) of the computer(s) to get the Windows Experience (WinSat) numbers for. [CmdletBinding()] param( [Parameter(ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [string[...
combined_dataset/train/non-malicious/sample_56_65.ps1
sample_56_65.ps1
# # Module manifest for module 'OCI.PSModules.Workrequests' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Workrequests.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/Get-MWSOrder_2.ps1
Get-MWSOrder_2.ps1
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="GetOrderCmdlet.cs" company="Huddled Masses"> // Copyright (c) 2011 Joel Bennett // </copyright> // <summary> // Defines the Get-Order Cmdlet for Amazon Marketplace Orders ...
combined_dataset/train/non-malicious/3185.ps1
3185.ps1
function New-IPRange { [cmdletbinding()] param ( [parameter( Mandatory = $true, Position = 0 )] [System.Net.IPAddress]$Start, [parameter( Mandatory = $true, Position = 1)] [System.Net.IPAddress]$End, [int[]]$Exclude = @( 0, 1, 255 ) ) Write-Verbo...
combined_dataset/train/non-malicious/sample_31_82.ps1
sample_31_82.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function set-AMTMPSClient { <# .Synopsis Add and remove clients from the Intel Fast Call for Help Management Presence Server (MPS) interface .Description Add and remove clients from the Intel Fast Call for Help Management Presence...
combined_dataset/train/non-malicious/Move-LockedFile.ps1
Move-LockedFile.ps1
##############################################################################\n##\n## Move-LockedFile\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\nRegister...
combined_dataset/train/non-malicious/PurgeFile script..ps1
PurgeFile script..ps1
<# .SYNOPSIS Purgefiles - recursively remove files with given extension and maximum age from a given path. .DESCRIPTION Read the synopsis Example PurgeFiles.psq -path C:\\temp -ext .tmp -max 24 .EXAMPLE PurgeFiles.psq -path C:\\temp -ext .tmp -max 24 #> # HISTORY # 2010/01/29 # rluiten Created pa...
combined_dataset/train/non-malicious/5e6d3b3f-4cf8-4c50-95a0-a300d6f0b630.ps1
5e6d3b3f-4cf8-4c50-95a0-a300d6f0b630.ps1
# to load c:\\powershellscripts\\cluster_utils.ps1 if it isn't already loaded @@. require cluster_utils Here are the functions: $global:loaded_scripts=@{} function require([string]$filename){ if (!$loaded_scripts[$filename]){ . c:\\powershellscripts\\$filename $loaded_scripts[$filename]...
combined_dataset/train/non-malicious/Paraimpu.ps1
Paraimpu.ps1
# This requires JSON 1.7 ( http://poshcode.org/2930 ) and the HttpRest ( http://poshcode.org/2097 ) modules # It's a first draft at Paraimpu cmdlets # I'm not sure yet that using Paraimpu with my Chumby gets me what I want, since it only shows one item and can't go back to old ones. # # YOU SHOULD SET THE $Token ...
combined_dataset/train/non-malicious/sample_1_72.ps1
sample_1_72.ps1
[ Version("1_0_1"), Description("This object shall contain information detailing " "the HTTP and JSON payload information for executing this job."), Invisible ] class DCIM_JobPayload { [Description("This property shall contain a URI referencing a " "location to be used as the...
combined_dataset/train/non-malicious/sample_6_51.ps1
sample_6_51.ps1
#************************************************ # DC_ProxyConfiguration.ps1 # Version 1.0: Proxy Configuration for IE User, WinHTTP, Firewall Client, PAC Files, Network Isolation # Version 1.1: Added Proxy Configuration for IE System # Version 1.2 (4/28/14): Edited table of contents. # Create date: 12/5/2012 #...
combined_dataset/train/non-malicious/sample_55_0.ps1
sample_55_0.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/sample_47_76.ps1
sample_47_76.ps1
# Copyright (C) Microsoft Corporation. All rights reserved. # # File: LAPS.psm1 # Author: jsimmons@microsoft.com # Date: April 13, 2023 # # This file implements the Get-LapsDiagnostics and Get-LapsAADPasswordPowerShell cmdlets. function RunProcess() { Param ( [Parameter(Mandatory=$true)] ...
combined_dataset/train/non-malicious/893.ps1
893.ps1
$gitrepo="https://github.com/Azure-Samples/app-service-web-dotnet-get-started.git" $webappname="mywebapp$(Get-Random)" $location="West Europe" New-AzResourceGroup -Name myResourceGroup -Location $location New-AzAppServicePlan -Name $webappname -Location $location -ResourceGroupName myResourceGroup -Tier Free New...
combined_dataset/train/non-malicious/708.ps1
708.ps1
function Remove-RsRestCatalogItem { [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')] param( [Parameter(Mandatory = $True)] [string] $RsItem, [string] $ReportPortalUri, [Alias('ApiVersion')] [ValidateSet("v2.0")] [st...
combined_dataset/train/non-malicious/sample_41_28.ps1
sample_41_28.ps1
# # Module manifest for module 'OCI.PSModules.Loggingsearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loggingsearch.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/Manage ASP_5.NET Providers.ps1
Manage ASP_5.NET Providers.ps1
# Manage_ASP_NET_Providers.ps1 # by Chistian Glessner # http://iLoveSharePoint.com # If you want to change the app config you have to restart PowerShell param($appConfigPath=$null) # App config path have to be set before loading System.Web.dll [System.AppDomain]::CurrentDomain.SetData("APP_CONFIG_FILE", $appC...
combined_dataset/train/non-malicious/2237.ps1
2237.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server name with SMS Provider installed")] [string]$SiteServer, [parameter(Mandatory=$true, HelpMessage="Path to where the Driver Source root directory is located")] [ValidatePattern("^\\\\\w+\\\w+")] ...
combined_dataset/train/non-malicious/New-ISEMenu_5.ps1
New-ISEMenu_5.ps1
Import-Module ShowUI Function New-ISEMenu { New-Grid -AllowDrop:$true -Name "ISEAddonCreator" -columns Auto, * -rows Auto,Auto,Auto,*,Auto,Auto -Margin 5 { New-Label -Name Warning -Foreground Red -FontWeight Bold -Column 1 ($target = New-TextBox -Name txtName -Column 1 -Row ($Row=1)) New-Label...
combined_dataset/train/non-malicious/sample_49_14.ps1
sample_49_14.ps1
ConvertFrom-StringData @' IPAddressDisplayNameFormat=Indirizzo IP: {0} NetworkNameDisplayNameFormat=Nome: {0} NetworkNameOfflineDisplayNameFormat=Indirizzo IP: indirizzo su "{0}" CreateClusterProgressValidationStart=Convalida dell'idoneità dei server per un cluster di failover in corso. CreateClusterProgressValida...
combined_dataset/train/non-malicious/0dbcab33-47ec-4c68-98cd-b9e906786e5a.ps1
0dbcab33-47ec-4c68-98cd-b9e906786e5a.ps1
$WarningPreference = "SilentlyContinue" $password = Get-Content C:\\securestring.txt | convertto-securestring $username = "PROD\\administrator" $credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password $uucenter = "uuoresund.dk" $totalSize = 0 $session = ...
combined_dataset/train/non-malicious/WpfBindingHelper.ps1
WpfBindingHelper.ps1
using System; using System.Windows; using System.ComponentModel; using System.Windows.Markup; using System.Windows.Data; using System.Globalization; namespace PoshWpf { public class BindingConverter : ExpressionConverter { public override bool CanConvertTo(ITypeDescriptorContext context, Type de...
combined_dataset/train/non-malicious/2987.ps1
2987.ps1
Set-StrictMode -Version Latest Describe "Module scope separation" { Context "When users define variables with the same name as Pester parameters" { $test = "This is a test." It "does not hide user variables" { $test | Should -Be 'This is a test.' } } It "Does not expos...
combined_dataset/train/non-malicious/2772.ps1
2772.ps1
Get-WmiObject win32_service | Select-Object Name, DisplayName, PathName, StartName, StartMode, State, TotalSessions, Description
combined_dataset/train/non-malicious/3283.ps1
3283.ps1
$platform = 'windows' Add-Type -Path "$ModulePath/lib/$platform/Microsoft.ServiceBus.dll" $factory = [Microsoft.ServiceBus.Messaging.MessagingFactory]::CreateFromConnectionString($connectionString) $receiver = $factory.CreateMessageReceiver($QueueName, [Microsoft.ServiceBus.Messaging.ReceiveMode]::PeekLo...
combined_dataset/train/non-malicious/3224.ps1
3224.ps1
InModuleScope PoshBot { describe 'Get-PoshBot' { $script:botTracker = @{} it 'Returns nothing if no jobs exist' { Get-Poshbot | Should BeNullorEmpty } $guid1 = (New-Guid).ToString() $guid2 = (New-Guid).ToString() $script:botTracker.Add(1, @{ ...
combined_dataset/train/non-malicious/sample_53_30.ps1
sample_53_30.ps1
# # Module manifest for module 'OCI.PSModules.Adm' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Adm.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_30_14.ps1
sample_30_14.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 = '77...
combined_dataset/train/non-malicious/sample_25_88.ps1
sample_25_88.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/825cfd12-39f8-4fa2-9843-880b0ab0e880.ps1
825cfd12-39f8-4fa2-9843-880b0ab0e880.ps1
$Raw = Whoami /groups $Groups = $Raw | ?{ $_ -match "Enabled Group" } | %{$_.Split(" ,")[0] } | ?{ $_ -like "*\\*" }| Sort $Groups
combined_dataset/train/non-malicious/sample_38_48.ps1
sample_38_48.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/1651.ps1
1651.ps1
c: cd\ Get-ChildItem -Path $PSScriptRoot\*.ps1 | ? name -NotMatch 'Microsoft.PowerShell_profile' | Foreach-Object { . $_.FullName } $env:path = @( $env:path 'C:\Program Files (x86)\Notepad++\' 'C:\Users\admin\AppData\Local\GitHub\PortableGit_c7e0cbde92ba565cb218a521411d0e854079a28c\cmd' 'C:\Users\...
combined_dataset/train/non-malicious/sample_15_14.ps1
sample_15_14.ps1
@{ GUID="{Fb6cc51d-c096-4b38-b78d-0fed6277096a}" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" RootModule="Microsoft.Management.Infrastructure.CimCmdlets" RequiredAssembli...
combined_dataset/train/non-malicious/4189.ps1
4189.ps1
Set-Variable -Name ApplicationName -Scope Global -Force Set-Variable -Name MSI -Scope Global -Force Set-Variable -Name ProductCode -Scope Global -Force function Get-RelativePath { Set-Variable -Name RelativePath -Scope Local -Force $RelativePath = (split-path $SCRIPT:MyInvoca...
combined_dataset/train/non-malicious/Connect-AccessDB_3.ps1
Connect-AccessDB_3.ps1
# Functions for connecting to and working with Access databases # Matt Wilson # May 2009 function Connect-AccessDB ($global:dbFilePath) { # Test to ensure valid path to database file was supplied if (-not (Test-Path $dbFilePath)) { Write-Error "Invalid Access database path specified. Please supply full a...
combined_dataset/train/non-malicious/3972.ps1
3972.ps1
function Test-AvailableSslOptions { $result = Get-AzApplicationGatewayAvailableSslOptions Assert-NotNull $result Assert-NotNull $result.DefaultPolicy $result = Get-AzApplicationGatewaySslPredefinedPolicy Assert-NotNull $result Assert-True { $result.Count -gt 0 } Assert-NotNull $result[0].MinProtoc...
combined_dataset/train/non-malicious/sample_67_91.ps1
sample_67_91.ps1
ConvertFrom-StringData @' ###PSLOC NoADModule = ActiveDirectory module is not installed. Please install the module and try again. ComputerAccountMissing = No computer account for {0} found in OU {1}. Recovery keys are not avialable in Active Directory ComputerAccountExists = Computer account(s) {0} look up OU {1} w...
combined_dataset/train/non-malicious/sample_23_77.ps1
sample_23_77.ps1
# # Module manifest for module 'OCI.PSModules.Computecloudatcustomer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Computecloudatcustomer.dll' # Version number of this module. ModuleVersion = '82.0.0' ...
combined_dataset/train/non-malicious/sample_64_90.ps1
sample_64_90.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 = '84.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/2214.ps1
2214.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true,HelpMessage="Site server where the SMS Provider is installed")] [ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})] [string]$SiteServer, [parameter(Mandatory=$true,HelpMessage="Name of the Deployment Package...
combined_dataset/train/non-malicious/6.ps1
6.ps1
$HostSupportsSettingWindowTitle = $null $OriginalWindowTitle = $null function Test-WindowTitleIsWriteable { if ($null -eq $HostSupportsSettingWindowTitle) { try { $script:OriginalWindowTitle = $Host.UI.RawUI.WindowTitle $newTitle = "${OriginalWindowTitle} " $Hos...
combined_dataset/train/non-malicious/sample_35_0.ps1
sample_35_0.ps1
# # Module manifest for module 'Microsoft.SME.NetworkController' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.NetworkController.psm1' # Version number of this module. ModuleVersion = '3.12.0' # Supported PSEditions # CompatiblePSEditions = @() ...
combined_dataset/train/non-malicious/sample_51_55.ps1
sample_51_55.ps1
. ./Stop-Process2.ps1 notepad.exe notepad.exe notepad.exe Stop-Process2 -Name "notepad" # SIG # Begin signature block # MIIr5wYJKoZIhvcNAQcCoIIr2DCCK9QCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA4mt...
combined_dataset/train/non-malicious/sample_34_62.ps1
sample_34_62.ps1
# # Module manifest for module 'OCI.PSModules.Lockbox' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Lockbox.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/236.ps1
236.ps1
function Get-SCCMClientCacheInformation { PARAM( [string[]]$ComputerName=".", [Alias('RunAs')] [System.Management.Automation.Credential()] [pscredential] $Credential = [System.Management.Automation.PSCredential]::Empty ) FOREACH ($Computer in $ComputerName) { ...
combined_dataset/train/non-malicious/sample_47_63.ps1
sample_47_63.ps1
@{ GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Get-Credential", "Get-ExecutionPolicy", "Set-E...
combined_dataset/train/non-malicious/4011.ps1
4011.ps1
$connectionName = "AzureRunAsConnection100" try { $servicePrincipalConnection=Get-AutomationConnection -Name $connectionName "Logging in to Azure..." Add-AzureRmAccount ` -ServicePrincipal ` -TenantId $servicePrincipalConnection.TenantId ` -ApplicationId $servicePrin...
combined_dataset/train/non-malicious/194.ps1
194.ps1
Function New-SCCMTSAppVariable { PARAM ([String]$BaseVariableName, [String[]]$ApplicationList ) BEGIN { $TaskSequenceEnvironment = New-Object -COMObject Microsoft.SMS.TSEnvironment } PROCESS { $Counter = 1 $ApplicationList ...
combined_dataset/train/non-malicious/2577.ps1
2577.ps1
param ( $server = $(read-host "Server ('localhost' okay)"), $instance = $(read-host "Instance ('default' okay)"), $database = $(read-host "Database"), $newDatabase = $(read-host "New Database Name"), $file = $(read-host "Script path and file name") ) function Replace-String($find, $replace, $rep...
combined_dataset/train/non-malicious/1472.ps1
1472.ps1
filter Format-ForHtml { if( $_ ) { [Web.HttpUtility]::HtmlEncode($_) } }
combined_dataset/train/non-malicious/4467.ps1
4467.ps1
$script:helperModuleName = 'PowerShellGet.ResourceHelper' $resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent $dscResourcesFolderFilePath = Join-Path -Path (Join-Path -Path $resourceModuleRoot -ChildPath 'Modules') ` -ChildPath $script:helperModuleName Import-Module -Name (J...
combined_dataset/train/non-malicious/sample_25_68.ps1
sample_25_68.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/3754.ps1
3754.ps1
function Get-ResourceGroupName { return getAssetName } function Get-TestStorageAccountName { return getAssetName } function Get-CommitmentPlanName { return getAssetName } function Get-WebServiceName { return getAssetName } function Get-ProviderLocation($providerNamespace, $resourc...
combined_dataset/train/non-malicious/sample_54_82.ps1
sample_54_82.ps1
# # Module manifest for module 'OCI.PSModules.Identitydomains' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Identitydomains.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported P...
combined_dataset/train/non-malicious/3582.ps1
3582.ps1
function Test-CrudApiManagement { $location = Get-ProviderLocation "Microsoft.ApiManagement/service" $resourceGroupName = Get-ResourceGroupName $apiManagementName = Get-ApiManagementServiceName $organization = "apimpowershellorg" $adminEmail = "apim@powershell.org" $secondApi...
combined_dataset/train/non-malicious/4453.ps1
4453.ps1
Find-PSResource -name 'TestCommand' Find-PSResource 'TestCommand' Find-PSResource 'TestCommand' -Type 'Command' Find-PSResource 'TestCommand' -Type 'Command', 'DscResource', 'RoleCapability', 'Module', 'Script' Find-PSResource 'TestCommand' -ModuleName 'TestCommandModuleName' Find-PSResource 'TestComman...
combined_dataset/train/non-malicious/Get-Answer.ps1
Get-Answer.ps1
##############################################################################\n##\n## Get-Answer\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\nUses Bing Ans...
combined_dataset/train/non-malicious/sample_60_45.ps1
sample_60_45.ps1
parameters: configuration: 'Debug' # Optional: condition for the job to run condition: '' # Optional: 'true' if future jobs should run even if this job fails continueOnError: false # Optional: dependencies of the job dependsOn: '' # Optional: Include PublishBuildArtifacts task enablePublishBuildAr...
combined_dataset/train/non-malicious/Add-ByteFormat.ps1
Add-ByteFormat.ps1
function Add-ByteFormat { <# .Synopsis Function to make display of custom properties more human-readable. .Description With help of this function you will be able to force nice display of numeric data. It's using best possible unit of measure for *bytes sizes. If input...
combined_dataset/train/non-malicious/sample_61_75.ps1
sample_61_75.ps1
<# .Synopsis Activate a Python virtual environment for the current PowerShell session. .Description Pushes the python executable for a virtual environment to the front of the $Env:PATH environment variable and sets the prompt to signify that you are in a Python virtual environment. Makes use of the command line...
combined_dataset/train/non-malicious/sample_44_96.ps1
sample_44_96.ps1
# # Module manifest for module 'OCI.PSModules.Appmgmtcontrol' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Appmgmtcontrol.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSE...
combined_dataset/train/non-malicious/Ping-Host_1.ps1
Ping-Host_1.ps1
function Ping-Host {param( [string]$HostName, [int32]$Requests = 3) for ($i = 1; $i -le $Requests; $i++) { $Result = Get-WmiObject -Class Win32_PingStatus -ComputerName . -Filter "Address='$HostName'" Start-Sleep -Seconds 1 if ($Result.StatusCode -ne 0) {return $FALSE} } return $TRUE }
combined_dataset/train/non-malicious/611.ps1
611.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "http://download.tuxfamily.org/notepadplus/6.5.3/npp.6.5.3.Installer.exe" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" } $Configs | ForEach-Object{ try{ $_...
combined_dataset/train/non-malicious/sample_31_10.ps1
sample_31_10.ps1
@{ GUID="{Fb6cc51d-c096-4b38-b78d-0fed6277096a}" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" RootModule="Microsoft.Management.Infrastructure.CimCmdlets" RequiredAssembli...
combined_dataset/train/non-malicious/sample_31_16.ps1
sample_31_16.ps1
# # Module manifest for module 'OCI.PSModules.Managementdashboard' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Managementdashboard.dll' # Version number of this module. ModuleVersion = '82.0.0' # Sup...
combined_dataset/train/non-malicious/5.ps1
5.ps1
if (($PSVersionTable.PSVersion.Major -ge 6) -and !$IsWindows) { function Set-ConsoleMode { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] param() } return } $consoleModeSource = @" using System; using System.Runtime.InteropServices...
combined_dataset/train/non-malicious/1163.ps1
1163.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-NewTempDir { $tmpDir = New-TempDir try { Assert-DirectoryExists $tmpDir } finally { Uninstall-Directory -Path $tmpDir -Recurse } } functi...
combined_dataset/train/non-malicious/sample_12_34.ps1
sample_12_34.ps1
#************************************************ # DC_WebClient-Component.ps1 # Version 1.0 # Date: 2009-2014 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about WebClient/WebDAV. # Called from: Networking Diagnostics #******************************************************* ...
combined_dataset/train/non-malicious/2377.ps1
2377.ps1
[CmdletBinding()] [OutputType([array])] param ( [string[]]$Computername = 'localhost', [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [ValidatePattern('[A-Z]')] [string]$DriveLetter, [ValidateSet('KB','MB','GB','TB')] [string]$SizeOutputLabel = 'MB' ) Begin { try { $W...
combined_dataset/train/non-malicious/sample_40_52.ps1
sample_40_52.ps1
# # Module manifest for module 'Microsoft.SME.Shell' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.Shell.psm1' # Version number of this module. ModuleVersion = '4.174.0' # Supported PSEditions # CompatiblePSEditions = @() # ID used to uniquely ...
combined_dataset/train/non-malicious/sample_6_93.ps1
sample_6_93.ps1
// ================================================================== // DCIM_CSEnabledLogicalElementCapabilities // ================================================================== [ dynamic, provider("dcismprovider"), Description ("A class derived from ComputerSystem" " to represent an DCIM'...
combined_dataset/train/non-malicious/sample_13_7.ps1
sample_13_7.ps1
# Localized 04/14/2024 08:54 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=&Ja PromptNoString=&Nein BundleFound=Bundle gefunden: {0} PackageFound=Paket gefunden: {0} EncryptedBundleFound=Verschlüsseltes Bundle gefunden: {0} EncryptedPackag...
combined_dataset/train/non-malicious/3098.ps1
3098.ps1
Set-StrictMode -Version Latest $here = $MyInvocation.MyCommand.Path | Split-Path Get-Module Axiom, Format | Remove-Module Import-Module $here\..\Axiom\Axiom.psm1 -ErrorAction 'stop' -DisableNameChecking Import-Module $here\Format.psm1 -ErrorAction 'stop' -DisableNameChecking function New-PSObject ([hashtable]$Propert...
combined_dataset/train/non-malicious/1530.ps1
1530.ps1
[CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $GitHubAuthToken, [Parameter(Mandatory=$true)] [string] $GitHubUsername, [Parameter(Mandatory=$true)] [string] $BitbucketExportJsonPath, [int] $Count = 1 ) Set-StrictMode -Version 'Lat...
combined_dataset/train/non-malicious/Get-MSDNInfo.ps1
Get-MSDNInfo.ps1
function Get-MSDNInfo { <# .SYNOPSIS Opens the MSDN web page of an object member: type, method or property. .DESCRIPTION The Get-MSDNInfo function enables you to quickly open a web browser to the MSDN web page of any given instance of a .NET object. You can also refer to Get-MSDNInf...
combined_dataset/train/non-malicious/WakeOnLan.ps1
WakeOnLan.ps1
#wakeonlan $computer function WakeOnLan($computer) { $select=$select |where-object {$_.computername -eq $computer} |Select-Object mac if ($select.mac -eq $null) { echo "workstation not found.epic fail. use all to wake'em all" } else { $select.mac -match "(..)(..)(..)(..)(..)(..)" | out-null $mac...
combined_dataset/train/non-malicious/sample_12_93.ps1
sample_12_93.ps1
# # Module manifest for module 'OCI.PSModules.Vault' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Vault.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/4203.ps1
4203.ps1
param ( [ValidateNotNullOrEmpty()]$MSPFileName = 'accessde-en-us.msp', [ValidateNotNullOrEmpty()]$MSPProperty = 'KBArticle Number' ) function Get-MSPFileInfo { param ( [Parameter(Mandatory = $true)][IO.FileInfo]$Path, [Parameter(Mandatory = $true)][ValidateSet('Classification', 'Description', 'DisplayName', '...
combined_dataset/train/non-malicious/sample_16_17.ps1
sample_16_17.ps1
# Localized 02/17/2024 04:13 AM (GMT) 303:7.2.30118 CL_LocalizationData.psd1 ConvertFrom-StringData @' ###PSLOC Troubleshoot_Title=Troubleshooting Troubleshoot_DetectDVDDevice=Checking DVD device ... Troubleshoot_DetectDVDvideoDecoder=Checking video decoder for DVD playback ... Troubleshoot_DetectDVDAudioDecoder...
combined_dataset/train/non-malicious/Execute-RunspaceJob.ps1
Execute-RunspaceJob.ps1
<# .SYNOPSIS Executes a set of parameterized script blocks asynchronously using runspaces, and returns the resulting data. .DESCRIPTION Encapsulates generic logic for using Powershell background runspaces to execute parameterized script blocks in an efficient, multi-threaded fashion. For detailed ex...
combined_dataset/train/non-malicious/sample_18_96.ps1
sample_18_96.ps1
if (![String]::IsNullOrEmpty($MergeCommitSha)) { $regexString = "(?mi)^commit[ ][a-z0-9]{40}\r\n^Author:[ ][^\r]+\r\n^Date:[ ]+[^\r]+(\r\n)+([ ]+[\u0020-\u007E]*\r\n)+\r\ndiff[ ]--git[ ][^\r]+\r\n[^-]+---[ ][^\r]+\r\n\+\+\+\s[^\r]+" $commitData_Capture = "(?mi)^commit[ ](?<sha>[a-z0-9]{40})\r\n(^Merge...
combined_dataset/train/non-malicious/2416.ps1
2416.ps1
[CmdletBinding()] param ( [Parameter(Mandatory = $False, ValueFromPipeline = $False, ValueFromPipelineByPropertyName = $True)] [string]$SiteCode = 'UHP', [Parameter(Mandatory = $False, ValueFromPipeline = $False, ValueFromPipelineByPropertyName = $True)] [string]$SiteServer = 'CONFIGMANAG...
combined_dataset/train/non-malicious/sample_50_51.ps1
sample_50_51.ps1
# Get the version of the Torizon IDE Extension from package.json $env:TEST_EXTENSION_VERSION = ((Get-Content "package.json" -Raw) | ConvertFrom-Json).version $env:TEST_VSCODE_CLEANUP = $true # Start the tests from a clean environment, unless explictly setting to false # the env variable if ($env:TEST_VSCODE_CLEANUP -E...
combined_dataset/train/non-malicious/964.ps1
964.ps1
$rgName='MyResourceGroup' $location='eastus' New-AzResourceGroup -Name $rgName -Location $location $vnet1 = New-AzVirtualNetwork -ResourceGroupName $rgName -Name 'Vnet1' -AddressPrefix '10.0.0.0/16' -Location $location $vnet2 = New-AzVirtualNetwork -ResourceGroupName $rgName -Name 'Vnet2' -AddressPrefix '10.1.0....
combined_dataset/train/non-malicious/1369.ps1
1369.ps1
function Clear-CMofAuthoringMetadata { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $Path ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $temp...
combined_dataset/train/non-malicious/sample_42_69.ps1
sample_42_69.ps1
# # Module manifest for module 'OCI.PSModules.Mediaservices' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Mediaservices.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/1220.ps1
1220.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) $hostsFile = $null $hostname = 'example.com' function Get-HostsEntry { param( [string] $HostName, [string] $Path = $hostsFile ) $HostName = [Text.RegularExpressions.Regex]::Es...
combined_dataset/train/non-malicious/Move-Mailbox _1.ps1
Move-Mailbox _1.ps1
param( #distribution group holding usermailbox(es) [string] $DistGroup = "XC2010Move", #move requests per batch/script run [int] $BatchCount = 5 ) #remove user(s) without mailbox Get-DistributionGroupMember $DistGroup | get-user -Filter {Recipienttype -eq "User"} -EA SilentlyContinue | Remove-DistributionGrou...