full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_58_82.ps1
sample_58_82.ps1
# vNextDiag.ps1 # This tool is intended to help see a snapshot of the state of Office licenses # as well as some basic management of licenses. # # version 1.0.0 param ($action='list', $licenseId) function PrintModePerPridFromRegistry { Write-Host Write-Host "========== Mode per ProductReleaseId =========...
combined_dataset/train/non-malicious/1509.ps1
1509.ps1
function Assert-ContainsNotLike { [CmdletBinding()] param( [Parameter(Position=0)] [object] $Haystack, [Parameter(Position=1)] [object] $Needle, [Parameter(Position=2)] [string] $Message ...
combined_dataset/train/non-malicious/sample_60_50.ps1
sample_60_50.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/sample_59_9.ps1
sample_59_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. # ------------------------------------------------------------ [CmdletBinding(DefaultParamet...
combined_dataset/train/non-malicious/146.ps1
146.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/88c1a7d6-0bf3-48db-bec5-4b21531648c5.ps1
88c1a7d6-0bf3-48db-bec5-4b21531648c5.ps1
Function Get-DiskUsage { <# .SYNOPSIS A tribute to the excellent Unix command DU. .DESCRIPTION This command will output the full path and the size of any object and it's subobjects. Using just the Get-DiskUsage command without any parameters will result in an output of the directory you are currently p...
combined_dataset/train/non-malicious/sample_18_87.ps1
sample_18_87.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 paramet...
combined_dataset/train/non-malicious/sample_34_15.ps1
sample_34_15.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 = '79.0.0' # Sup...
combined_dataset/train/non-malicious/sample_55_21.ps1
sample_55_21.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/sample_52_28.ps1
sample_52_28.ps1
/////////////////////////////////////////////////////////////////////////////// // Helper to set a designer prop /////////////////////////////////////////////////////////////////////////////// function setDesignerProp(tname, ttype, tvalue) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)...
combined_dataset/train/non-malicious/sample_39_73.ps1
sample_39_73.ps1
# ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License...
combined_dataset/train/non-malicious/sample_66_61.ps1
sample_66_61.ps1
# # Module manifest for module 'OCI.PSModules.Streaming' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Streaming.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/587.ps1
587.ps1
function Connect-FTP{ param ( [parameter(Mandatory=$true)] [string[]]$Name, [parameter(Mandatory=$false)] [string]$User, [parameter(Mandatory=$false)] [int]$Port, [switch]$Secure, [parameter(Mandatory=$false)] [string]$PrivatKey...
combined_dataset/train/non-malicious/sample_25_22.ps1
sample_25_22.ps1
# # Module manifest for module 'OCI.PSModules.Blockchain' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Blockchain.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/3230.ps1
3230.ps1
class Permission { [string]$Name [string]$Plugin [string]$Description [bool]$Adhoc = $false Permission([string]$Name) { $this.Name = $Name } Permission([string]$Name, [string]$Plugin) { $this.Name = $Name $this.Plugin = $Plugin } Permission([string]$Name, ...
combined_dataset/train/non-malicious/2196.ps1
2196.ps1
[CmdletBinding()] param( [parameter(Mandatory=$true, HelpMessage="Specify Primary Site server")] [string]$SiteServer = "$($env:COMPUTERNAME)", [parameter(Mandatory=$true, HelpMessage="Path to text file")] [ValidateScript({Test-Path -Path $_ -Include *.txt})] [string]$FilePath, [parameter(Mandat...
combined_dataset/train/non-malicious/3825.ps1
3825.ps1
function Test-GetResourceSku { $skulist = Get-AzComputeResourceSku | where {$_.Locations -eq "eastus"}; Assert-True { $skulist.Count -gt 0; } $output = $skulist | Out-String; Assert-True { $output.Contains("availabilitySets"); } Assert-True { $output.Contains("virtualMachines"); } Assert-True { $ou...
combined_dataset/train/non-malicious/2313.ps1
2313.ps1
$RoomNumber = '407559' $postUrl = "https://adambertram.campfirenow.com/room/$RoomNumber/speak.json" $body = 'test message' $token = '25f1733faf39d63ac8a860430fc18448df179b28' $message = '<message><type>TextMessage</type><body>'+$body+'</body></message>' $baseuri = $base_url + '/speak.xml' $contentType = 'application/...
combined_dataset/train/non-malicious/1961.ps1
1961.ps1
Describe "Join-String" -Tags "CI" { BeforeAll { $testObject = Get-ChildItem } It "Should be called using the InputObject without error with no other switches" { { Join-String -InputObject $testObject } | Should -Not -Throw } It "'Input | Join-String' should be equal to 'Join-St...
combined_dataset/train/non-malicious/sample_18_74.ps1
sample_18_74.ps1
# # Module manifest for module 'OCI.PSModules.Waf' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waf.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/392.ps1
392.ps1
[CmdletBinding()] Param ( [switch] $SkipTest, [string[]] $CommandPath = @("$PSScriptRoot\..\..\functions", "$PSScriptRoot\..\..\internal\functions"), [string] $ModuleName = "PSFramework", [string] $ExceptionsFile = "$PSScriptRoot\Help.Exceptions.ps1" ) if ($SkipTest) { return } . $ExceptionsFile $includ...
combined_dataset/train/non-malicious/Product key_1.ps1
Product key_1.ps1
from System import Array, Char, Console from System.Collections import ArrayList from Microsoft.Win32 import Registry def DecodeProductKey(digitalProductID): map = ("BCDFGHJKMPQRTVWXY2346789").ToCharArray() key = Array.CreateInstance(Char, 29) raw = ArrayList() i = 52 while i < 67: raw...
combined_dataset/train/non-malicious/454.ps1
454.ps1
Register-PSFConfigValidation -Name "psframework.logfilefiletype" -ScriptBlock { Param ( $Value ) $Result = New-Object PSObject -Property @{ Success = $True Value = $null Message = "" } try { [PSFramework.Logging.LogFileFileType]$type = $Value } catch { $Result.Message = "Not a logfile file typ...
combined_dataset/train/non-malicious/22.ps1
22.ps1
. $PSScriptRoot\Shared.ps1 Describe 'ParamsTabExpansion Tests' { Context 'Push Parameters TabExpansion Tests' { It 'Tab completes all long push parameters' { $result = & $module GitTabExpansionInternal 'git push --' $result -contains '--all' | Should Be $true $result -co...
combined_dataset/train/non-malicious/sample_60_91.ps1
sample_60_91.ps1
# # Module manifest for module 'OCI.PSModules.Ailanguage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ailanguage.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_61_81.ps1
sample_61_81.ps1
# # Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker' # # Generated by: Microsoft Corporation # # Generated on: 19/01/2022 # @{ # Script module or binary module file associated with this manifest. RootModule = '' # Version number of this module. ModuleVersion = '1.2100.26...
combined_dataset/train/non-malicious/sample_6_14.ps1
sample_6_14.ps1
<# ISM PowerShell Service Module This module contains a set of wrapper scripts that enable Administrator To Configure 'Invoke-FullPowerCycle' ISM feature such as Enable/Disable Get the current status of feature. #> function IsAdministrator { <# .SYNOPSIS IsAdministrator. .DESCRIPTION ...
combined_dataset/train/non-malicious/sample_10_18.ps1
sample_10_18.ps1
ConvertFrom-StringData @' id_adinfo_status=Active Directory Environment id_adinfo_wait=Gathering information regarding the Active Directory forest, domains, sites and trusts. '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE...
combined_dataset/train/non-malicious/sample_17_96.ps1
sample_17_96.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_33_84.ps1
sample_33_84.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/Show-Image.ps1
Show-Image.ps1
function Show-Image { param([string]$file = $(throw "No file specified.")) [void][Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [void][Reflection.Assembly]::LoadWithPartialName("System.Drawing") #maybe this idea is not good but it can help display big images [Windows.Forms.Screen]...
combined_dataset/train/non-malicious/2110.ps1
2110.ps1
Describe "ArrayExpression Tests" -Tags "CI" { It "@([object[]](1,2,3)) should return a 3-element array of object[]" { $result = @([object[]](1,2,3)) $result.GetType().FullName | Should -BeExactly "System.Object[]" $result.Length | Should -Be 3 } It "@([int[]](1,2,3)) should return...
combined_dataset/train/non-malicious/sample_57_28.ps1
sample_57_28.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/3022.ps1
3022.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe 'Get-ShouldOperator' { Context 'Overview' { $OpCount = $AssertionOperators.Count $get1 = Get-ShouldOperator Add-AssertionOperator -Name 'test' -Test {'test'} $get2 = Get-ShouldOperat...
combined_dataset/train/non-malicious/sample_47_10.ps1
sample_47_10.ps1
@{ GUID="eb74e8da-9ae2-482a-a648-e96550fb8733" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="© Microsoft Corporation. All rights reserved." Description='PowerShell module for working with ZIP archives.' ModuleVersion="1.2.5" PowerShellVersion="3.0" FunctionsToExport = @('Compress...
combined_dataset/train/non-malicious/Export-PSCredential_4.ps1
Export-PSCredential_4.ps1
# Author: Hal Rottenberg <hal@halr9000.com> # Url: http://halr9000.com/article/tag/lib-authentication.ps1 # Purpose: These functions allow one to easily save network credentials to disk in a relatively # secure manner. The resulting on-disk credential file can only [1] be decrypted # by the same user account...
combined_dataset/train/non-malicious/sample_32_63.ps1
sample_32_63.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # UnzipAndCopyMDS.ps1 # Kill all running Monitoring processes an...
combined_dataset/train/non-malicious/sample_12_22.ps1
sample_12_22.ps1
##---------------------------------------------------------------------------- ## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved. ##---------------------------------------------------------------------------- # Import shared functions and vars . ./Commonalities.ps1 # Script used to reinstall...
combined_dataset/train/non-malicious/Balance-Datastores_1.ps1
Balance-Datastores_1.ps1
<# TODO -Change number of DSTs to is selection of $DSTMostFree to be variable. Also add in logic to select DSTs with lower VMCounts. Total DSTs Select DSTs ---------- ----------- <5 1 5-20 3 >20 5 -For $DSTLeastFree add in logic to select DSTs with higher VMCounts...
combined_dataset/train/non-malicious/Correction.ps1
Correction.ps1
function Convert-ToCHexString { [CmdletBinding()] param ( [Parameter(ValueFromPipeline=$true,Mandatory=$true)][string]$str ) @@ process { ($str.ToCharArray() | %{ "0x{0:X2}" -f [int]$_ }) -join ',' } }
combined_dataset/train/non-malicious/VM Disk Report_2.ps1
VM Disk Report_2.ps1
$VMs = get-vm $Results = @() foreach ($VM in $VMs) { $Result = new-object PSObject $Result | add-member -membertype NoteProperty -name "Name" -value $VM.Name $Result | add-member -membertype NoteProperty -name "Description" -value $VM.Notes $VMDiskCount = 1 get-harddisk $VM | foreach { ...
combined_dataset/train/non-malicious/sample_65_39.ps1
sample_65_39.ps1
@{ GUID="766204A6-330E-4263-A7AB-46C87AFC366C" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManC...
combined_dataset/train/non-malicious/65b30476-81de-4034-8d3c-ef5e8bdd0e43.ps1
65b30476-81de-4034-8d3c-ef5e8bdd0e43.ps1
$url = "http://dougfinke.com/scriptinggames/scriptinggames.html" $web = New-Object System.Net.WebClient foreach($line in ($web.downloadString($url)).split("`n")){ if($line -match "img"){ $line $fileName = $line.substring($line.indexof("title=")+7,(($line.indexof(" src"))-1)-($line.indexof("t...
combined_dataset/train/non-malicious/Remove-FTPFile.ps1
Remove-FTPFile.ps1
function Remove-FTPFile ($Source,$UserName,$Password) { #Create FTP Web Request Object to handle connnection to the FTP Server $ftprequest = [System.Net.FtpWebRequest]::Create($Source) # set the request's network credentials for an authenticated connection $ftprequest.Credentials = New-Object System.N...
combined_dataset/train/non-malicious/sample_65_97.ps1
sample_65_97.ps1
# # Module manifest for module 'OCI.PSModules.Optimizer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Optimizer.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_31_20.ps1
sample_31_20.ps1
# DO NOT COPY THIS MANIFEST VERBATIM. THIS IS JUST A SAMPLE. # GENERATE YOUR MANIFEST USING THE New-ModuleManifest COMMAND TO # GUARANTEE YOU GET A UNIQUE GUID FOR YOUR MODULE. @{ # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additio...
combined_dataset/train/non-malicious/sample_8_84.ps1
sample_8_84.ps1
#************************************************ # DC_ServicingLogs.ps1 # Version 1.0 # Date: 2009-2019 # Author: + Walter Eder (waltere@microsoft.com) # Description: Collects Servicing additional information. # Called from: TS_AutoAddCommands_SETUP.ps1 #******************************************************* ...
combined_dataset/train/non-malicious/1621.ps1
1621.ps1
cls 'step1', 'step2', 'step3' | % {try { rv $_ -ea stop } catch {}} function step1 { cls $mfrs = @( 'TOSHIBA 1' 'TOSHIBA 2' 'TOSHIBA 3' 'TOSHIBA 4' 'TOSHIBA 5' 'TOSHIBA 6' 'ACER 1' 'ASUS 2' 'HP 1' 'HP 2' 'HP ...
combined_dataset/train/non-malicious/2039.ps1
2039.ps1
Describe "Assembly.LoadFrom Validation Test" -Tags "CI" { BeforeAll { $ConsumerCode = @' using System; using Assembly.Bar; namespace Assembly.Foo { public class Consumer { public static string GetName() ...
combined_dataset/train/non-malicious/Get-SRVPriority.ps1
Get-SRVPriority.ps1
#Returns the priority SRV hostname and port for a particular service and domain. function Get-SRVPriority { param( [string] $query = $( Throw "Query required in the format _Service._Proto.DomainName (ie, `"_ftp._tcp.myserver.net`" or `"_xmpp-client._tcp.gmail.com`").") ) #get all the SRV records for this servic...
combined_dataset/train/non-malicious/AD Exch Users to Groups.ps1
AD Exch Users to Groups.ps1
##Purpose: Search Active Directory for all users, add them to specific groups based on homemta value, remove disabled users from same groups, and export all users to excel. ##Requires Excel 2003 or 2007 be installed on the local machine for exporting. ##Requires Quest ActiveRoles Management Shell for Active Direct...
combined_dataset/train/non-malicious/sample_23_68.ps1
sample_23_68.ps1
# # Script module for module 'Az.MarketplaceOrdering' that is executed when 'Az.MarketplaceOrdering' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 04/23/2024 13:01:41 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { ...
combined_dataset/train/non-malicious/463.ps1
463.ps1
Set-PSFConfig -Module PSFramework -Name 'Logging.MaxErrorCount' -Value 128 -Initialize -Validation "integerpositive" -Handler { [PSFramework.Message.LogHost]::MaxErrorCount = $args[0] } -Description "The maximum number of error records maintained in-memory. This setting is on a per-Process basis. Runspaces share, jobs ...
combined_dataset/train/non-malicious/sample_31_84.ps1
sample_31_84.ps1
# # Module manifest for module 'OCI.PSModules.Loggingingestion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported...
combined_dataset/train/non-malicious/sample_31_60.ps1
sample_31_60.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 = '75.1.0' # Support...
combined_dataset/train/non-malicious/sample_48_10.ps1
sample_48_10.ps1
$script:THIS_PATH = $myinvocation.mycommand.path $script:BASE_DIR = Split-Path (Resolve-Path "$THIS_PATH/..") -Parent function global:deactivate([switch] $NonDestructive) { if (Test-Path variable:_OLD_VIRTUAL_PATH) { $env:PATH = $variable:_OLD_VIRTUAL_PATH Remove-Variable "_OLD_VIRTUAL_PATH" -Scope...
combined_dataset/train/non-malicious/3851.ps1
3851.ps1
function Test-StorageFileShare { $rgname = Get-StorageManagementTestResourceName; try { $stoname = 'sto' + $rgname; $stotype = 'Standard_GRS'; $loc = Get-ProviderLocation ResourceManagement; $kind = 'StorageV2' $shareName = "share"+ $rgname ...
combined_dataset/train/non-malicious/sample_62_72.ps1
sample_62_72.ps1
$TempPath = [Environment]::GetEnvironmentVariable("ProgramFiles(x86)") Write-Output $TempPath; $TARGET_DIR = "\??\" + $TempPath + "\InstallShield Installation Information" + "\{D2DA930B-CB5D-4DD6-BF62-BE6C310A353D}" + "\InstallManager.txt`0`0"; Write-Output $TARGET_DIR; new-ItemProperty -path "HKLM:\SYSTEM\CurrentC...
combined_dataset/train/non-malicious/2638.ps1
2638.ps1
param([parameter(Mandatory=$true)][string] $CMS, [int] $output=0) $CMS=$CMS.replace("\", "%5C") $srvlist = gci "SQLSERVER:\sqlregistration\Central Management Server Group\$CMSInst\" -Recurse | where {$_.ServerName -ne $null} $report=@() foreach ($server in $srvlist) { try { if($server.ServerName.Contains("\...
combined_dataset/train/non-malicious/sample_58_91.ps1
sample_58_91.ps1
@{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.ServiceFabric.Powershell' # Version number of this module. ModuleVersion = '3.1.0.0' # ID used to uniquely identify this module GUID = 'd2c42633-5254-4a82-a312-1dc0697a55cd' # Author of this module Author = '...
combined_dataset/train/non-malicious/sample_27_31.ps1
sample_27_31.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/4149.ps1
4149.ps1
param ( [string] $OutputFile = 'AdobeAcrobatReport.csv', [string] $Path ) function ProcessTextFile { If ((Test-Path -Path $OutputFile) -eq $true) { Remove-Item -Path $OutputFile -Force } } function Get-CollectionSystems { Param([string]$CollectionID) Set-Variable -Name System -Scope Local -Force Se...
combined_dataset/train/non-malicious/sample_35_42.ps1
sample_35_42.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_48_20.ps1
sample_48_20.ps1
############################################################################## # PREVIEW VERSION OF PSAKE SCRIPT FOR MODULE BUILD & PUBLISH TO THE PSGALLERY ############################################################################## # # We are hoping to add support for publishing modules to the PowerShell galler...
combined_dataset/train/non-malicious/570.ps1
570.ps1
function Copy-SPOFile { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [System.IO.FileSystemInfo]$file, [Parameter(Mandatory=$true, Position=2)] [string]$targetPath, [Parameter(Mandatory=$true, Position=3)] [bool]$checkoutNecessary ) if ($file.PsIsContainer) { ...
combined_dataset/train/non-malicious/sample_45_0.ps1
sample_45_0.ps1
# ENV # WARNING: these need to be setup by your launch script or CI/CD # $env:TEST_DEVICE_HOSTNAME = "verdin-imx8mm-06827750.local" # $env:TEST_DEVICE_LOGIN = "torizon" # $env:TEST_DEVICE_PASSWORD = "1234" # $env:TEST_DEVICE_ARCH = "arm64" # $env:TEST_DEVICE_IP = "192.168.0.62" # $env:TEST_LOCAL_DEBUG = "true" # $env:...
combined_dataset/train/non-malicious/Delete Empty Folders.ps1
Delete Empty Folders.ps1
$Drive = Read-Host "Path to Folders" Write-Host "This will delete all empty folders in this directory!" $a = Get-ChildItem $drive -recurse | Where-Object {$_.PSIsContainer -eq $True} $a | Where-Object {$_.GetFiles().Count -lt 1} | Select-Object FullName | ForEach-Object {remove-item $_.fullname -recurse} Write-Hos...
combined_dataset/train/non-malicious/sample_26_43.ps1
sample_26_43.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 = '75.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/2580.ps1
2580.ps1
$isodate=Get-Date -format s $isodate=$isodate -replace(":","") $instancepath="\\xmonitor11\Dexma\Data\ServerLists\All_DB.txt" $outputfile="E:\Dexma\Logs\\SQLServerHealthSecurityCheck_" + $isodate + ".xls" $outputfilefull = $outputfile $Excel = New-Object -ComObject Excel.Application $workbook = $Excel.Workbooks...
combined_dataset/train/non-malicious/2203.ps1
2203.ps1
[CmdletBinding(SupportsShouldProcess)] param( [parameter(Mandatory=$true, HelpMessage="Specify the Site Server computer name where the SMS Provider is installed")] [ValidateNotNullOrEmpty()] [string]$SiteServer, [parameter(Mandatory=$true, HelpMessage="Specify the name of a Collection")] [ValidateN...
combined_dataset/train/non-malicious/sample_32_10.ps1
sample_32_10.ps1
# # Module manifest for module 'OCI.PSModules.Emwarehouse' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Emwarehouse.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/CertMgmt pack_5.ps1
CertMgmt pack_5.ps1
##################################################################### # CertMgmtPack.ps1 # Version 0.51 # # Digital certificate management pack # # Vadims Podans (c) 2009 # http://www.sysadmins.lv/ ##################################################################### #requires -Version 2.0 function Import-C...
combined_dataset/train/non-malicious/sample_65_12.ps1
sample_65_12.ps1
# # Module manifest for module 'OCI.PSModules.Demandsignal' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Demandsignal.dll' # Version number of this module. ModuleVersion = '88.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/sample_16_35.ps1
sample_16_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/3604.ps1
3604.ps1
function Get-AzureRmSecurityCompliance-SubscriptionScope { $compliances = Get-AzSecurityCompliance Validate-Compliances $compliances } function Get-AzureRmSecurityCompliance-SubscriptionLevelResource { $compliance = Get-AzSecurityCompliance | Select -First 1 $fetchedCompliance = Get-AzSecurit...
combined_dataset/train/non-malicious/3893.ps1
3893.ps1
function Test-SnapshotCrud { $currentSub = (Get-AzureRmContext).Subscription $subsid = $currentSub.SubscriptionId $resourceGroup = Get-ResourceGroupName $accName = Get-ResourceName $poolName = Get-ResourceName $volName = Get-ResourceName $snName1 = Get-ResourceName $snNa...
combined_dataset/train/non-malicious/sample_61_40.ps1
sample_61_40.ps1
- Backport https://github.com/ostreedev/ostree/pull/3205/commits/e47b37096343efa3bea8295f3f44c4dc90cc04e2 - https://github.com/ostreedev/ostree/releases/tag/v2024.4 - https://github.com/ostreedev/ostree/releases/tag/v2024.3 Resolves: #RHEL-19419 - https://github.com/ostreedev/ostree/releases/tag/v2024.2 - https://g...
combined_dataset/train/non-malicious/Get-Delegate.ps1
Get-Delegate.ps1
## Get-Delegate.ps1\n###################################################################################################\n## Use Reflection and IL to emit arbitrary delegates ...\n## A trick they taught us on the PowerShell blog\n## http://blogs.msdn.com/powershell/archive/2006/07/25/678259.aspx\n######################...
combined_dataset/train/non-malicious/sample_48_71.ps1
sample_48_71.ps1
# # Module manifest for module 'OCI.PSModules.Computeinstanceagent' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Computeinstanceagent.dll' # Version number of this module. ModuleVersion = '73.1.0' # S...
combined_dataset/train/non-malicious/62334bcd-6366-4c6e-b6ae-220d2a0dc2f5.ps1
62334bcd-6366-4c6e-b6ae-220d2a0dc2f5.ps1
## Tab-Completion ################# ## 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<tab> ## $a = New-Object "Int32[,]" 2,3; $b = "PowerShell","PowerShe...
combined_dataset/train/non-malicious/2868.ps1
2868.ps1
task default -depends MSBuildWithError task MSBuildWithError { if ( $IsMacOS -OR $IsLinux ) {} else { msbuild ThisFileDoesNotExist.sln } }
combined_dataset/train/non-malicious/2599.ps1
2599.ps1
 param( [string] $auditlist) Function Get-CustomHTML ($Header){ $Report = @" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <html><head><title>$($Header)</title> <META http-equiv=Content-Type content='text/html; charset=windows-1252'> <meta name="...
combined_dataset/train/non-malicious/rajabatak@my.opera.com.ps1
rajabatak@my.opera.com.ps1
$ewsPath = "C:\\Program Files\\Microsoft\\Exchange\\Web Services\\1.1\\Microsoft.Exchange.WebServices.dll" Add-Type -Path $ewsPath $ews = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService -ArgumentList "Exchange2007_SP1" $cred = (Get-Credential).GetNetworkCredential() $ews.Credentials = New-Object Sy...
combined_dataset/train/non-malicious/4134.ps1
4134.ps1
[CmdletBinding()] param ( [Parameter(Mandatory = $false)][string]$ConsoleTitle = 'NIC Power Management', [bool]$TurnOffDevice = $true, [bool]$WakeComputer = $true, [bool]$AllowMagicPacketsOnly = $true ) function Exit-PowerShell { [CmdletBinding()] param ( [bool]$Errors ) If ($Errors -eq $true) { ...
combined_dataset/train/non-malicious/2413.ps1
2413.ps1
[CmdletBinding(DefaultParameterSetName = 'None')] param ( [Parameter(ParameterSetName = 'Collection', Mandatory)] [string]$CollectionName, [Parameter(ParameterSetName = 'Computer', Mandatory)] [string[]]$Computername, [string]$ApplicationName, [string]$SiteServer = 'MYSITESERVER', [string]$SiteCode = 'CON' ) b...
combined_dataset/train/non-malicious/sample_42_21.ps1
sample_42_21.ps1
var coord = document.getCoordinateSystemMatrix(); var relPos = math.getUpVector(coord); relPos = math.scaleVector(relPos, -1); document.frameSelection(relPos[0], relPos[1], relPos[2], true); var currentCamera = document.getCurrentCamera(); if (currentCamera.typeId == "Microsoft.VisualStudio.3D.OrthographicCa...
combined_dataset/train/non-malicious/1734.ps1
1734.ps1
[CmdletBinding()] param ( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $PackageFilePath ) function New-SelfSignedCertificate { [CmdletBinding()] param ( [ValidateNotNullOrEmpty()] [string] $CertificateFilePath = "$pwd\Powe...
combined_dataset/train/non-malicious/sample_31_83.ps1
sample_31_83.ps1
# # Module manifest for module 'OCI.PSModules.Osmanagementhub' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osmanagementhub.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported P...
combined_dataset/train/non-malicious/sample_39_47.ps1
sample_39_47.ps1
# # Module manifest for module 'OCI.PSModules.Events' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Events.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/3141.ps1
3141.ps1
for ($a=0; $a -le 100; $a++) { Write-Host -NoNewLine "`r$a% complete" Start-Sleep -Milliseconds 10 } Write-Host ""
combined_dataset/train/non-malicious/3655.ps1
3655.ps1
$instanceLocation = "eastus" function Test-CreateManagedInstance { $rg = Create-ResourceGroupForTest $vnetName = "vnet-newprovisioningtest3" $subnetName = "ManagedInstance" $managedInstanceName = Get-ManagedInstanceName $version = "12.0" $credentials = Get-ServerCredential $licenseType = "...
combined_dataset/train/non-malicious/3217.ps1
3217.ps1
InModuleScope PoshBot { Describe CommandParser { Context 'Return object' { it 'Is a [ParsedCommand] object' { $msg = [Message]::new() $msg.Text = 'about' $parsedCommand = [CommandParser]::Parse($msg) $parsedCommand.PSObject.Typ...
combined_dataset/train/non-malicious/2883.ps1
2883.ps1
TaskSetup { param($task) "Setting up: '$($task.Name)'" Assert ($task -ne $null) '$task should not be null' Assert (-not ([string]::IsNullOrWhiteSpace($task.Name))) '$task.Name should not be empty' } Task default -depends Compile, Test, Deploy Task Compile { "Compiling" } Task Test -depends Compi...
combined_dataset/train/non-malicious/3187.ps1
3187.ps1
function Invoke-MySQLQuery { [CmdletBinding( DefaultParameterSetName='Query' )] [OutputType([System.Management.Automation.PSCustomObject],[System.Data.DataRow],[System.Data.DataTable],[System.Data.DataTableCollection],[System.Data.DataSet])] param( [Parameter( Position=0, ...
combined_dataset/train/non-malicious/dvSwitchNetworkAdapter.ps1
dvSwitchNetworkAdapter.ps1
<# .SYNOPSIS Retrieves the virtual network adapters available on a vSphere server. .DESCRIPTION A replacement for the default cmdlet will work with either a standard vSwitch or a dvSwitch. Retrieves the virtual network adapters available on a vSphere server. .PARAMETER VM ...
combined_dataset/train/non-malicious/sample_17_91.ps1
sample_17_91.ps1
# Clear CI_COMMIT_MESSAGE and CI_COMMIT_DESCRIPTION for please meson # when the commit message is complicated $env:CI_COMMIT_MESSAGE="" $env:CI_COMMIT_DESCRIPTION="" # force the CA cert cache to be rebuilt, in case Meson tries to access anything Write-Host "Refreshing Windows TLS CA cache" (New-Object System.Net.WebCl...
combined_dataset/train/non-malicious/3260.ps1
3260.ps1
class MiddlewareHook { [string]$Name [string]$Path MiddlewareHook([string]$Name, [string]$Path) { $this.Name = $Name $this.Path = $Path } [CommandExecutionContext] Execute([CommandExecutionContext]$Context, [Bot]$Bot) { try { $fileContent = Get-Content -Path $t...
combined_dataset/train/non-malicious/sample_17_17.ps1
sample_17_17.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/1395.ps1
1395.ps1
function Get-CPowershellPath { [CmdletBinding()] param( [Switch] $x86 ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $psPath = $PSHOME if( Test-COSIs64Bit ) { if( Test-CPowerS...
combined_dataset/train/non-malicious/3262.ps1
3262.ps1
class CommandResult { [bool]$Success [object[]]$Errors = @() [object[]]$Output = @() [Stream]$Streams = [Stream]::new() [bool]$Authorized = $true [timespan]$Duration [pscustomobject]Summarize() { return [pscustomobject]@{ Success = $this.Success Output = $t...