full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_36_60.ps1
sample_36_60.ps1
[CmdletBinding()] param() Trace-VstsEnteringInvocation $MyInvocation try { Import-VstsLocStrings "$PSScriptRoot\Task.json" # Get the inputs. [string]$project = Get-VstsInput -Name project -Require [string]$target = Get-VstsInput -Name target [string]$configuration = Get-VstsInput -Name c...
combined_dataset/train/non-malicious/sample_18_7.ps1
sample_18_7.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_22_96.ps1
sample_22_96.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\semver@7.5.4\node_modules\semver\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\semver@7.5....
combined_dataset/train/non-malicious/1746.ps1
1746.ps1
param ( [ValidateSet("machine","user","process")] [string[]]$PathScope="machine", [switch]$RemoveAllOccurences ) ForEach ($PathScopeItem in $PathScope) { $AssembledNewPath = $NewPath = '' $pathstoremove = @([Environment]::GetEnvironmentVariable("PATH","$PathScopeItem").split(';') | Where { $_ -ilike ...
combined_dataset/train/non-malicious/sample_46_91.ps1
sample_46_91.ps1
$url = $args[0] Write-Host "Downloading Microsoft Edge Dev" $wc = New-Object net.webclient $msiInstaller = "$env:temp\microsoft-edge-dev.msi" $wc.Downloadfile($url, $msiInstaller) Write-Host "Installing Microsoft Edge Dev" $arguments = "/i `"$msiInstaller`" /quiet" Start-Process msiexec.exe -ArgumentList $arguments -...
combined_dataset/train/non-malicious/ISE-Lines.ps1
ISE-Lines.ps1
#requires -version 2.0 ## ISE-Lines module v 1.0 ## DEVELOPED FOR CTP3 ## See comments for each function for changes ... ############################################################################################################## ## Provides Line cmdlets for working with ISE ## Duplicate-Line - Duplicates curr...
combined_dataset/train/non-malicious/createSiteFromTemplate.ps1
createSiteFromTemplate.ps1
# Load the template $url = "http://spf" # where template base $namesite = "Good Site" #name new site title $targeturl = "goodsite" #name url new site # find id = viewAlltemplate $templateID = "{055CF2A7-43A8-48E1-95CB-19DC393F0215}" #$templateID = "{055CF2A7-43A8-48E1-95CB-19DC393F0215}#kolam" $site= new-Objec...
combined_dataset/train/non-malicious/44.ps1
44.ps1
[CmdletBinding(DefaultParameterSetName="NormalRun")] Param( [parameter(Mandatory=$true,ParameterSetName="NormalRun")] [alias("sa")] [ValidateScript({ if ($_ -match ".\\."){ $True } else { Throw "Please use the format Domain\Username for the NDES Service Account variable." } ...
combined_dataset/train/non-malicious/1689.ps1
1689.ps1
function Decode-Text { param ( [string]$Text, [validateset('SecureString', 'SecureStringWithKey', 'Base64', 'ASCII')] [string]$Method = 'Base64' ) process { if (!$Text) { $Text = $input } } end { switch ($method) { 'SecureSt...
combined_dataset/train/non-malicious/RunSSIS.ps1
RunSSIS.ps1
# --------------------------------------------------------------------------- ### <Script> ### <Author> ### Chad Miller ### </Author> ### <Description> ### Executes a SQL Server Integrations Services package for both server and file system storage types. ### Optionally Resets a Package Configuration connection ...
combined_dataset/train/non-malicious/sample_53_68.ps1
sample_53_68.ps1
export function setControlAttribute(id, attrName, value) { const fieldElement = document.querySelector("#" + id)?.shadowRoot?.querySelector("#control"); if (!!fieldElement) { fieldElement?.setAttribute(attrName, value); } } export function setDataList(id, datalistid) { const fieldElem...
combined_dataset/train/non-malicious/sample_11_82.ps1
sample_11_82.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 = '73.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/Test Ora Proc Wrapper 1.ps1
Test Ora Proc Wrapper 1.ps1
# this is a testcase for http://code.google.com/p/poshcodegen/ # a project for generating PowerShell function wrappers around stored procedure call, and more. # Here we show how to return a resultsets (aka ref cursors) from an Orcale stored procedures using ADO.NET with PowerShell # by the way it tell the verion...
combined_dataset/train/non-malicious/Start-Demo 3.3.ps1
Start-Demo 3.3.ps1
## Start-Demo.ps1 ################################################################################################## @@## This is an overhaul of Jeffrey Snover's original Start-Demo script by Joel "Jaykul" Bennett ## ## I've switched it to using ReadKey instead of ReadLine (you don't have to hit Enter each time) #...
combined_dataset/train/non-malicious/1886.ps1
1886.ps1
Describe "Get-UICulture" -Tags "CI" { It "Should have $ PsUICulture variable be equivalent to Get-UICulture object" { $result = Get-UICulture $result.Name | Should -Be $PsUICulture $result | Should -BeOfType CultureInfo } }
combined_dataset/train/non-malicious/sample_26_85.ps1
sample_26_85.ps1
## Copyright (c) Microsoft Corporation. All rights reserved. <# .SYNOPSIS This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. .DESCRIPTION This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. These performance recordings contain Microsoft-Antimal...
combined_dataset/train/non-malicious/sample_15_10.ps1
sample_15_10.ps1
// // show all meshes in the scene by setting Hidden=false // var c = document.elements.elementCount; for (var i = 0; i < c; i++) { var element = document.elements.getElement(i); if (element.typeId == "Microsoft.VisualStudio.3D.Mesh") { element.getTrait("Hidden").value = false; } } /...
combined_dataset/train/non-malicious/sample_30_38.ps1
sample_30_38.ps1
# # Module manifest for module 'OCI.PSModules.Healthchecks' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/sample_55_75.ps1
sample_55_75.ps1
# Import the helper functions Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [parameter(Mandatory = $true)] [System.String] $Category ) #Write-Verbose "Use this cmdlet t...
combined_dataset/train/non-malicious/2012.ps1
2012.ps1
. "$psscriptroot/TestRunner.ps1" $AssemblyName = "System.Management.Automation" $excludeList = "CoreMshSnapinResources.resx", "ErrorPackageRemoting.resx", "EventResource.resx" Test-ResourceStrings -AssemblyName $AssemblyName -ExcludeList $excludeList
combined_dataset/train/non-malicious/1518.ps1
1518.ps1
function New-TempDirectory { param( [Parameter(Position=0)] [string] $Prefix ) Set-StrictMode -Version 'Latest' $newTmpDirName = [System.IO.Path]::GetRandomFileName() if( $Prefix ) { $Prefix = Split-Path -Leaf -Path $Prefix ...
combined_dataset/train/non-malicious/sample_31_35.ps1
sample_31_35.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_67_85.ps1
sample_67_85.ps1
# # Module manifest for module 'OCI.PSModules.Secrets' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Secrets.dll' # Version number of this module. ModuleVersion = '89.0.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/sample_30_43.ps1
sample_30_43.ps1
# # Module manifest for module 'Microsoft.Sdn.VgwNetworkConnection' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.Sdn.VgwNetworkConnection.psm1' # Version number of this module. ModuleVersion = '3.17.0' # Supported PSEditions # CompatiblePSEditions = ...
combined_dataset/train/non-malicious/2404.ps1
2404.ps1
[CmdletBinding(DefaultParameterSetName = 'Local')] param ( [Parameter(Mandatory = $True, ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)] [string]$ProductName, [Parameter(Mandatory = $False, ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)] [s...
combined_dataset/train/non-malicious/3465.ps1
3465.ps1
function Get-ResourceGroupName { return getAssetName } function Get-DataBoxJobName { return getAssetName } function Get-StorageAccountName { return getAssetName } function Get-ProviderLocation($provider) { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.A...
combined_dataset/train/non-malicious/sample_15_25.ps1
sample_15_25.ps1
# Localized ArchiveResources.psd1 ConvertFrom-StringData @' ###PSLOC PathNotFoundError=The path '{0}' either does not exist or is not a valid file system path. ExpandArchiveInValidDestinationPath=The path '{0}' is not a valid file system directory path. InvalidZipFileExtensionError={0} is not a supported archive...
combined_dataset/train/non-malicious/sample_3_95.ps1
sample_3_95.ps1
# Name: tss_update-script.ps1 for TSS (former TSSv2) <# .SYNOPSIS Script to [auto-]update TSS to latest version or download latest zip from CesdiagTools/GitHub. .DESCRIPTION Script will search on "https://microsoft.githubenterprise.com/css-windows/WindowsCSSToolsDevRep/releases/tag" for latest TSS version ...
combined_dataset/train/non-malicious/sample_48_58.ps1
sample_48_58.ps1
######################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # Localized PackageManagement.Resources.psd1 # ######################################################################################### ConvertFrom-StringDa...
combined_dataset/train/non-malicious/sample_40_15.ps1
sample_40_15.ps1
function Get-RoleAndGuardDutyS3Policy { <# .SYNOPSIS Creates a S3 Policy for GuardDuty based on specified bucket name, role ARN, and Kms ARN .PARAMETER RoleArn Specifies the Role ARN .PARAMETER BucketName Specifies the S3 Bucket .PARAMETER KmsArn Specifies the KMS ARN ...
combined_dataset/train/non-malicious/Get-NewPassword.ps1
Get-NewPassword.ps1
#/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\ # # Script Name: Get-NewPassword.ps1 # Title: Random Password Generator # Version: 1.0 # Author: johnwcannon at gmail dot com # Date: September 16th, 2010 # # Description: Password gerneration function based...
combined_dataset/train/non-malicious/814ade13-24cf-4b85-beea-d9492ddd8e1e.ps1
814ade13-24cf-4b85-beea-d9492ddd8e1e.ps1
$DriveLetter = "D:" $MaxShrink = 0.30 # 0.30 equals 30% $MinShrink = 0.20 # 0.20 equals 20% $FileLocation = $env:Temp $FileName4DiskPart = "Shrink.txt" $DiskDrive = GWMI -CL Win32_LogicalDisk | Where {$_.DeviceId -Eq "$DriveLetter"} $DriveSize = ($DiskDrive.Size /1GB) $DriveSize = [int]$DriveSize $DesiredSh...
combined_dataset/train/non-malicious/Set Logfile length.ps1
Set Logfile length.ps1
################################################################################ # Set-FileLines.ps1 # This script will maintain the PS Transcript file, or any text file, at a fixed # length and can be used to prevent such files from becoming too large, with the # option of removing any blank lines. Defaults to 10...
combined_dataset/train/non-malicious/Async SQL Backup .ps1
Async SQL Backup .ps1
$backuppath = "\\\\server\\sqlbackups\\" $alertaddress = "jrich523@domain.com" $smtp = "smtp.domain.com" $retaindays = 14 $hname = (gwmi win32_computersystem).name $errorstate = 0 $body =@() $backups = @() $conns = @() $completed = @{} [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.S...
combined_dataset/train/non-malicious/4029.ps1
4029.ps1
function Test-GetDa { $assignments = Get-AzDenyAssignment Assert-NotNull $assignments Assert-True { $assignments.Length -ge 1 } } function Test-GetDaById { $id = '22704996-fbd0-4ab1-8625-722d897825d2' $assignments = Get-AzDenyAssignment -Id $id Assert-NotNull $assignme...
combined_dataset/train/non-malicious/1362.ps1
1362.ps1
function Uninstall-CPerformanceCounterCategory { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $CategoryName ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.S...
combined_dataset/train/non-malicious/New-CodeSigningCert.ps1
New-CodeSigningCert.ps1
## New-CodeSigningCert.ps1 ######################################################################################################################## ## Does the setup needed to self-sign PowerShell scripts ... ## Generates a "test" self-signed root Certificate Authority ## And then generates a code-signing certific...
combined_dataset/train/non-malicious/13.ps1
13.ps1
$packageName = "poshgit" cpack function Setup-Environment { Cleanup $env:poshGit = join-path (Resolve-Path .\Tests ) dahlbyk-posh-git-60be436.zip $profileScript = "function Prompt(){ `$host.ui.RawUI.WindowTitle = `"My Prompt`" }" (Set-Content $Profile -value $profileScript -Force) } function Cleanup {...
combined_dataset/train/non-malicious/560.ps1
560.ps1
function Convert-SPOStringVariablesToValues { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [String]$string ) Write-Host "Replacing variables string variables" -foregroundcolor black -backgroundcolor yellow $serverRelativeUrl = $clientContext.Site.ServerRelativeUrl if ($serverRelat...
combined_dataset/train/non-malicious/362.ps1
362.ps1
function Clear-PSFResultCache { [CmdletBinding(ConfirmImpact = 'Low', SupportsShouldProcess = $true, HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Clear-PSFresultCache')] param ( ) if ($pscmdlet.ShouldProcess("Result cache", "Clearing the result cache")) { [PSFramework.ResultCache....
combined_dataset/train/non-malicious/Get-Scope_3.ps1
Get-Scope_3.ps1
function Get-Scope { #.Synopsis # Determine the scope of execution (are you in a module? how many scope layers deep are you?) #.Parameter Invocation # In order to correctly determine the scope, this function requires that you pass in the $MyInvocation variable when you call it. #.Parameter ToHost # If you jus...
combined_dataset/train/non-malicious/2904.ps1
2904.ps1
BuildSetup { throw "forced error" } Task default -depends Compile, Test, Deploy Task Compile { "Compiling" } Task Test -depends Compile { "Testing" } Task Deploy -depends Test { "Deploying" }
combined_dataset/train/non-malicious/sample_22_23.ps1
sample_22_23.ps1
# # Module manifest for module 'OCI.PSModules.Healthchecks' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/1526.ps1
1526.ps1
function Assert-NotEmpty { [CmdletBinding()] param( [Parameter(Position=0)] [object] $InputObject, [Parameter(Position=1)] [string] $Message ) Set-StrictMode -Version 'Latest' if( $InputObject -eq $null ) { ...
combined_dataset/train/non-malicious/3908.ps1
3908.ps1
function Test-GetLocationQuotas { $location = Get-BatchAccountProviderLocation $quotas = Get-AzBatchLocationQuotas $location Assert-AreEqual $location $quotas.Location Assert-True { $quotas.AccountQuota -gt 0 } }
combined_dataset/train/non-malicious/sample_62_68.ps1
sample_62_68.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ function Copy-ToTemp { ...
combined_dataset/train/non-malicious/sample_18_28.ps1
sample_18_28.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/sample_12_8.ps1
sample_12_8.ps1
ConvertFrom-StringData @' id_filesnottobackup2k3check_st=There are too many HKLM\\SYSTEM\\CurrentControlSet\\Control\\BackupRestore\\FilesNotToBackup entries and this may cause problems with ntbackup '@ # SIG # Begin signature block # MIIoUwYJKoZIhvcNAQcCoIIoRDCCKEACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgE...
combined_dataset/train/non-malicious/sample_47_94.ps1
sample_47_94.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_39_98.ps1
sample_39_98.ps1
var state = command.getTrait("state"); var manipData = services.manipulators.getManipulatorData("CameraManipulator"); var mode = manipData.getTrait("CameraManipulationMode"); var tool = new Object(); tool.activate = function () { state.value = 2; mode.value = 2; // Orbit mode } tool.deactivate = fun...
combined_dataset/train/non-malicious/FindNewVirtualMachines_1.ps1
FindNewVirtualMachines_1.ps1
#requires -pssnapin VMware.Vimautomation.Core Param( [int] $LastDays ) Process { $EventFilterSpecByTime = New-Object VMware.Vim.EventFilterSpecByTime If ($LastDays) { $EventFilterSpecByTime.BeginTime = (get-date).AddDays(-$($LastDays)) } $EventFilterSpec = New-Object VMwa...
combined_dataset/train/non-malicious/sample_24_67.ps1
sample_24_67.ps1
# Copyright (C) Intel Corporation, 2007 - 2021 All Rights Reserved. .$psScriptRoot\Invoke-AMTPowerManagement.ps1 .$psScriptRoot\Invoke-AMTForceBoot.ps1 .$psScriptRoot\Invoke-AMTForceBoot_OCR.ps1 .$psScriptRoot\Set-AMT3PDS.ps1 .$psScriptRoot\Get-AMT3PDS.ps1 .$psScriptRoot\Clear-AMT3PDS.ps1 .$psScriptRoot\set-AM...
combined_dataset/train/non-malicious/sample_24_12.ps1
sample_24_12.ps1
$ErrorActionPreference = "Stop" Set-StrictMode -Version Latest # Firewall constants Set-Variable -Option Constant -Name TeamsExeName -Value "Teams.exe" Set-Variable -Option Constant -Name ThirdPartyExeName -Value "ThirdParty.exe" Set-Variable -Option Constant -Name TeamsTcpRuleName -Value...
combined_dataset/train/non-malicious/sample_32_33.ps1
sample_32_33.ps1
# # Module manifest for module 'OCI.PSModules.Desktops' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Desktops.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/vProfiles.ps1
vProfiles.ps1
# # vProfiles V1 # By Alan Renouf # http://virtu-al.net # #Generated Form Function function GenerateForm { ######################################################################## # Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) v1.0.3.0 # Generated On: 27/06/2009 9:17 PM # Generated...
combined_dataset/train/non-malicious/sample_1_69.ps1
sample_1_69.ps1
ConvertFrom-StringData @' progressbar_id_crm_unsupportedcustomapp_exists=Custom Applications Under CRMAppPool Check progressbar_id_crm_unsupportedcustomapp_existsdesc=Creating an IIS application inside the Microsoft Dynamics CRM Website for any VDir and specifically within the ISV folder is not supported. '@ # SI...
combined_dataset/train/non-malicious/2487.ps1
2487.ps1
[CmdletBinding(DefaultParameterSetName = 'name')] [OutputType('System.Management.Automation.PSCustomObject')] param ( [Parameter(ParameterSetName = 'name', Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [ValidateSet("Tom","Dick","Jane")] [ValidateRange(21,65)] [ValidateScript({Test-Path $_ -...
combined_dataset/train/non-malicious/sample_8_52.ps1
sample_8_52.ps1
########################################################################### # DC_Get-Network # Version 1.0 # Date: 09-26-2012 # Author: mifannin # Description: Creates Autotuning.txt, Firewall.txt, Netsh.txt, Winsock.txt, # Bitsadmin.txt, WPAD & PAC File Collection ##############################################...
combined_dataset/train/non-malicious/sample_21_75.ps1
sample_21_75.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ [CmdletBinding(DefaultParamet...
combined_dataset/train/non-malicious/1227.ps1
1227.ps1
$tempDir = $null $zipPath = $null & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) function Assert-ZipFileExpands { param( $file, $sourceRoot ) try { $outRoot = Expand-Item -Path $file $outRoot | Should Not BeNullOrEmpty...
combined_dataset/train/non-malicious/2931.ps1
2931.ps1
properties { $x = 'asdf' $y = 'something' } task TaskAFromModuleA { 'Executing [TaskA] from module [TaskModuleA] version [0.1.0]' Write-Output $x Write-Output $y } task tasky -depends taskz { "I'm task Y" } task taskz { "I'm task z" } -depends 'TaskBFromModuleB'
combined_dataset/train/non-malicious/1218.ps1
1218.ps1
Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath 'CarbonDscTest' -Resolve) -Force Describe 'Carbon_EnvironmentVariable' { function Assert-EnvironmentVariable { param( $Name, $Value ) Set-StrictMode -Version 'Latest' $std...
combined_dataset/train/non-malicious/3796.ps1
3796.ps1
$global:ps_test_tag_name = 'crptestps6050' function get_vm_config_object { param ([string] $rgname, [string] $vmsize) $st = Write-Verbose "Creating VM Config Object - Start"; $vmname = $rgname + 'vm'; $p = New-AzVMConfig -VMName $vmname -VMSize $vmsize; $st = Write-Verbo...
combined_dataset/train/non-malicious/sample_49_3.ps1
sample_49_3.ps1
# Localized 06/28/2023 07:58 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1 ConvertFrom-StringData @' ###PSLOC Troubleshoot_Title=استكشاف الأخطاء وإصلاحها Troubleshoot_DetectDVDDevice=يتم الآن التحقق من جهاز DVD ... Troubleshoot_DetectDVDvideoDecoder=يتم الآن التحقق من أداة فك ترميز الفيديو لتشغيل قرص DVD ... T...
combined_dataset/train/non-malicious/483.ps1
483.ps1
function Add-PPScriptShortcut{ [CmdletBinding()] param( [Parameter(Mandatory=$true)] [String] $Name, [Parameter(Mandatory=$false)] [String] $ShortcutKey, [Parameter(Mandatory=$false)] [String] $ShortcutName ) if(-not $Sho...
combined_dataset/train/non-malicious/sample_39_29.ps1
sample_39_29.ps1
$ErrorActionPreference = 'Stop' <# .Synopsis Returns payload information from glcm. This info is required to send a heart beat request to AA #> function Get-HeartbeatInfo { [CmdletBinding()] param() $glcm = Get-DscLocalConfigurationManager $configurationName = "" $aaServerU...
combined_dataset/train/non-malicious/sample_55_5.ps1
sample_55_5.ps1
# # Module manifest for module 'OCI.PSModules.Datalabelingservicedataplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datalabelingservicedataplane.dll' # Version number of this module. ModuleVersion...
combined_dataset/train/non-malicious/sample_3_46.ps1
sample_3_46.ps1
ConvertFrom-StringData @' id_cts8021xclient=802.1x Client Component id_cts8021xclientdescription=Collects information about 802.1x client component. '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63J...
combined_dataset/train/non-malicious/3983.ps1
3983.ps1
function Get-RandomClusterName { return 'kube' + (getAssetName) } function Get-RandomResourceGroupName { return 'rg' + (getAssetName) } function isLive { return [Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback } func...
combined_dataset/train/non-malicious/1282.ps1
1282.ps1
function Uninstall-CIisAppPool { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $Name ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $appPoo...
combined_dataset/train/non-malicious/4263.ps1
4263.ps1
function Invoke-PsExec { [CmdletBinding()] param ( [parameter(Mandatory=$true)][String]$Target, [parameter(Mandatory=$true)][String]$Username, [parameter(Mandatory=$false)][String]$Domain, [parameter(Mandatory=$false)][String]$Command, [parameter(Mandatory=$false)][String]$Password, [parameter(...
combined_dataset/train/non-malicious/Autoload (beta).ps1
Autoload (beta).ps1
#Requires -Version 2.0 ## Automatically load functions from scripts on-demand, instead of having to dot-source them ahead of time, or reparse them from the script every time. ## To use: ## 1) Create a function. To be 100% compatible, it should specify pipeline arguments ## For example: <# function Skip-Object {...
combined_dataset/train/non-malicious/sample_0_66.ps1
sample_0_66.ps1
#************************************************ # DC_RDSHelper.ps1 # Version 1.0.1 # Date: 21-01-2012 # Author: Daniel Grund - dgrund@microsoft.com /#_# WalterE # Description: # RDS helper file # 1.0.0 Beta release # 1.0.1 Added advapi32 to get userrightsassigments #****************************************...
combined_dataset/train/non-malicious/sample_19_77.ps1
sample_19_77.ps1
#************************************************ # DC_NfsClient-Component.ps1 # Version 1.0.06.26.14: Created script. # Version 1.1.08.14.14: Updated comments. TFS264083 # Date: 2014 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about NFS Client. # Called from: Main Networkin...
combined_dataset/train/non-malicious/493.ps1
493.ps1
function Mount-NetworkDirectories{ param( [parameter(Mandatory=$true)] [string[]] $Urls ) if (Get-Command "net.exe"){ $DriveLetters = Get-AvailableDriveLetter foreach($Url in $Urls){ $Index = [array]::IndexOf($Urls, $U...
combined_dataset/train/non-malicious/3457.ps1
3457.ps1
function Test-Pipeline { $dfname = Get-DataFactoryName $rgname = Get-ResourceGroupName $rglocation = Get-ProviderLocation ResourceManagement $dflocation = Get-ProviderLocation DataFactoryManagement $endDate = [DateTime]::Parse("9/8/2014") $startDate = $endDate.AddHours(-1) ...
combined_dataset/train/non-malicious/1511.ps1
1511.ps1
function Assert-FileDoesNotContain { [CmdletBinding()] param( [Parameter(Position=0)] [string] $Path, [Parameter(Position=1)] [string] $Needle, [Parameter(Position=2)] $Message ) Set-StrictMo...
combined_dataset/train/non-malicious/sample_10_25.ps1
sample_10_25.ps1
ConvertFrom-StringData @' id_bpastarting=Starting Best Practices Analyzer id_bparunning=Running Best Practices Analyzer id_bpagenerating=Generating BPA Output '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8...
combined_dataset/train/non-malicious/sample_56_41.ps1
sample_56_41.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_55_12.ps1
sample_55_12.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_52_58.ps1
sample_52_58.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 = '79.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_52_9.ps1
sample_52_9.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ param ( [Parameter(Manda...
combined_dataset/train/non-malicious/Script-Proc_2.sql.ps1
Script-Proc_2.sql.ps1
#Copyright (c) 2011 Justin Dearing # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, publish, dist...
combined_dataset/train/non-malicious/491.ps1
491.ps1
function Get-ChildItemRecurse{ param( [parameter(Mandatory=$true)] [String] $Path, [parameter(Mandatory=$false)] [int] $Levels = 0, [switch] $OnlyDirectories ) $Metadata = @{ Title = "Get Child Item Recurse" Filename = "Get-ChildItemRecurse.ps1" ...
combined_dataset/train/non-malicious/PoshCode ISE Addon_2.ps1
PoshCode ISE Addon_2.ps1
if (!(Get-Module WPK)) {Import-Module -global WPK} if (!(Get-Module PoshCode)) {Import-Module -global PoshCode} Function Get-PoshCodePreferences { if (Get-Item $global:xmlPath -ErrorAction SilentlyContinue) { try { $pcPreferences = Import-Clixml -Path $global:xmlPath $global:...
combined_dataset/train/non-malicious/sample_45_58.ps1
sample_45_58.ps1
# # Module manifest for module 'OCI.PSModules.Identity' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Identity.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_23_7.ps1
sample_23_7.ps1
# # Module manifest for module 'OCI.PSModules.Healthchecks' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditi...
combined_dataset/train/non-malicious/3114.ps1
3114.ps1
function ConvertFrom-Base64 { [CmdletBinding()] param( [Parameter( Mandatory=$true, Position=0, HelpMessage='Base64 encoded string, which is to be converted to an plain text string')] [String]$Text ) Begin{ } Process{ try{ ...
combined_dataset/train/non-malicious/2476.ps1
2476.ps1
function Get-AzrAvailableLun { [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine]$VM ) process { $luns = $VM.StorageProfile.DataDisks if ($luns.Count -eq 0) { Write-Verbose -Message "No data disks found attached...
combined_dataset/train/non-malicious/sample_3_3.ps1
sample_3_3.ps1
#************************************************ # TS_ServerManagerRefreshIssue.ps1 # Version 1.0.1 # Date: 7/19/2013 # Author: v-kaw # Description: [KSE Rule] [ Windows V3] Server Manager refresh issues and SDP changes reqd for MMC Snapin Issues in 2008, 2008 R2 # Rule number: b7d69da3-d4b7-4754-ad3c-49133b0d...
combined_dataset/train/non-malicious/2189.ps1
2189.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed.")] [ValidateNotNullOrEmpty()] [ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})] [string]$SiteServer, [parameter(Mandatory=$true, HelpMess...
combined_dataset/train/non-malicious/Receive-Stream.ps1
Receive-Stream.ps1
function Receive-Stream { #.Synopsis # Read a stream to the end and close it #.Description # Will read from a byte stream and output a string or a file #.Param reader # The stream to read from #.Param fileName # A file to write to. If this parameter is provided, the function will output to file #.Param enc...
combined_dataset/train/non-malicious/1784.ps1
1784.ps1
Describe "DSC MOF Compilation" -tags "CI" { AfterAll { $env:PSModulePath = $_modulePath } BeforeAll { $IsAlpine = (Get-PlatformInfo) -eq "alpine" Import-Module PSDesiredStateConfiguration $dscModule = Get-Module PSDesiredStateConfiguration $baseSchemaPath = Join-P...
combined_dataset/train/non-malicious/Get_Set Signature 2.5.ps1
Get_Set Signature 2.5.ps1
#Requires -version 2.0 ## Authenticode.psm1 updated for PowerShell 2.0 (with time stamping) #################################################################################################### ## Wrappers for the Get-AuthenticodeSignature and Set-AuthenticodeSignature cmdlets ## These properly parse paths, so th...
combined_dataset/train/non-malicious/Dell hardware checker.ps1
Dell hardware checker.ps1
function load-omsa([string]$server) { $omsaie = new-object -com InternetExplorer.Application if (($server -eq $null) -or ($server -eq "")) { write-host -foregroundcolor "yellow" "Usage: omsa servername" write-host -foregroundcolor "yellow" " Enter servername to open OMSA connection to server" write...
combined_dataset/train/non-malicious/sample_58_43.ps1
sample_58_43.ps1
$ServerCertificateName = "CN=ServiceFabricServerCert" $ClientCertificateName = "CN=ServiceFabricClientCert" function IsSecurityX509([string]$ClusterConfigFilePath) { $jsonConfig = Get-Content $ClusterConfigFilePath -Raw | ConvertFrom-Json $properties = $jsonConfig.properties if ($properties -ne $Nul...
combined_dataset/train/non-malicious/3062.ps1
3062.ps1
function Set-TestInconclusive { [CmdletBinding()] param ( [string] $Message ) if (!$script:HasAlreadyWarnedAboutDeprecation) { Write-Warning 'DEPRECATED: Set-TestInconclusive was deprecated and will be removed in the future. Please update your scripts to use `Set-ItResult -Inconclu...
combined_dataset/train/non-malicious/sample_44_69.ps1
sample_44_69.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/1659.ps1
1659.ps1
filter ping1 { param ( [Parameter(ValueFromPipeline=$true)] [string[]]$comps = $env:COMPUTERNAME, [int]$n = 1, [switch]$showhost ) begin { $ping = New-Object System.Net.NetworkInformation.Ping } process { if (!$comps) {Throw 'No host provided...
combined_dataset/train/non-malicious/sample_19_21.ps1
sample_19_21.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 ...