full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/Easy Migration Tool v3.1.ps1
Easy Migration Tool v3.1.ps1
#Generated Form Function function GenerateForm { ######################################################################## # Code Generated By: Richard Yaw # Generated On: 09/12/2010 # # Easy Migration Script for VMware (Version 2.1) # - Added a "Reload Tasks" feature. # - Fixed issue with the Undo feature for S...
combined_dataset/train/non-malicious/sample_56_28.ps1
sample_56_28.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apa...
combined_dataset/train/non-malicious/Start-MyTranscript.ps1
Start-MyTranscript.ps1
function Start-MyTranscript { Param ( [Parameter(Mandatory=$true,Position=0)] [string] $Path )# of Param Process { $fileextension = "txt" $filenamePrefix = [System.DateTime]::Now.ToString("yyyy-MM-dd") $existingFiles = Get-ChildItem (Join-Path $Path "$filenamePrefix.*.Transcript.$fileextens...
combined_dataset/train/non-malicious/sample_12_58.ps1
sample_12_58.ps1
##---------------------------------------------------------------------------- ## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved. ##---------------------------------------------------------------------------- # Import string constants . ./StringConstants.ps1 # Import shared functions and var...
combined_dataset/train/non-malicious/3598.ps1
3598.ps1
function Get-AzureRmDiscoveredSecuritySolution-SubscriptionScope { $discoveredSecuritySolutions = Get-AzDiscoveredSecuritySolution Validate-DiscoveredSecuritySolutions $discoveredSecuritySolutions } function Get-AzureRmDiscoveredSecuritySolution-ResourceGroupLevelResource { $discoveredSecuritySol...
combined_dataset/train/non-malicious/sample_21_27.ps1
sample_21_27.ps1
# Localized 06/28/2023 07:56 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1 ConvertFrom-StringData @' ###PSLOC Troubleshoot_Title=Troubleshooting Troubleshoot_DetectNetworkCache=Checking Windows Media Player network cache ... Resolution_Title=Resolution Resolution_ResetConfiguration=Resetting all configuration ...
combined_dataset/train/non-malicious/2036.ps1
2036.ps1
try { $IsInbox = $PSHOME.EndsWith('\WindowsPowerShell\v1.0', [System.StringComparison]::OrdinalIgnoreCase) $productName = "PowerShell" $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() $IsNotSkipped = ($IsWindows -and !$IsInbox) $PSDefaultParameterValues["it:ski...
combined_dataset/train/non-malicious/sample_27_34.ps1
sample_27_34.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function ConvertTo-ScriptExtent { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding()] [OutputType([System.Management.Automation.Language.IScriptExtent])] param( [Parameter(...
combined_dataset/train/non-malicious/4156.ps1
4156.ps1
function Uninstall-InnoSetup { [CmdletBinding()] param ( [ValidateNotNullOrEmpty()][string]$AppName ) $QuietUninstallString = ((Get-ChildItem -Path "REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\","REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\Current...
combined_dataset/train/non-malicious/3059.ps1
3059.ps1
function Should-BeLessThan($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) { if ($Negate) { return Should-BeGreaterOrEqual -ActualValue $ActualValue -ExpectedValue $ExpectedValue -Negate:$false -Because $Because } if ($ActualValue -ge $ExpectedValue) { return New-Obj...
combined_dataset/train/non-malicious/Compare-ADUserGroups.ps1
Compare-ADUserGroups.ps1
function Compare-ADUserGroups { #requires -pssnapin Quest.ActiveRoles.ADManagement param ( [string] $FirstUser = $(Throw "SAMAccountName required."), [string] $SecondUser = $(Throw "SAMAccountName required.") ) $a = (Get-QADUser $FirstUser).MemberOf $b = (Get-QADUser $SecondUser).MemberOf $c = Comp...
combined_dataset/train/non-malicious/780.ps1
780.ps1
function Get-PsesRpcNotificationMessage { [CmdletBinding(DefaultParameterSetName = "PsesLogEntry")] param( [Parameter(Mandatory = $true, Position = 0, ParameterSetName = "Path")] [Alias("PSPath")] [ValidateNotNullOrEmpty()] [string] $Path, [Par...
combined_dataset/train/non-malicious/3439.ps1
3439.ps1
function Get-TestFolders([string] $srcPath, [string[]] $projectList) { $specialPaths = @{ 'Storage' = 'Storage.Management.Test\ScenarioTests'; 'Accounts' = 'Accounts.Test' } $resourceMan...
combined_dataset/train/non-malicious/sample_22_52.ps1
sample_22_52.ps1
# make sure we stop on exceptions $ErrorActionPreference = "Stop" # This object reprents the result value for tab expansion functions when no result is returned. # This is so that we can distinguish it from $null, which has different semantics $NoResultValue = New-Object PSObject -Property @{ NoResult = $true } ...
combined_dataset/train/non-malicious/632.ps1
632.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5.msi" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" } $Configs | ForEach-Object{ try{ $_.Result = $nul...
combined_dataset/train/non-malicious/SQL Log Backup.ps1
SQL Log Backup.ps1
## log backup $backuppath = "\\\\server\\sqlbackups\\" $alertaddress = "jrich@domain.com" $smtp = "smtp.domain.com" $hname = (gwmi win32_computersystem).name [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlSe...
combined_dataset/train/non-malicious/Get-ExchangeDBSizes.ps1
Get-ExchangeDBSizes.ps1
<# .SYNOPSIS Get-ExchangeDBSizes - Gather data on Exchange 2007 / 2010 Mailbox Databases. .DESCRIPTION Gathers data from Exchange mailbox servers. These data include: Server\\StorageGroup\\Database (2007) or Database (2010), Total Size (in GB) of the disk, Size of the .edb file (in GB), ...
combined_dataset/train/non-malicious/sample_51_74.ps1
sample_51_74.ps1
# Localized 12/03/2020 06:20 PM (GMT) 303:4.80.0411 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=&Sì PromptNoString=&No BundleFound=Pacchetto trovato: {0} PackageFound=Pacchetto trovato: {0} EncryptedBundleFound=Bundle crittografato trovato: {0} EncryptedPackag...
combined_dataset/train/non-malicious/108.ps1
108.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/sample_60_10.ps1
sample_60_10.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_13_63.ps1
sample_13_63.ps1
#************************************************ # TS_HyperVEvent106Check.ps1 # Version 1.0.08.26.14: Created Rule. # Version 1.1.09.04.14: Configured the detection logic to flag events for only the last 7 days. # Author: bbenson, tode # Description: Check for Hyper-V Event 106 #*********************************...
combined_dataset/train/non-malicious/sample_42_49.ps1
sample_42_49.ps1
# # Module manifest for module 'OCI.PSModules.Apmsynthetics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmsynthetics.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/1856.ps1
1856.ps1
Describe "Remote import-module tests" -Tags 'Feature','RequireAdminOnWindows' { BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() $modulePath = "$testdrive\Modules\TestImport" if (!$IsWindows) { $PSDefaultParameterValues["it:skip"] = $true ...
combined_dataset/train/non-malicious/sample_38_86.ps1
sample_38_86.ps1
param( [ValidateSet("pcre2","core", "all")] [string] $proj = "all", [switch] $init, [switch] $install, [ValidateSet("ON","OFF")] [string] $static = "ON", [ValidateSet("Debug","Release")] [string] $config = "Release", [ValidateSet("x86","x64","arm64")] [string] $arch = "x...
combined_dataset/train/non-malicious/sample_41_82.ps1
sample_41_82.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ###########################################################...
combined_dataset/train/non-malicious/sample_20_94.ps1
sample_20_94.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 = '81.0.0' # S...
combined_dataset/train/non-malicious/990.ps1
990.ps1
Param( [parameter(Mandatory=$true)] $CsvFilePath ) $ErrorActionPreference = "Stop" $scriptsPath = $PSScriptRoot if ($PSScriptRoot -eq "") { $scriptsPath = "." } . "$scriptsPath\asr_logger.ps1" . "$scriptsPath\asr_common.ps1" . "$scriptsPath\asr_csv_processor.ps1" Function CheckParameter($logger, [string...
combined_dataset/train/non-malicious/sample_14_49.ps1
sample_14_49.ps1
# Copyright ?2008, Microsoft Corporation. All rights reserved. # You may use this code and information and create derivative works of it, # provided that the following conditions are met: # 1. This code and information and any derivative works may only be used for # troubleshooting a) Windows and b) products for ...
combined_dataset/train/non-malicious/4119.ps1
4119.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()] [string]$File = 'C:\WinPE\SCCM.iso' ) Import-Module Dism $Directory = $File.substring(0, $File.LastIndexOf('\')) $Drive = ((Mount-DiskImage -ImagePath $File) | Get-Volume).DriveLetter Remove-Item -Path ($Directory + '\Mount') -Recurse -Force -ErrorAction Silen...
combined_dataset/train/non-malicious/sample_14_46.ps1
sample_14_46.ps1
ConvertFrom-StringData @' id_whoamioutput=Whoami Diagnostic Tool id_whoamistatus=Running Whoami.exe to gather the user's SID, group memberships and privileges '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w...
combined_dataset/train/non-malicious/1534.ps1
1534.ps1
function Test-MrFileLock { [CmdletBinding()] param ( [ValidateScript({ If (Test-Path -Path $_ -PathType Leaf) { $True } else { Throw "'$($_ -replace '^.*\\')' is not a valid file." } })] [string]$Path ) try { ...
combined_dataset/train/non-malicious/sample_33_78.ps1
sample_33_78.ps1
# # Module manifest for module 'Microsoft.SME.FailoverCluster' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.FailoverCluster.psm1' # Version number of this module. ModuleVersion = '4.11.0' # Supported PSEditions # CompatiblePSEditions = @() # I...
combined_dataset/train/non-malicious/sample_40_43.ps1
sample_40_43.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/3247.ps1
3247.ps1
class Event { [string]$Type [string]$ChannelId [pscustomobject]$Data }
combined_dataset/train/non-malicious/2175.ps1
2175.ps1
$SiteServer = "CAS01" $SiteCode = "CAS" $AppName = "7-Zip 9.20 x64" try { Add-Type -Path (Join-Path -Path (Get-Item $env:SMS_ADMIN_UI_PATH).Parent.FullName -ChildPath "Microsoft.ConfigurationManagement.ApplicationManagement.dll") Add-Type -Path (Join-Path -Path (Get-Item $env:SMS_ADMIN_UI_PATH).Parent.FullName...
combined_dataset/train/non-malicious/sample_62_88.ps1
sample_62_88.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/Remove Disabled AD Users.ps1
Remove Disabled AD Users.ps1
import-module ActiveDIrectory search-adaccount -searchbase "ou=UserObjectsPendingDeletion,DC=mydomain,DC=com" -Accountinactive -Timespan 400.00:00:00 | where {$_.objectclass -eq 'user'} | remove-aduser -confirm:$false
combined_dataset/train/non-malicious/sample_46_85.ps1
sample_46_85.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/3651.ps1
3651.ps1
function Test-AddTarget { $a1 = Create-ElasticJobAgentTestEnvironment try { Test-AddServerTargetWithDefaultParam $a1 Test-AddServerTargetWithParentObject $a1 Test-AddServerTargetWithParentResourceId $a1 Test-AddServerTargetWithPiping $a1 Test-AddDatabaseTargetWithDefaultParam $a1 ...
combined_dataset/train/non-malicious/1829.ps1
1829.ps1
Describe "Get-Service cmdlet tests" -Tags "CI" { BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() if ( -not $IsWindows ) { $PSDefaultParameterValues["it:skip"] = $true } } AfterAll { $global:PSDefaultParameterValues = $originalDefaultParameterVal...
combined_dataset/train/non-malicious/ESXi Config BackupScript.ps1
ESXi Config BackupScript.ps1
###ESXi Configuration Backup Script #DESCRIPION: This Script takes a CSV file with the hostname, username, and password of a list of ESXi servers, and backs up their configurations to a specified Destination #USAGE: This script is meant to be run as a regular scheduled task or a pre-script for a backup job. There is ...
combined_dataset/train/non-malicious/sample_1_46.ps1
sample_1_46.ps1
# To check organizations that are not updated on the CRM server. # # Rule to look for organizations that have not been updated to correct version. # # Created: 1/25/2012 # Author: Jonathan Randall #****************************************************************************************************************** ...
combined_dataset/train/non-malicious/2557.ps1
2557.ps1
param( $SQLServer, $BAKFile = '\\xsqlutil18\e$\MSSQL10.MSSQLSERVER\MSSQL\dbamaint_empty_11_26_2012.bak', $FilePrefix = 'Log', [switch]$Log ) if (!$SQLServer ) { $SQLServer = Get-Content "E:\Dexma\data\ServerList.txt" } function Run-Query() { param ( $SqlQuery , $SqlServer , $SqlCatalog , $SqlUs...
combined_dataset/train/non-malicious/1057.ps1
1057.ps1
Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath 'CarbonDscTest' -Resolve) -Force Describe 'Carbon_Privilege' { $UserName = 'CarbonDscTestUser' $Password = [Guid]::NewGuid().ToString() Install-User -UserName $UserName -Password $Password BeforeAll { Start-CarbonDscTest...
combined_dataset/train/non-malicious/sample_17_30.ps1
sample_17_30.ps1
ConvertFrom-StringData @' id_sandev=Computer Storage Information id_sanstorageinfooutput=SAN utility output id_sanstorageinfooutputdesc=Storage Information '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7Y...
combined_dataset/train/non-malicious/sample_45_24.ps1
sample_45_24.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/Out-Balloon_2.ps1
Out-Balloon_2.ps1
<# .Synopsis Makes a baloon tip in the notification area .Description With just a few arguments, it is easy to make some text appear in a little balloon. You can specify an icon file (*.ico) with the -icon argument, if you don't then the first icon of the host is used. out-balloo...
combined_dataset/train/non-malicious/sample_37_97.ps1
sample_37_97.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ##############################################################>...
combined_dataset/train/non-malicious/finddupe_13.ps1
finddupe_13.ps1
# new version avoids recalculating MD5s, has delete/noprompt options, and by default checks the current directory. function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.MD5CryptoServiceProvide...
combined_dataset/train/non-malicious/sample_2_87.ps1
sample_2_87.ps1
# # Module manifest for module 'OCI.PSModules.Databasetools' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasetools.dll' # Version number of this module. ModuleVersion = '92.1.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_53_18.ps1
sample_53_18.ps1
# # Module manifest for module 'OCI.PSModules.Dataintegration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dataintegration.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported P...
combined_dataset/train/non-malicious/sample_27_53.ps1
sample_27_53.ps1
# # Module manifest for module 'OCI.PSModules.Networkfirewall' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Networkfirewall.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported P...
combined_dataset/train/non-malicious/LetterDiamondOneLiner v4.ps1
LetterDiamondOneLiner v4.ps1
&{($r=,(' '*($p=[char]$args[0]-($s=65))+[char]$s)+($p..1|%{"{0,$_} {1}{0}"-f[char]++$s,(' '*$f++)}));$r[-2..-99]}J
combined_dataset/train/non-malicious/sample_45_92.ps1
sample_45_92.ps1
# # Module manifest for module 'OCI.PSModules.Databasemanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasemanagement.dll' # Version number of this module. ModuleVersion = '82.0.0' # Suppo...
combined_dataset/train/non-malicious/445.ps1
445.ps1
Register-PSFConfigValidation -Name "sizestyle" -ScriptBlock { param ( $Value ) $Result = New-Object PSObject -Property @{ Success = $True Value = $null Message = "" } try { [PSFramework.Utility.SizeStyle]$style = $Value } catch { $Result.Message = "Not...
combined_dataset/train/non-malicious/662.ps1
662.ps1
Describe 'New-RsScheduleXML' { $CurrentDate = Get-Date Context 'New-RsScheduleXML -Once' { $Schedule = New-RsScheduleXML -Once -Start $CurrentDate It 'Should return valid schedule XML' { @($Schedule).Count | Should Be 1 $Schedule | Should BeOfType...
combined_dataset/train/non-malicious/xczxc.ps1
xczxc.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/Get_Set Signature 2.3.ps1
Get_Set Signature 2.3.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/sample_12_52.ps1
sample_12_52.ps1
param( [string]$DataPath, [switch]$AcceptEula ) $version = "Evt-Collect (20240604)" # by Gianni Bragante - gbrag@microsoft.com Function EvtLogDetails { param( [string] $LogName ) Write-Log ("Collecting the details for the " + $LogName + " log") $cmd = "wevtutil gl """ + $logname + """ >>""" + $g...
combined_dataset/train/non-malicious/sample_26_70.ps1
sample_26_70.ps1
param($installPath, $toolsPath, $package, $project) Import-Module (Join-Path $toolsPath common.psm1) -Force try { # Indicates if current project is a VB project $IsVbProject = ($project.CodeModel.Language -eq [EnvDTE.CodeModelLanguageConstants]::vsCMLanguageVB) if ($IsVbProject) { ...
combined_dataset/train/non-malicious/2669.ps1
2669.ps1
$configFilePath = "D:\ModernPagesConfig.xlsx" function Add-PnPModernListWebPart() { param( [Parameter(Mandatory)] [ValidateSet("Library", "List")] [String] $WebPartType, [Parameter(Mandatory)] [ValidateScript( { if (-not (Get-PnPClientSidePage $_)) { thr...
combined_dataset/train/non-malicious/Out-ColorMatchInfo.ps1
Out-ColorMatchInfo.ps1
<# .Synopsis Highlights MatchInfo objects similar to the output from grep. .Description Highlights MatchInfo objects similar to the output from grep. #> #requires -version 2 param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [Microsoft.PowerShell.Commands.MatchInfo] $match ) begin {} proc...
combined_dataset/train/non-malicious/sample_20_95.ps1
sample_20_95.ps1
# # Module manifest for module 'Microsoft.SME.PacketMon' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.PacketMon.psm1' # Version number of this module. ModuleVersion = '4.10.0' # Supported PSEditions # CompatiblePSEditions = @() # ID used to un...
combined_dataset/train/non-malicious/sample_27_95.ps1
sample_27_95.ps1
# # Module manifest for module 'OCI.PSModules.Devops' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Devops.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/4118.ps1
4118.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()] [string]$Collection, [ValidateNotNullOrEmpty()] [string]$SQLServer, [ValidateNotNullOrEmpty()] [string]$SQLDatabase, [ValidateNotNullOrEmpty()] [string]$DeploymentName, [ValidateNotNullOrEmpty()] [int]$MaxDays ) function Initialize-Reboot { [CmdletBin...
combined_dataset/train/non-malicious/sample_63_86.ps1
sample_63_86.ps1
Import-LocalizedData -BindingVariable lanTxt -FileName AzStackHci.ArcIntegration.Strings.psd1 function Test-ExistingArcResources { [CmdletBinding()] param ( [string] $SubscriptionId, [string] $ArcResourceGroupName, [string[]] $NodeNames ) try ...
combined_dataset/train/non-malicious/sample_19_81.ps1
sample_19_81.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .Synopsis Group Policy tools use administrative template files (.admx, .adml) to populate policy settings in the user interface. This allows administrators to manage registry-based policy settings. This script installes Powe...
combined_dataset/train/non-malicious/Start-Presentation.ps1
Start-Presentation.ps1
PARAM( $presentationTitle = "PowerShell Presentation" , $background = "C:\\Users\\Joel\\Pictures\\flow\\Flow_2560.jpg" ) Import-Module PowerBoots $name = [System.Windows.Navigation.JournalEntry]::NameProperty function global:Add-Slide { [CmdletBinding()] PARAM( [Parameter(Position=0)] $Title...
combined_dataset/train/non-malicious/sample_34_55.ps1
sample_34_55.ps1
<#################################################################################################################################################################################################################### ##############################| |#################################################################...
combined_dataset/train/non-malicious/sample_2_88.ps1
sample_2_88.ps1
# # Module manifest for module 'OCI.PSModules.Generativeaiinference' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Generativeaiinference.dll' # Version number of this module. ModuleVersion = '92.1.0' #...
combined_dataset/train/non-malicious/Test-Certificate_2.ps1
Test-Certificate_2.ps1
##################################################################### # Test-Certificate.ps1 # Version 0.9 # # Tests specified certificate for certificate chain and revocation # # Vadims Podans (c) 2009 # http://www.sysadmins.lv/ ##################################################################### #requires -...
combined_dataset/train/non-malicious/sample_67_24.ps1
sample_67_24.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 = '86.0.0' # Sup...
combined_dataset/train/non-malicious/Get-MIX10Video_1.ps1
Get-MIX10Video_1.ps1
#requires -version 2.0 PARAM ( [Parameter(Position=1, Mandatory=$true)] [ValidateSet("wmv","wmvhigh","pptx", "mp4")] [String]$MediaType, [string]$Destination = $PWD ) if( ([System.Environment]::OSVersion.Version.Major -gt 5) -and -not ( # Vista and ... new-object Security.Principal.WindowsPrinc...
combined_dataset/train/non-malicious/sample_40_3.ps1
sample_40_3.ps1
@{ GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" FunctionsToExport = @() CmdletsToExport = "Get-Credential", "Get-ExecutionP...
combined_dataset/train/non-malicious/2766.ps1
2766.ps1
ForEach ($NameSpace in "root\subscription","root\default") { get-wmiobject -namespace $NameSpace -query "select * from __EventConsumer" }
combined_dataset/train/non-malicious/sample_40_46.ps1
sample_40_46.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> $HostFile = "$Env:SystemRoot\System32\Drivers\Etc\...
combined_dataset/train/non-malicious/sample_32_87.ps1
sample_32_87.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.DataCollectionRule.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Module]::Instance # Export nothing to...
combined_dataset/train/non-malicious/sample_27_57.ps1
sample_27_57.ps1
# # Module manifest for module 'OCI.PSModules.Opensearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opensearch.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/595.ps1
595.ps1
function Install-PowerShellPowerUp{ param( [switch] $Force ) Set-Location $PSprofile.Path Invoke-Expression "$($PSProfile.Install.FullName) -Force:`$Force" Set-Location $WorkingPath }
combined_dataset/train/non-malicious/sample_57_15.ps1
sample_57_15.ps1
# Localized 06/28/2023 08:16 AM (GMT) 303:7.0.30723 rs_disableusbselective.psd1 ConvertFrom-StringData @' ###PSLOC reset_USBSelective=Activation de la suspension sélective USB Report_name_USBSelective_AC_result=Résultat de l’activation de la suspension sélective USB pour le courant alternatif Report_name_USBSelec...
combined_dataset/train/non-malicious/sample_5_15.ps1
sample_5_15.ps1
[ dynamic, provider("dcismprovider"), Description ("The power management capabilities of the element are " "decoupled from a PowerManagementService, " "because a single service could apply to multiple elements, each " "with specific capabilities.") ] class DCIM_CSPowerManagementCapabilities : CIM_Pow...
combined_dataset/train/non-malicious/1525.ps1
1525.ps1
function Assert-LastProcessSucceeded { [CmdletBinding()] param( [Parameter(Position=0)] [string] $Message ) if( $LastExitCode -ne 0 ) { Fail "Expected process to succeed, but it failed (exit code: $LastExitCode). $Message" } }
combined_dataset/train/non-malicious/sample_39_36.ps1
sample_39_36.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_4_6.ps1
sample_4_6.ps1
# # Module manifest for module 'OCI.PSModules.Announcementsservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Announcementsservice.dll' # Version number of this module. ModuleVersion = '93.0.0' # S...
combined_dataset/train/non-malicious/sample_26_22.ps1
sample_26_22.ps1
@{ IncludeRules=@('PSUseApprovedVerbs', 'PSReservedCmdletChar', 'PSReservedParams', 'PSShouldProcess', 'PSUseShouldProcessForStateChangingFunctions', 'PSUseSingularNouns', 'PSMissingModuleManifestField'...
combined_dataset/train/non-malicious/1373.ps1
1373.ps1
function Set-CIisMimeMap { [CmdletBinding(SupportsShouldProcess=$true,DefaultParameterSetName='ForWebServer')] param( [Parameter(Mandatory=$true,ParameterSetName='ForWebsite')] [string] $SiteName, [Parameter(ParameterSetName='ForWebsite')] [string] ...
combined_dataset/train/non-malicious/sample_31_54.ps1
sample_31_54.ps1
function Get-ServiceUrl { param ( [Parameter(Mandatory = $false)] [string]$Method, [Parameter(Mandatory = $false)] $LaunchConfig ) [string]$ServiceUrl = (Get-ValueFromALTestRunnerConfig -KeyName 'testRunnerServiceUrl') if ([String]::IsNullOrEmpty($ServiceUrl))...
combined_dataset/train/non-malicious/sample_63_35.ps1
sample_63_35.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 = '86.2.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/1675.ps1
1675.ps1
function touch { param ( [string]$file, $date = '' ) if ($file -eq $null) { throw 'No filename supplied' } if (!$date) { $date = Get-Date } else { $date = Get-Date $date } $dir = Split-Path $file if (Test-Path $file) { (Get-Item ...
combined_dataset/train/non-malicious/Convert-ToCHexString_2.ps1
Convert-ToCHexString_2.ps1
function Convert-ToCHexString { param ([String] $str) $ans = '' [System.Text.Encoding]::ASCII.GetBytes($str) | % { $ans += "0x{0:X2}, " -f $_ } return $ans.Trim(' ',',') }
combined_dataset/train/non-malicious/1981.ps1
1981.ps1
Describe "Tee-Object" -Tags "CI" { Context "Validate Tee-Object is correctly forking output" { $testfile = Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath assets) -ChildPath testfile.txt It "Should return the output to the screen and to the variable" { $teefile = $testfile Wri...
combined_dataset/train/non-malicious/1696.ps1
1696.ps1
function Get-Firewall { param ( [object]$comps = $env:COMPUTERNAME ) foreach ($computer in $comps) { try { $status = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computer).OpenSubKey('SYSTEM\ControlSet001\Services\SharedAcces...
combined_dataset/train/non-malicious/sample_11_41.ps1
sample_11_41.ps1
param( [string]$DataPath, [switch]$AcceptEula ) $version = "Evt-Collect (20240604)" # by Gianni Bragante - gbrag@microsoft.com Function EvtLogDetails { param( [string] $LogName ) Write-Log ("Collecting the details for the " + $LogName + " log") $cmd = "wevtutil gl """ + $logname + """ >>""" + $g...
combined_dataset/train/non-malicious/sample_53_20.ps1
sample_53_20.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apa...
combined_dataset/train/non-malicious/sample_6_45.ps1
sample_6_45.ps1
ConvertFrom-StringData @' id_classreg=Class Registration id_classdesc=Determining if critical Windows Update dll's are registered '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIB...
combined_dataset/train/non-malicious/Const.ps1
Const.ps1
function Set-Constant { <# .SYNOPSIS Creates constants. .DESCRIPTION This function can help you to create constants so easy as it possible. It works as keyword 'const' as such as in C#. .EXAMPLE PS C:\\> Set-Constant a = 10 PS C:\\> $a += 13 Ther...
combined_dataset/train/non-malicious/sample_7_94.ps1
sample_7_94.ps1
# Load Common Library # Load Reporting Utilities #$debug = $false . ./utils_cts.ps1 . ./TS_RemoteSetup.ps1 # 2023-02-20 WalterE mod Trap #we# trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo...
combined_dataset/train/non-malicious/sample_42_88.ps1
sample_42_88.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/1783.ps1
1783.ps1
Function Install-ModuleIfMissing { param( [parameter(Mandatory)] [String] $Name, [version] $MinimumVersion, [switch] $SkipPublisherCheck, [switch] $Force ) $module = Get-Module -Name $Name -ListAvailable -ErrorAction Ignore | Sort-Ob...
combined_dataset/train/non-malicious/sample_12_69.ps1
sample_12_69.ps1
#************************************************ # TS_StoreAppsFailureForDCOMErrorCheck.ps1 # Version 1.0.1 # Date: 3/13/2013 # Author: V-maam # Description: [Idea ID 7544] [Windows] WinStore - Apps do not launch, because "ALL APPLICATIONS PACKAGES" removed from DCOM ACL # Rule number: 7544 # Rule URL: http:...