full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/Get-Dependency.ps1
Get-Dependency.ps1
$BuiltInAliases = @{} $BuiltInCmdlets = @{} $BuiltInFunctions = @{} $BuiltInVariables = @{} ############################################################################## #.SYNOPSIS # Gets a list of tokenized strings from the specified PowerShell code sample # which can be used for dependency analysis or o...
combined_dataset/train/non-malicious/sample_22_48.ps1
sample_22_48.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.EventGrid.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.EventGrid.internal.psm1' if(Test-Path $internalModulePath) { ...
combined_dataset/train/non-malicious/2038.ps1
2038.ps1
Describe "Assembly::LoadWithPartialName Validation Test" -Tags "CI" { $defaultErrorId = 'FileLoadException' $testcases = @( @{ Name = 'system.windows.forms' ErrorId = $defaultErrorId } @{ Name = 'System.Windows.F...
combined_dataset/train/non-malicious/FTP upload_6.ps1
FTP upload_6.ps1
@charset "utf-8"; /* Credit:http://www.templatemo.com */ body { margin: 0px; padding: 0px; color: #c2bead; font-family: Tahoma, Geneva, sans-serif; font-size: 12px; line-height: 1.5em; background-color: #2f2e28; background-image: url(images/templatemo_body.jpg); background-repeat: repeat-y; bac...
combined_dataset/train/non-malicious/Shift Operators(Correct)_1.ps1
Shift Operators(Correct)_1.ps1
#requires -version 2.0 Add-Type @" public class Shift { public static int Right(int x, int count) { return x >> count; } public static uint Right(uint x, int count) { return x >> count; } public static long Right(long x, int count) { return x >> count; } public static ulong Right(ulong x, int ...
combined_dataset/train/non-malicious/2764.ps1
2764.ps1
schtasks /query /FO CSV /v | ConvertFrom-Csv
combined_dataset/train/non-malicious/sample_45_5.ps1
sample_45_5.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> function Get-StampConfigurationFolder([CloudEn...
combined_dataset/train/non-malicious/sample_3_11.ps1
sample_3_11.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_0_86.ps1
sample_0_86.ps1
// Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved. // ================================================================== // DCIM_LocalUserAccountManagementCapabilities // ================================================================== [ dynamic, provider("dcismprovider"), Descr...
combined_dataset/train/non-malicious/sample_45_66.ps1
sample_45_66.ps1
#Copyright (C) 2020,2023 VMware, Inc. All rights reserved. . ".\utils.ps1" $versionstart="VERSIONSTART" $versionend="VERSIONEND" function getRegPropValue { param($key, $regKey, $name) $errorMessage = $null try { $value="" if (Test-Path $regKey) { $exp = "(Get...
combined_dataset/train/non-malicious/sample_2_75.ps1
sample_2_75.ps1
#************************************************ # DC_HyperVNetworkVirtualization.ps1 # Version 1.0 # Date: May 2014 # Author: Boyd Benson (bbenson@microsoft.com) with assistance from Tim Quinn (tiquinn@microsoft.com) # Description: PS cmdlets # Called from: Networking Diags #**********************************...
combined_dataset/train/non-malicious/sample_66_20.ps1
sample_66_20.ps1
@{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" ...
combined_dataset/train/non-malicious/Migrate-ADMTUser.ps1
Migrate-ADMTUser.ps1
###########################################################################" # # NAME: Migrate-ADMTUser.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # # COMMENT: A function to migrate a single user in the Active Directory Migration Tool, based on the sample script Invoke-ADMTUserMigration.p...
combined_dataset/train/non-malicious/sample_49_54.ps1
sample_49_54.ps1
/*!--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *----------------------------------------------------------*/ /// <reference path="telemetry.d.ts" /> var IgnoreTelemetryReporter = (function () { function IgnoreTelemetryReporter(isIntern...
combined_dataset/train/non-malicious/Get-HtmlHelp_2.ps1
Get-HtmlHelp_2.ps1
Hello, I may have contacted you in the past, but wanted to reach out again to inquire about the possibility of advertising on your blog in the form of sponsored guest posts. Either I can have content written or you can write content that is relevant to your audience and helps to promote our client's service. We...
combined_dataset/train/non-malicious/sample_50_27.ps1
sample_50_27.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/sample_47_64.ps1
sample_47_64.ps1
# # Module manifest for module 'Az.OperationalInsights' # # Generated by: Microsoft Corporation # # Generated on: 5/16/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.OperationalInsights.psm1' # Version number of this module. ModuleVersion = '3.2.1' # ...
combined_dataset/train/non-malicious/sample_46_24.ps1
sample_46_24.ps1
# # Module manifest for module 'OCI.PSModules.Osmanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osmanagement.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/Add -__ Get-Help -Full.ps1
Add -__ Get-Help -Full.ps1
$executionContext.SessionState.InvokeCommand.PostCommandLookupAction = { param($CommandName, $CommandLookupEventArgs) # Only for interactive commands (and that doesn't include "prompt") # I should exclude out-default so we don't handle it on every pipeline, but ... if($CommandLookupEventArgs.Comma...
combined_dataset/train/non-malicious/4381.ps1
4381.ps1
function New-ModuleSourceFromPackageSource { param ( [Parameter(Mandatory=$true)] $PackageSource ) $moduleSource = Microsoft.PowerShell.Utility\New-Object PSCustomObject -Property ([ordered]@{ Name = $PackageSource.Name SourceLocation = $PackageSource.Location ...
combined_dataset/train/non-malicious/sample_34_19.ps1
sample_34_19.ps1
@{ GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @('MSFT_MpPerformanceRecording.psm1') FormatsToProcess = @(...
combined_dataset/train/non-malicious/2059.ps1
2059.ps1
Import-Module HelpersCommon Describe "Enable-ExperimentalFeature and Disable-ExperimentalFeature tests" -tags "Feature","RequireAdminOnWindows" { BeforeAll { $systemConfigPath = "$PSHOME/powershell.config.json" if ($IsWindows) { $userConfigPath = "~/Documents/powershell/powershell.c...
combined_dataset/train/non-malicious/3903.ps1
3903.ps1
function Start-TestSleep($milliseconds) { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { Start-Sleep -Milliseconds $milliseconds } } function Compute-TestTimeout($seconds) { if ([Microsoft.Azure.T...
combined_dataset/train/non-malicious/sample_51_81.ps1
sample_51_81.ps1
@{ GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Get-Acl", "Set-Acl", "Get-PfxCertific...
combined_dataset/train/non-malicious/sample_58_36.ps1
sample_58_36.ps1
# # Module manifest for module 'OCI.PSModules.Aidocument' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aidocument.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_58_17.ps1
sample_58_17.ps1
# # Module manifest for module 'OCI.PSModules.Opa' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opa.dll' # Version number of this module. ModuleVersion = '85.2.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_59_37.ps1
sample_59_37.ps1
# # Copyright (c) Microsoft Corporation. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ...
combined_dataset/train/non-malicious/sample_45_84.ps1
sample_45_84.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=Bu adda ve türde bir ortam değişkeni zaten var. EnvironmentErrorDoesNotExists=Bu adda ve türde bir ortam değişkeni yok. '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3Ag...
combined_dataset/train/non-malicious/sample_13_37.ps1
sample_13_37.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 = '80...
combined_dataset/train/non-malicious/3745.ps1
3745.ps1
$pfxPassword = "123" function Get-CertificateSubjectName([string]$certificateName) { return 'CN=' + $certificateName + '.com' } function Get-X509FromSecretBySubjectDistinguishedName([string]$keyVault, [string]$secretName, [string]$subjectDistinguishedName) { $secret = Get-AzKeyVaultSecret $keyVault $secretNam...
combined_dataset/train/non-malicious/sample_41_42.ps1
sample_41_42.ps1
# Change Log ## 0.1.18(20240222) - 使用neovim插件替换vim ## 0.1.17(20230703) - 使用vscodeintellicode ## 0.1.16(20230626) - 去掉Codeium (PS: 需要时单独启用, 每开启一个VSCode 都会启动两个language_server_windows_x64.exe进程, 窗口过多时会导致系统卡顿.) ## 0.1.15(20230323) - 使用codeium替代codegeex - 去掉code-spell-checker, vscodeintellicode #...
combined_dataset/train/non-malicious/Convert-FspToUsername.ps1
Convert-FspToUsername.ps1
Function Convert-FspToUsername { <# .SYNOPSIS Convert a FSP to a sAMAccountName .DESCRIPTION This function converts FSP's to sAMAccountName's. .PARAMETER UserSID This is the SID of the FSP in the form of S-1-5-20. These can be found in...
combined_dataset/train/non-malicious/sample_37_63.ps1
sample_37_63.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_41_19.ps1
sample_41_19.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://w...
combined_dataset/train/non-malicious/sample_48_96.ps1
sample_48_96.ps1
# Copyright (C) Intel Corporation, 2021 All Rights Reserved. function Invoke-GenerateKeyPair { <# .Synopsis Generate Key Pair. .Description This cmdlet generates a KeyPair object and adds the new key to AMT. .Notes AMT Provisioning: The vPro client AMT firmware must be provisione...
combined_dataset/train/non-malicious/HttpRest 1.0.2.ps1
HttpRest 1.0.2.ps1
## Http Rest #################################################################################################### ## The first implementation of the HttpRest module, as a bunch of script functions ## Based on the REST api from MindTouch's Dream SDK ## ## INSTALL: ## You need log4net.dll mindtouch.core.dll mindto...
combined_dataset/train/non-malicious/1071.ps1
1071.ps1
Set-StrictMode -Version 'Latest' $TestCertPath = Join-Path -Path $PSScriptRoot -ChildPath 'Certificates\CarbonTestCertificate.cer' -Resolve $TestCert = New-Object Security.Cryptography.X509Certificates.X509Certificate2 $TestCertPath & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -R...
combined_dataset/train/non-malicious/sample_59_62.ps1
sample_59_62.ps1
const e=Object.freeze({displayName:"nushell",name:"nushell",patterns:[{include:"#define-variable"},{include:"#define-alias"},{include:"#function"},{include:"#extern"},{include:"#module"},{include:"#use-module"},{include:"#expression"},{include:"#comment"}],repository:{binary:{begin:"\\b(0x)(\\[)",beginCaptures:{1:{name...
combined_dataset/train/non-malicious/2697.ps1
2697.ps1
function Get-Member { [CmdletBinding(DefaultParameterSetName = 'Default')] Param ( [Parameter(ValueFromPipeline=$true, ParameterSetName = 'Default')] [Parameter(ValueFromPipeline=$true, ParameterSetName = 'Private')] [System.Management.Automation.PSObject] $InputObject, ...
combined_dataset/train/non-malicious/1485.ps1
1485.ps1
4 function Convert-AboutTopicToHtml { [CmdletBinding()] param( [Parameter(Mandatory=$true,ValueFromPipeline=$true)] $InputObject, [string] $TopicName, [Parameter(Mandatory=$true)] [string] $ModuleName, [st...
combined_dataset/train/non-malicious/4372.ps1
4372.ps1
function Get-PrivateData { param ( [System.Collections.Hashtable] $PrivateData ) if($PrivateData.Keys.Count -eq 0) { $content = " PSData = @{ ...
combined_dataset/train/non-malicious/1190.ps1
1190.ps1
Set-StrictMode -Version 'Latest' & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) function Assert-NoDocumentationMissing { param( [string[]] $CommandName ) Set-StrictMode -Version 'Latest' $CommandName | Should -BeNullOrEmpty -Because ("Th...
combined_dataset/train/non-malicious/4319.ps1
4319.ps1
function ValidateAndGet-AuthenticodeSignature { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [PSModuleInfo] $ModuleInfo ) $ModuleDetails = $null $AuthenticodeSignature = $null $ModuleName = $ModuleInfo.Name $ModuleBasePath = $ModuleInfo.ModuleBase ...
combined_dataset/train/non-malicious/sample_1_55.ps1
sample_1_55.ps1
##************************************************************************** #********************* AUTO GENERAGED - DO NOT MODIFY ********************** # This file is the source code for discoverset OperatingSystemCore # Version 4.07 # Date: 10/20/2014 #***********************************************************...
combined_dataset/train/non-malicious/775.ps1
775.ps1
param($FailIfNotSigned = $true) $releasePath = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\release") $finalPackagePath = [System.IO.Path]::GetFullPath("$releasePath\FinalPackages") $binariesToSignPath = [System.IO.Path]::GetFullPath("$releasePath\BinariesToSign") $unpackedPackagesPath = [System.IO.Path]::GetFu...
combined_dataset/train/non-malicious/TabExpansion for V2CTP_1.ps1
TabExpansion for V2CTP_1.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/Get-MountPointData.ps1
Get-MountPointData.ps1
# Convert from one device ID format to another. function Get-DeviceIDFromMP { param([Parameter(Mandatory=$true)][string] $VolumeString, [Parameter(Mandatory=$true)][string] $Directory) if ($VolumeString -imatch '^\\s*Win32_Volume\\.DeviceID="([^"]+)"\\s*$') { # Return it in th...
combined_dataset/train/non-malicious/2104.ps1
2104.ps1
Describe 'Native UNIX globbing tests' -tags "CI" { BeforeAll { if (-Not $IsWindows ) { "" > "$TESTDRIVE/abc.txt" "" > "$TESTDRIVE/bbb.txt" "" > "$TESTDRIVE/cbb.txt" } $defaultParamValues = $PSDefaultParameterValues.Clone() $PSDefaultPa...
combined_dataset/train/non-malicious/sample_13_60.ps1
sample_13_60.ps1
function Get-ModuleExtension { [CmdletBinding()] param( [string] $ModuleName, [Version] $ModuleVersion ) $modules = Get-Module -ListAvailable Write-Verbose "`nFound $($modules.Length) installed modules to scan for extensions." function ParseVersion($versionStri...
combined_dataset/train/non-malicious/sample_52_48.ps1
sample_52_48.ps1
# # Module manifest for module 'OCI.PSModules.Recovery' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Recovery.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/Create-Printers_3.ps1
Create-Printers_3.ps1
###########################################################################" # # NAME: Create-Printers.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # BLOG: http://blog.powershell.no # # COMMENT: Simple script to bulk-create printers on a print-server. Printers are imported from a csv-file....
combined_dataset/train/non-malicious/sample_45_31.ps1
sample_45_31.ps1
# # Module manifest for module 'OCI.PSModules.Ons' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ons.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_52_67.ps1
sample_52_67.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Join-ScriptExtent { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding()] [OutputType([System.Management.Automation.Language.IScriptExtent])] param( [Parameter(Value...
combined_dataset/train/non-malicious/sample_23_60.ps1
sample_23_60.ps1
Хранилище сертификатов и ключей шифрования формата PKCS#12. Форматов файлов: `*.p12`, `*.pfx`. MIME-тип: `application/x-pkcs12`. -------------------- **Видимость:** @Глобально **Примеры:** ```xbsl метод ВычислитьПодпись(Данные: Байты, ХранилищаPkcs12: Байты) знч Криптопровайдер = Криптография.ПолучитьBouncyCa...
combined_dataset/train/non-malicious/Updated CloneVM from CSV.ps1
Updated CloneVM from CSV.ps1
Param ($servercsv) # $servercsv is the input file <# .SYNOPSIS Mass cloning of virtual machines .DESCRIPTION Mass cloning of virtual machines from a template using a CSV file as a source. .NOTES 1- Assumes template only has a C: drive and that only a D: will be added from the CSV file. Additional drives...
combined_dataset/train/non-malicious/3652.ps1
3652.ps1
function Test-DatabasePauseResume { $location = "Southeast Asia" $serverVersion = "12.0"; $rg = Create-ResourceGroupForTest $server = Create-ServerForTest $rg $location $databaseName = Get-DatabaseName $collationName = "SQL_Latin1_General_CP1_CI_AS" $maxSizeBytes = 250GB $dwdb = New-AzSqlDat...
combined_dataset/train/non-malicious/3349.ps1
3349.ps1
[cmdletbinding()] param() $VerbosePreference = 'Continue' function Get-FromEnv { [cmdletbinding()] param( [parameter(Mandatory)] $Name, [parameter(Mandatory)] $Default ) $envValue = Get-ChildItem -Path Env: | Where-Object { $_.Name.ToUpper() -eq $Name.ToUpper(...
combined_dataset/train/non-malicious/2480.ps1
2480.ps1
[CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipeline)] [string[]]$AzureVM, [string]$ServiceName = 'ADBCLOUD', [string]$VmExportConfigFolderPath = 'C:\ExportedVMs' ) begin { Set-StrictMode -Version Latest try { $AzureModuleFilePath = "$($env:ProgramFiles)\Microsoft SDKs\Windows Azure\Powe...
combined_dataset/train/non-malicious/sample_32_44.ps1
sample_32_44.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_60_43.ps1
sample_60_43.ps1
COURSE DATASHEET AZ-900T00 Microsoft Azure Fundamentals 4 Learning Path 2: Azure architecture and services 240 minutes Module 1: Core Azure architectural components Module 2: Azure compute and networking services Module 3: Azure storage services Module 4: Azure identity, access, and security Module 5: Review quest...
combined_dataset/train/non-malicious/h20 -Hashtables 2 object_5.ps1
h20 -Hashtables 2 object_5.ps1
#hashtable to object function. #used to be able to make custom objects with math inside the pipeline #e.g. 1..10 | h20 { @{karl = $_;dude = $_+1} } #gps | h20 { @{name = $_.processname; mem = $_.workingset / 1MB} } function h20([scriptblock]$sb ) { begin {} process{ if ($sb -ne $null) { ...
combined_dataset/train/non-malicious/sample_48_16.ps1
sample_48_16.ps1
# # Module manifest for module 'OCI.PSModules.Generativeai' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Generativeai.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/3212.ps1
3212.ps1
[CmdletBinding()] param($maxKeys = 25) class KeyInfo { KeyInfo([string]$k, [ConsoleKeyInfo]$ki, [bool]$investigate) { $this.Key = $k $this.KeyChar = $ki.KeyChar $this.ConsoleKey = $ki.Key $this.Modifiers = $ki.Modifiers $this.Investigate = $investigate } [string...
combined_dataset/train/non-malicious/sample_44_95.ps1
sample_44_95.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/Start-RDP_1.ps1
Start-RDP_1.ps1
######################################################################################################################## # NAME # Start-RDP # # SYNOPSIS # Opens a remote desktop connection to another computer. # # SYNTAX # Start-RDP [[-Server] <string>] [[-Width] <int>] [[-Height] <int>] # Star...
combined_dataset/train/non-malicious/sample_51_96.ps1
sample_51_96.ps1
ConvertFrom-StringData @' ###PSLOC ArcMachineAlreadyExistsInResourceGroupError = Arc machine(s) with names: {0} already exists in the Resource Group {1}. Use a different Resource group for registration or specify a different Arc for Servers Resource Group. ArcMachineNotFound = No Arc machine(s) were found with the s...
combined_dataset/train/non-malicious/1215.ps1
1215.ps1
$Path = $null $user = 'CarbonGrantPerms' $containerPath = $null $privateKeyPath = Join-Path -Path $PSScriptRoot -ChildPath 'Cryptography\CarbonTestPrivateKey.pfx' -Resolve & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) $credential = New-Credential -UserName $user -Passwor...
combined_dataset/train/non-malicious/4282.ps1
4282.ps1
function Invoke-Inveigh { [CmdletBinding()] param ( [parameter(Mandatory=$false)][Array]$HTTPResetDelay = "Firefox", [parameter(Mandatory=$false)][Array]$ProxyIgnore = "Firefox", [parameter(Mandatory=$false)][Array]$SpooferHostsReply = "", [parameter(Mandatory=$false)][Array]$SpooferHostsIgnore = ""...
combined_dataset/train/non-malicious/3680.ps1
3680.ps1
function Test-AdlsGen1Crud { $resourceGroup = getAssetName try { $AccountName = getAssetName $ShareName = getAssetName $DataSetName = getAssetName $StorageAccountId = getAssetName $FolderPath = getAssetName $FileName = getAssetName $createdFolderDataset = New-AzDataShareDataSet -ResourceGroupNam...
combined_dataset/train/non-malicious/Set-TopMost.ps1
Set-TopMost.ps1
#Requires -Version 2.0 $signature = @" [DllImport("user32.dll")] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); public static IntPtr FindWindow(string windowName){ return FindWindow(null,windowName); } [DllImport("user32.dll")] public static extern bool Se...
combined_dataset/train/non-malicious/sample_54_53.ps1
sample_54_53.ps1
# # Module manifest for module 'OCI.PSModules.Keymanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Keymanagement.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_24_17.ps1
sample_24_17.ps1
# # Module manifest for module 'OCI.PSModules.Functions' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Functions.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_8_0.ps1
sample_8_0.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_31_62.ps1
sample_31_62.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 = '77.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_40_30.ps1
sample_40_30.ps1
# # Module manifest for module 'OCI.PSModules.Resourcemanager' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Resourcemanager.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported P...
combined_dataset/train/non-malicious/506.ps1
506.ps1
function Update-PPEventLog{ param( ) Get-PPConfiguration $PSconfigs.EventLog.Filter | %{$_.Content.EventLog} | %{ $EventLog = Get-WmiObject win32_nteventlogfile -filter "filename='$($_.Name)'" if(-not ($EventLog)){ Write-Host "Create event log: $($_.Name)" New-EventLog -LogName...
combined_dataset/train/non-malicious/Set-DNSServersToOpenDNS.ps1
Set-DNSServersToOpenDNS.ps1
Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'" | ForEach-Object { $_.SetDNSServerSearchOrder(@("208.67.222.222","208.67.220.220")); }
combined_dataset/train/non-malicious/sample_47_60.ps1
sample_47_60.ps1
<# .SYNOPSIS Deploys a Service Fabric application type to a cluster. .DESCRIPTION This script deploys a Service Fabric application type to a cluster. It is invoked by Visual Studio when deploying a Service Fabric Application project. .NOTES WARNING: This script file is invoked by Visual Studio. Its paramete...
combined_dataset/train/non-malicious/sample_32_28.ps1
sample_32_28.ps1
<# .SYNOPSIS SyncServiceIIS.ps1 script file This is a place-holder file only for agent patch build purposes #> Write-Host "This file functionality is deprecated and is place-holder only" # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3Ag...
combined_dataset/train/non-malicious/870.ps1
870.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests', '' . "$here\$sut" $clusterName = $ENV:ClusterName $httpUserPassword = $ENV:HttpPassword $securePassword = ConvertTo-SecureString $httpUserPassword -AsPlainText -Force $creds = New-Object -...
combined_dataset/train/non-malicious/2553.ps1
2553.ps1
function log([System.String] $text){write-host $text;} function logException{ log "Logging current exception."; log $Error[0].Exception; } function mytrycatch ([System.Management.Automation.ScriptBlock] $try, [System.Management.Automation.ScriptBlock] $catch, [System.M...
combined_dataset/train/non-malicious/3078.ps1
3078.ps1
$scriptRoot = Split-Path $MyInvocation.MyCommand.Path . $scriptRoot\Validator.ps1 -Verbose Describe "Testing a validator" { It "calls MyValidator" { Mock MyValidator -MockWith { return $true } Invoke-SomethingThatUsesMyValidator "test" $was_called_once = 1 Assert-MockCalled MyValid...
combined_dataset/train/non-malicious/85.ps1
85.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 ($Aad...
combined_dataset/train/non-malicious/Update-GAC.ps1
Update-GAC.ps1
# author: jeffrey snover # url: http://blogs.msdn.com/powershell/archive/2008/09/02/speeding-up-powershell-startup-updating-update-gac-ps1.aspx Set-Alias ngen (Join-Path ([System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()) ngen.exe) [AppDomain]::CurrentDomain.GetAssemblies() | sort {Spli...
combined_dataset/train/non-malicious/sample_4_28.ps1
sample_4_28.ps1
[dynamic, provider("dcismprovider"), Association, Description ( "DCIM_BMServiceAffectsElement is a derivation of CIM_ServiceAffectsElement " "and represents an association between a Service and the ManagedElements " "that might be affected by its execution." ) ] class DCIM_BMServiceAffectsEle...
combined_dataset/train/non-malicious/sample_24_31.ps1
sample_24_31.ps1
let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl(); let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/aspire.eventHandlers.js"]; let currentScriptElement = document.querySelector("script[src='Scripts/aspire.plugin.js']"); if (currentScriptElement !== null) { scrip...
combined_dataset/train/non-malicious/sample_37_82.ps1
sample_37_82.ps1
# # Module manifest for module 'OCI.PSModules.Databasemigration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasemigration.dll' # Version number of this module. ModuleVersion = '83.2.0' # Support...
combined_dataset/train/non-malicious/sample_59_55.ps1
sample_59_55.ps1
# # Module manifest for module 'OCI.PSModules.Datacatalog' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datacatalog.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_65_79.ps1
sample_65_79.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/2734.ps1
2734.ps1
[CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [int32]$BackMins=180 ) $BackTime=(Get-Date) - (New-TimeSpan -Minutes $BackMins) $RawEvents = Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" | Where-Object {$_.TimeCreated -ge $BackTime} | Where-Object { $_.Id -eq 1} $RawEvents | ForEach-Obje...
combined_dataset/train/non-malicious/sample_56_70.ps1
sample_56_70.ps1
com.opendatadsl.function.DateFunctions com.opendatadsl.function.StringFunctions com.opendatadsl.function.GeneralFunctions com.opendatadsl.function.TestFunctions com.opendatadsl.function.IntrospectionFunctions com.opendatadsl.function.BeanConstructors com.opendatadsl.function.Constructors com.opendatadsl.function...
combined_dataset/train/non-malicious/sample_56_90.ps1
sample_56_90.ps1
### # ==++== # # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
combined_dataset/train/non-malicious/sample_58_71.ps1
sample_58_71.ps1
# # Module manifest for module 'OCI.PSModules.Bds' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Bds.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_25_53.ps1
sample_25_53.ps1
# # Module manifest for module 'OCI.PSModules.Datalabelingservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datalabelingservice.dll' # Version number of this module. ModuleVersion = '82.0.0' # Sup...
combined_dataset/train/non-malicious/2520.ps1
2520.ps1
param ( [string]$serverInstance = "STGSQL610", [string]$tempDir = "C:\Dexma\Logs\", [string]$filter = "objects", [switch]$verbose, [switch]$debug ) function main() { if ($verbose) {$VerbosePreference = "Continue"} if ($debug) {$DebugPreference = "Continue"} Get-MSSQL-Views-Csv $serverInsta...
combined_dataset/train/non-malicious/sample_64_45.ps1
sample_64_45.ps1
# # Module manifest for module 'OCI.PSModules.Integration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Integration.dll' # Version number of this module. ModuleVersion = '86.2.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_54_11.ps1
sample_54_11.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 = '85.2.0' # Supported PSEditi...
combined_dataset/train/non-malicious/125.ps1
125.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/Demo-v3-Gui.ps1
Demo-v3-Gui.ps1
#requires -version 3 [Windows.Window]@{ OpacityMask = [Windows.Media.DrawingBrush]@{ Drawing = [Windows.Media.GeometryDrawing]@{ Brush = 'Black' Geometry = [Windows.Media.EllipseGeometry]@{ radiusX = 123 radiusY = 321 } }...
combined_dataset/train/non-malicious/2079.ps1
2079.ps1
Describe 'Exceptions flow for classes' -Tags "CI" { $canaryHashtable = @{} $iss = [initialsessionstate]::CreateDefault() $iss.Variables.Add([System.Management.Automation.Runspaces.SessionStateVariableEntry]::new('canaryHashtable', $canaryHashtable, $null)) $iss.Commands.Add([System.Management.Automa...