full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/1182.ps1
1182.ps1
$appPoolName = 'CarbonInstallIisAppPool' $username = 'CarbonInstallIisAppP' $password = '!QAZ2wsx8fk3' & (Join-Path -Path $PSScriptRoot 'Initialize-CarbonTest.ps1' -Resolve) Install-User -Credential (New-Credential -Username $username -Password $password) -Description 'User for testing Carbon''s Install-I...
combined_dataset/train/non-malicious/SqlProxy_3.psm1.ps1
SqlProxy_3.psm1.ps1
# --------------------------------------------------------------------------- ### <Author> ### Chad Miller ### </Author> ### <Description> ### Based on functions in SQLPSX. SqlProxy.psm1 module is used for administering ### SQL Server logins, users, and roles. Designed to be used with PS Remoting. ### All actio...
combined_dataset/train/non-malicious/375.ps1
375.ps1
Describe "Get-PSFConfig Unit Tests" -Tag "CI", "Config", "Unit" { BeforeAll { Get-PSFConfig -Module PSFTests -Force | ForEach-Object { $null = [PSFramework.Configuration.ConfigurationHost]::Configurations.Remove($_.FullName) } } AfterAll { Get-PSFConfig -Module PSFTests -Force | ForEach-Object { $null = ...
combined_dataset/train/non-malicious/2200.ps1
2200.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server name with SMS Provider installed")] [ValidateNotNullorEmpty()] [string]$SiteServer, [parameter(Mandatory=$true, HelpMessage="Name of the device that will be removed from any specified device collect...
combined_dataset/train/non-malicious/1731.ps1
1731.ps1
function New-ServiceNowTableEntry{ Param ( [parameter(mandatory=$true)] [parameter(ParameterSetName='SpecifyConnectionFields')] [parameter(ParameterSetName='UseConnectionObject')] [parameter(ParameterSetName='SetGlobalAuth')] [string]$Table, ...
combined_dataset/train/non-malicious/1956.ps1
1956.ps1
Describe "Format-Table" -Tags "CI" { It "Should call format table on piped input without error" { { Get-Date | Format-Table } | Should -Not -Throw } It "Should return a format object data type" { $val = Get-Date | Format-Table | Get-Member $val2...
combined_dataset/train/non-malicious/SharpSsh Functions.ps1
SharpSsh Functions.ps1
## USING the binaries from: ## http://downloads.sourceforge.net/sharpssh/SharpSSH-1.1.1.13.bin.zip [void][reflection.assembly]::LoadFrom( (Resolve-Path "~\\Documents\\WindowsPowerShell\\Libraries\\Tamir.SharpSSH.dll") ) ## NOTE: These are bare minimum functions, and only cover ssh, not scp or sftp ## also, ...
combined_dataset/train/non-malicious/sample_15_41.ps1
sample_15_41.ps1
trap { # If we except, lets report it visually. Can help with debugging if there IS a problem # in here. Write-Host "EXCEPTION: $($PSItem.ToString())" -ForegroundColor Red Write-Host "$($PSItem.ScriptStackTrace)" Start-Sleep 10 } # Get an environment variable with default value if not present fu...
combined_dataset/train/non-malicious/3780.ps1
3780.ps1
function Test-RegisteredServer { $resourceGroupName = Get-ResourceGroupName Write-Verbose "RecordMode : $(Get-StorageTestMode)" try { $storageSyncServiceName = Get-ResourceName("sss") $resourceGroupLocation = Get-ResourceGroupLocation $resourceLocatio...
combined_dataset/train/non-malicious/sample_4_58.ps1
sample_4_58.ps1
#************************************************ # TS_ModernAppsFailureForUserProfileDirCheck.ps1 # Version 1.0.1 # Date: 3/13/2013 # Author: v-kaw # Description: [Idea ID 7546] [Windows] WinStore - Modern Apps Fail to Start if the User Profile directory is Moved from default # Rule number: 7546 # Rule URL: ...
combined_dataset/train/non-malicious/sample_27_51.ps1
sample_27_51.ps1
# # Module manifest for module 'OCI.PSModules.Autoscaling' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Autoscaling.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_42_58.ps1
sample_42_58.ps1
# # Module manifest for module 'OCI.PSModules.Servicemesh' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemesh.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_3_41.ps1
sample_3_41.ps1
// ================================================================== // DCIM_License // ================================================================== [dynamic, provider("dcismprovider"), Description ( "DCIM_License is a derivation of" "CIM_ManagedElement, and represents a" "feat...
combined_dataset/train/non-malicious/sample_66_47.ps1
sample_66_47.ps1
# # Module manifest for module 'OCI.PSModules.Cloudguard' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Cloudguard.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/8e2c5f39-6676-4cb0-bdac-6f8819060c49.ps1
8e2c5f39-6676-4cb0-bdac-6f8819060c49.ps1
#------------------------------------------------------------------------------ # # get the 'connect' entries from the logs of all the Exchange CAS servers # only keep the last 30 days # # runs at 2AM #------------------------------------------------------------------------------ Function Get-ClientVersionC...
combined_dataset/train/non-malicious/sample_49_87.ps1
sample_49_87.ps1
function Get-WAC1PClusterDetails { <# .SYNOPSIS Get cluster name and domain. .DESCRIPTION Get cluster name and domain. .ROLE Administrators #> $cluster = Get-Cluster $clusterName = $cluster.Name $clusterDomain = $cluster.Domain "$clusterName.$clusterDomain" } ## [END] Get-WAC1PClusterDetails...
combined_dataset/train/non-malicious/2510.ps1
2510.ps1
Param( [Parameter(Position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] [ValidateNotNullorEmpty()] [Alias("name")] [string[]]$Computername=$env:computername ) Begin { Set-StrictMode -Version 2.0 $ErrorActionPreference="Silentl...
combined_dataset/train/non-malicious/sample_20_22.ps1
sample_20_22.ps1
using namespace System.Management.Automation using namespace System.Management.Automation.Language # This is an example profile for PSReadLine. # # This is roughly what I use so there is some emphasis on emacs bindings, # but most of these bindings make sense in Windows mode as well. Import-Module PSReadLine ...
combined_dataset/train/non-malicious/sample_46_39.ps1
sample_46_39.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> #requires -Version 4.0 #requires -Module CloudD...
combined_dataset/train/non-malicious/sample_44_72.ps1
sample_44_72.ps1
# # Module manifest for module 'OCI.PSModules.Identitydataplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Identitydataplane.dll' # Version number of this module. ModuleVersion = '83.1.0' # Support...
combined_dataset/train/non-malicious/sample_67_70.ps1
sample_67_70.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .Synopsis Registers or unregisters the PowerShell ETW manifest .Parameter Path The fully qualified path to the PowerShell.Core.Instrumentation.man manifest file. The default value is the location of this script. .Paramet...
combined_dataset/train/non-malicious/sample_50_52.ps1
sample_50_52.ps1
/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ define("vs/languages/typescript/js/importAndExportRewriter.nls.keys",[],{}); // SIG // Begin signature block // SIG // MIIjiAYJKoZIhv...
combined_dataset/train/non-malicious/1614.ps1
1614.ps1
function Get-BitLockerKey { param ( [string]$comp = $env:COMPUTERNAME ) if (!$comp.endswith('$')) { $comp += '$' } $compsearcher = [adsisearcher]"samaccountname=$comp" $compsearcher.PageSize = 200 $compsearcher.PropertiesToLoad.Add('name') | Out-Null $compobj =...
combined_dataset/train/non-malicious/sample_43_28.ps1
sample_43_28.ps1
# -------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All Rights Reserved. # Microsoft Corporation (or based on where you live, one of its affiliates) licenses this sample code for your internal testing purposes only. # Microsoft provides the following sample cod...
combined_dataset/train/non-malicious/sample_38_0.ps1
sample_38_0.ps1
# # Module manifest for module 'OCI.PSModules.Vnmonitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Vnmonitoring.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/4169.ps1
4169.ps1
cls Set-Variable -Name a -Scope Global -Force Set-Variable -Name Output -Scope Global -Force Function AddRemovePrograms($KeyName, $DisplayName, $Version){ Set-Variable -Name AddRemKey -Value "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" -Scope Local -Force ...
combined_dataset/train/non-malicious/sample_50_70.ps1
sample_50_70.ps1
# # Module manifest for module 'OCI.PSModules.Oce' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Oce.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_19_15.ps1
sample_19_15.ps1
@{ RootModule = 'PSReadLine.psm1' NestedModules = @("Microsoft.PowerShell.PSReadLine2.dll") ModuleVersion = '2.4.0' GUID = '5714753b-2afd-4492-a5fd-01d9e2cff8b5' Author = 'Microsoft Corporation' CompanyName = 'Microsoft Corporation' Copyright = '(c) Microsoft Corporation. All rights reserved.' Description = 'Gr...
combined_dataset/train/non-malicious/sample_14_55.ps1
sample_14_55.ps1
# --------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------------------------------------------...
combined_dataset/train/non-malicious/1846.ps1
1846.ps1
Describe 'New-WinEvent' -Tags "CI" { Context "New-WinEvent tests" { BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() if ( ! $IsWindows ) { $PSDefaultParameterValues["it:skip"] = $true } $ProviderName ...
combined_dataset/train/non-malicious/sample_65_24.ps1
sample_65_24.ps1
<# .DESCRIPTION Support Enter-SmePSSession to specified computer as specified username. Password will be promoted. - Enabled by adding "%ProgramFiles%\Windows Admin Center\PowerShell\Modules" to $env:PSModulePath #> Function Enter-SmePSSession { <# .SYNOPSIS Remote logon to PowerShell sessio...
combined_dataset/train/non-malicious/34acf364-c8a0-4ea5-8002-1b134280c15b.ps1
34acf364-c8a0-4ea5-8002-1b134280c15b.ps1
# # simple example using a hash to parse CAS Connect Logs # # after using the get-CASConnectLogEntries.ps1 to collect the log information # this script runs thru those files and counts Cached vs Classic # # # the directory where you keep these "cas connect logs" - change to fit your needs $Script:CasLogUNC...
combined_dataset/train/non-malicious/finddupe_11.ps1
finddupe_11.ps1
function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.MD5CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.OpenRead(); $hashByteArray = $hashA...
combined_dataset/train/non-malicious/sample_2_11.ps1
sample_2_11.ps1
ConvertFrom-StringData @' id_tsremoteconfiguringmachine=Configuring %Machine% id_tsremoteconfiguringmachinepspolicy=Configuring PowerShell Execution Policy id_tsremoteerrorsettingpspolicy=Error while setting execution policy on remote system: id_tsremoterestoringmachinepspolicy=Restoring PowerShell Execution Polic...
combined_dataset/train/non-malicious/Invoke-Generic_1.ps1
Invoke-Generic_1.ps1
function Invoke-Generic { #.Synopsis # Invoke Generic method definitions via reflection: [CmdletBinding()] param( [Parameter(Position=0,Mandatory=$true,ValueFromPipelineByPropertyName=$true)] [Alias('On')] $InputObject , [Parameter(Position=1,ValueFromPipelineByPropertyName=$true)] [Alias('...
combined_dataset/train/non-malicious/sample_51_0.ps1
sample_51_0.ps1
Signature-Version: 1.0 Created-By: 11.0.13 (International Business Machines Corporation) SHA-256-Digest-Manifest: 1r6sitbUID2Wk9qANTvzkSRdE1C0u8H5SYwpkSsK1SE= SHA-256-Digest-Manifest-Main-Attributes: UgUYpdBq2W5RtR37SvPaUbQcstMFVhI EeY5uarlBPSI= Name: plugin.xml SHA-256-Digest: HS4k5kzk7m0pjUQJvLR9k++EVmv2eb/w...
combined_dataset/train/non-malicious/sample_61_29.ps1
sample_61_29.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/2523.ps1
2523.ps1
$wc = new-object net.webclient $js = $wc.DownloadString('http://www.quotedb.com/quote/quote.php?action=random_quote&=&=&') function strip-html([string] $str) { $val = $str -replace '<[^>]+>', '' $val = $val -replace '`', "'" return $val } function next-word([string] $text, [int] $start) { $end = $start ...
combined_dataset/train/non-malicious/sample_10_35.ps1
sample_10_35.ps1
ConvertFrom-StringData @' id_tcpipsettingscheck=Checking for KB 967224 id_tcpipsettingscheckdesc=Checking for modified TcpIp Reg Parameters '@ # SIG # Begin signature block # MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX...
combined_dataset/train/non-malicious/sample_57_46.ps1
sample_57_46.ps1
# Localized 06/28/2023 08:21 AM (GMT) 303:7.0.30723 rs_resetidledisktimeout.psd1 ConvertFrom-StringData @' ###PSLOC reset_DiskIdleTimeout=Rétablissement du délai d’inactivité du disque Report_name_DiskIdleTimeout_AC_result=Résultat du rétablissement du délai d’inactivité du disque pour le courant alternatif Repor...
combined_dataset/train/non-malicious/Download File (with %).ps1
Download File (with %).ps1
<# .SYNOPSIS Downloads a file showing the progress of the download .DESCRIPTION This Script will download a file locally while showing the progress of the download .EXAMPLE .\\Download-File.ps1 'http:\\\\someurl.com\\somefile.zip' .EXAMPLE .\\Download-File.ps1 'http:\\\\someurl.com\\somefile.z...
combined_dataset/train/non-malicious/Get-SqlWmi.ps1
Get-SqlWmi.ps1
try {add-type -AssemblyName "Microsoft.SqlServer.SqlWmiManagement, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop} catch {add-type -AssemblyName "Microsoft.SqlServer.SqlWmiManagement"} ####################### <# .SYNOPSIS Gets SQL Server WMI information. .DESCRIPTION The Get-SqlWm...
combined_dataset/train/non-malicious/722.ps1
722.ps1
function Out-RsCatalogItem { [CmdletBinding()] param ( [Alias('ItemPath', 'Path', 'RsFolder')] [Parameter(Mandatory = $True, ValueFromPipeline = $true)] [string[]] $RsItem, [ValidateScript({ Test-Path $_ -PathType Container})] [Parameter(Mandator...
combined_dataset/train/non-malicious/sample_61_18.ps1
sample_61_18.ps1
# # Module manifest for module 'OCI.PSModules.Dts' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dts.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/SqlProxy_4.psm1.ps1
SqlProxy_4.psm1.ps1
# --------------------------------------------------------------------------- ### <Author> ### Chad Miller ### </Author> ### <Description> ### Based on functions in SQLPSX. SqlProxy.psm1 module is used for administering ### SQL Server logins, users, and roles. Designed to be used with PS Remoting. ### All actio...
combined_dataset/train/non-malicious/1019.ps1
1019.ps1
$subscriptionId = "<Enter Azure subscription ID here>" $labResourceGroup = "<Enter lab's resource name here>" $labName = "<Enter lab name here>" $userDisplayName = "<Enter user's display name here>" Login-AzAccount Select-AzSubscription -SubscriptionId $subscriptionId $adObject = Get-AzADUser -SearchString $use...
combined_dataset/train/non-malicious/sample_20_54.ps1
sample_20_54.ps1
# # Module manifest for module 'Microsoft.SME.RolesFeatures' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.RolesFeatures.psm1' # Version number of this module. ModuleVersion = '4.13.0' # Supported PSEditions # CompatiblePSEditions = @() # ID us...
combined_dataset/train/non-malicious/1951.ps1
1951.ps1
Describe "New-Guid" -Tags "CI" { It "returns a new guid" { $guid = New-Guid $guid | Should -BeOfType System.Guid } It "should not be all zeros" { $guid = New-Guid $guid.ToString() | Should -Not -BeExactly "00000000-0000-0000-0000-000000000000" } It "should return...
combined_dataset/train/non-malicious/Move-Mailbox _2.ps1
Move-Mailbox _2.ps1
param( #distribution group holding usermailbox(es) [string] $DistGroup = "XC2010Move", #move requests per batch/script run [int] $BatchCount = 5 ) #remove user(s) without mailbox Get-DistributionGroupMember $DistGroup | get-user -Filter {Recipienttype -eq "User"} -EA SilentlyContinue | Remove-DistributionGrou...
combined_dataset/train/non-malicious/sample_13_38.ps1
sample_13_38.ps1
#************************************************ # TS_NetworkDTCEnabled.ps1 # Version 1.0.0 # Date: 03-23-2012 # Author: Jeremy LaBorde - jlaborde # Description: Checks to see if Network DTC # is enabled # #************************************************ . .\DistSvcs_Utils.ps1 Import-LocalizedData -B...
combined_dataset/train/non-malicious/sample_2_20.ps1
sample_2_20.ps1
# File DC_RegistryStorage.ps1 # Copyright 2020, Microsoft Corporation. All rights reserved. Import-LocalizedData -BindingVariable UtilsRegistrySetupPerf $OutputFile= $Computername + "_reg_MountedDevices.TXT" RegQuery -RegistryKeys "HKLM\System\MountedDevices" -OutputFile $OutputFile -fileDescription "MountedDev...
combined_dataset/train/non-malicious/4420.ps1
4420.ps1
function Update-Script { [CmdletBinding(SupportsShouldProcess = $true, HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=619787')] Param ( [Parameter(ValueFromPipelineByPropertyName = $true, Position = 0)] [ValidateNotNullOrEmpty()] [String[]] $Name,...
combined_dataset/train/non-malicious/Make a phone call_1.ps1
Make a phone call_1.ps1
<# .NOTES AUTHOR: Sunny Chakraborty(sunnyc7@gmail.com) WEBSITE: http://tekout.wordpress.com VERSION: 0.1 CREATED: 17th April, 2012 LASTEDIT: 17th April, 2012 Requires: PowerShell v2 or better .CHANGELOG 4/17/2012 Try passing powershell objects to PROTO API and pass the variables to .JS file P...
combined_dataset/train/non-malicious/942.ps1
942.ps1
$resourceGroupName = "myResourceGroup" $accountName = "mycosmosaccount" $account = Get-AzResource -ResourceType "Microsoft.DocumentDb/databaseAccounts" ` -ApiVersion "2015-04-08" -ResourceGroupName $resourceGroupName ` -Name $accountName $locations = @( @{ "locationName"="West US 2"; "failoverPriority"=0...
combined_dataset/train/non-malicious/sample_33_13.ps1
sample_33_13.ps1
# # Module manifest for module 'OCI.PSModules.Osubusage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osubusage.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_26_25.ps1
sample_26_25.ps1
# # Module manifest for module 'OCI.PSModules.Capacitymanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Capacitymanagement.dll' # Version number of this module. ModuleVersion = '82.0.0' # Suppo...
combined_dataset/train/non-malicious/sample_11_26.ps1
sample_11_26.ps1
#************************************************ # TS_ServicingPendingXml.ps1 # Version 1.0.1 # Date: 6/6/2012 # Author: v-alyao # Description: [Idea ID 3472] [Windows] Pending Transactions Rule Idea - Pending.xml # Rule number: 3472 # Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.a...
combined_dataset/train/non-malicious/9.ps1
9.ps1
function Get-GitDirectory { $pathInfo = Microsoft.PowerShell.Management\Get-Location if (!$pathInfo -or ($pathInfo.Provider.Name -ne 'FileSystem')) { $null } elseif ($Env:GIT_DIR) { $Env:GIT_DIR -replace '\\|/', [System.IO.Path]::DirectorySeparatorChar } else { $curre...
combined_dataset/train/non-malicious/sample_12_26.ps1
sample_12_26.ps1
#************************************************ # TS_WMIHandleLeakKB2639077.ps1 # Version 1.0.1 # Date: 7/19/2013 # Author: v-kaw # Description: [KSE Rule] [ Windows V3] Handle leak in Svchost.exe when a WMI query is triggered by using the Win32_PowerSettingCapabilities # Rule number: 5c139a00-370c-4d1c-a929-...
combined_dataset/train/non-malicious/349.ps1
349.ps1
function Register-PSFFeature { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [string] $Name, [string] $Description, [switch] $NotGlobal, [switch] $NotModuleSpecific, [string] $Owner = (Get-PSCallStack)[1].InvocationInfo.MyCommand.ModuleName ) begin { $featureObject...
combined_dataset/train/non-malicious/367.ps1
367.ps1
function Export-PSFClixml { [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Export-PSFClixml')] param ( [Parameter(Mandatory = $true, Position = 0)] [string] $Path, [int] $Depth, [Parameter(ValueFromPipeline = $true)] $InputObject, [PSFramework.Serializat...
combined_dataset/train/non-malicious/4161.ps1
4161.ps1
Import-Module "D:\Program Files\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1" function Get-Updates { param ([String]$Architecture, [String]$OperatingSystem, [String]$Namespace, $Updates ) $Updates = @() $Updates = Get-WmiObject -Class SMS_SoftwareUpdate -Namespace $Namespace $Upd...
combined_dataset/train/non-malicious/sample_49_35.ps1
sample_49_35.ps1
# # Module manifest for module 'OCI.PSModules.Cloudbridge' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Cloudbridge.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/58fc59d6-61a1-47e9-8c5f-1b9b9d17a727.ps1
58fc59d6-61a1-47e9-8c5f-1b9b9d17a727.ps1
#PrinterChecking Script By Henrik Pedersen Ċmark and Daniel Lundgren #This script is designed to check what printers that is still in use. #It's assumed the printer is classed as inactive if it hasnt been used in X months #The script is reading the Systemlog on a printserver of your choice, the one you type in the...
combined_dataset/train/non-malicious/sample_54_95.ps1
sample_54_95.ps1
<# .SYNOPSIS SyncShare.psd1 file This is a place-holder module file only for agent patch build purposes #> Write-Host "This module functionality is deprecated and is place-holder only" # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEE...
combined_dataset/train/non-malicious/sample_59_28.ps1
sample_59_28.ps1
# # Module manifest for module 'OCI.PSModules.Autoscaling' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Autoscaling.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_32_9.ps1
sample_32_9.ps1
/////////////////////////////////////////////////////////////////////////////// // Constants // MUST be kept in sync with the constants used in TreDesigner /////////////////////////////////////////////////////////////////////////////// var kOrthographicCameraUniqueId = "Microsoft.VisualStudio.3D.OrthographicCamer...
combined_dataset/train/non-malicious/1593.ps1
1593.ps1
$DebugPreference = "SilentlyContinue" $UserName = (Get-Item Env:\USERNAME).Value $origComputerName = (Get-Item Env:\COMPUTERNAME).Value $ComputerName = Read-Host 'What is the computer name?' $FileName = (Join-Path -Path ((Get-ChildItem Env:\USERPROFILE).value) -ChildPath $ComputerName) + ".html" $style = @" ...
combined_dataset/train/non-malicious/1630.ps1
1630.ps1
function Get-PrinterHosts { Param ( [string]$comp = $env:COMPUTERNAME ) if (!$comp) { throw 'No comps.' } $ping = New-Object System.Net.NetworkInformation.Ping try { $result = $ping.Send($comp) } catch { $result = $null } if ($result.Status -eq 'Su...
combined_dataset/train/non-malicious/3663.ps1
3663.ps1
function Test-CreateDatabase { Test-CreateDatabaseInternal "Southeast Asia" } function Test-CreateDatabaseInternal ($location = "westcentralus") { $rg = Create-ResourceGroupForTest $server = Create-ServerForTest $rg $location try { $databaseName = Get-DatabaseName $job1 = New-AzSqlDataba...
combined_dataset/train/non-malicious/sample_33_99.ps1
sample_33_99.ps1
# # Module manifest for module 'OCI.PSModules.Queue' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Queue.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/3702.ps1
3702.ps1
function Get-AzVMGuestPolicyStatusHistory-VmNameScope { $rgName = "aashishGoodPolicy" $vmName = "aashishvm1" $historicalStatuses = Get-AzVMGuestPolicyStatusHistory -ResourceGroupName $rgName -VMName $vmName Assert-NotNull $historicalStatuses Assert-True { $historicalStatuses.Count -gt 0 } } fu...
combined_dataset/train/non-malicious/sample_22_30.ps1
sample_22_30.ps1
account-settings-title = Настройки за удостоверяване account-channel-title = Подразбирани канали chat-autologin = .label = Вписване при пускане chat-encryption-generic = Общо chat-encryption-log = .label = Включете шифровани от край до край съобщения в регистрационните файлове на разговорите chat-encryption-la...
combined_dataset/train/non-malicious/sample_10_54.ps1
sample_10_54.ps1
ConvertFrom-StringData @' id_appliedsectemploutput=Applied Security Templates id_appliedsectemplobtaining=Gathering applied security templates '@ # SIG # Begin signature block # MIIoVAYJKoZIhvcNAQcCoIIoRTCCKEECAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG #...
combined_dataset/train/non-malicious/3333.ps1
3333.ps1
function Get-Role { [PoshBot.BotCommand( Aliases = ('gr', 'getrole'), Permissions = 'view-role' )] [cmdletbinding()] param( [parameter(Mandatory)] $Bot, [parameter(Position = 0)] [string]$Name ) if ($PSBoundParameters.ContainsKey('Name')) {...
combined_dataset/train/non-malicious/chkhash_1.ps1
chkhash_1.ps1
# calculate SHA512 of file. function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.Open...
combined_dataset/train/non-malicious/sample_29_49.ps1
sample_29_49.ps1
# Localized 06/28/2023 07:56 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1 ConvertFrom-StringData @' ###PSLOC Troubleshoot_Title=Rozwiązywanie problemów Troubleshoot_DetectNetworkCache=Trwa sprawdzanie sieciowej pamięci podręcznej programu Windows Media Player... Resolution_Title=Rozwiązanie Resolution_ResetCo...
combined_dataset/train/non-malicious/sample_19_41.ps1
sample_19_41.ps1
--- parameters: - name: version type: string default: '' - name: version_prefix type: string default: '' - name: draft type: boolean default: false - name: working_directory type: string default: $(Build.SourcesDirectory) - name: gh_token type: string - name: repo type: string default: $(Buil...
combined_dataset/train/non-malicious/571.ps1
571.ps1
function Add-SPONoteFieldtoList { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string] $listTitle, [Parameter(Mandatory=$true, Position=2)] [string] $fieldName ) $newField = "<Field Type='Note' DisplayName='$fieldName' Name='$fieldName' required='FALSE' NumLines='6' RichTe...
combined_dataset/train/non-malicious/sample_11_74.ps1
sample_11_74.ps1
@{ GUID="A1DA990A-4DC2-4f7e-BEB4-046A89B9D473" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="© Microsoft Corporation. All rights reserved." ModuleVersion = "2.0.0.0" PowerShellVersion = "3.0" ClrVersion = "4.0" TypesToProcess="Microsoft.Iscsi.Targe...
combined_dataset/train/non-malicious/sample_39_19.ps1
sample_39_19.ps1
[CmdletBinding()] param ( [string]$OutFile, [string]$AltDownload, [string]$Proxy, [string]$AltHisEndpoint ) $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' $refVersion = [version] '4.5' $provider = 'Microsoft.HybridCompute' # Error codes used by azcmagent are ...
combined_dataset/train/non-malicious/sample_35_88.ps1
sample_35_88.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 = '83.2.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/62.ps1
62.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/Send-Growl _3.0.ps1
Send-Growl _3.0.ps1
## This is the first version of a Growl module (just dot-source to use in PowerShell 1.0) ## v 1.0 supports a very simple notice, and no callbacks ## v 2.0 supports registering multiple message types ## supports callbacks ## v 2.1 redesigned to be a module used from apps, rather than it's own "PowerGrowler" a...
combined_dataset/train/non-malicious/2853.ps1
2853.ps1
function Invoke-psake { [CmdletBinding()] param( [Parameter(Position = 0, Mandatory = $false)] [string]$buildFile, [Parameter(Position = 1, Mandatory = $false)] [string[]]$taskList = @(), [Parameter(Position = 2, Mandatory = $false)] [string]$framework, ...
combined_dataset/train/non-malicious/sample_60_82.ps1
sample_60_82.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/2729.ps1
2729.ps1
$ErrorActionPreference = "SilentlyContinue" $o = "" | Select-Object IISInstalled if ((Get-ItemProperty HKLM:\Software\Microsoft\InetStp\Components\).W3SVC) { $o.IISInstalled = "True" } else { $o.IISInstalled = "False" } $o
combined_dataset/train/non-malicious/sample_47_1.ps1
sample_47_1.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# PowerShell Diagnostics Module This module contains a set of wrapper scripts that enable a user to use ETW tracing in Windows PowerShell. #> $script:Logman="$env:windir\system32\logman.exe" $script:wsmanlogfile = "$env:wind...
combined_dataset/train/non-malicious/Compare 2 foldertrees_1.ps1
Compare 2 foldertrees_1.ps1
function Compare-Foldertrees { param( $path1, $path2 ) $len1 = $path1.length $len2 = $path2.length . Require-function Get-MD5 Write-Host "====== First path only =======`n" gci $path1 -rec | ? {! $_.PSISContainer} | % { $fileName1 = $_.fullN...
combined_dataset/train/non-malicious/sample_20_55.ps1
sample_20_55.ps1
$resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent # Import localization helper functions. $helperName = 'PowerShellGet.LocalizationHelper' $dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1" Import-Module -Name $...
combined_dataset/train/non-malicious/2261.ps1
2261.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true)] $DriveLetter, [parameter(Mandatory=$true)] $FolderName ) Begin { } Process { $FolderStructure = @( "$($DriveLetter)\$($FolderName)", "$($DriveLetter)\$($FolderName)\Apps", "$($DriveLetter)\$($Fol...
combined_dataset/train/non-malicious/sample_15_22.ps1
sample_15_22.ps1
$ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest $script:GCInstallPath = "$PSScriptRoot\..\..\.." $script:GCBinariesFolderName = "GC" $script:GCBinariesPath = Join-Path $script:GCInstallPath $script:GCBinariesFolderName $script:CleanupExePath = Join-Path $script:GCBinariesPath "em_extension_cleanup...
combined_dataset/train/non-malicious/Write-Indented.ps1
Write-Indented.ps1
function Write-Host { #.Synopsis # Wraps Write-Host with support for indenting based on stack depth. #.Description # This Write-Host cmdlet customizes output. You can indent the text using PadIndent, or indent based on stack depth using AutoIndent or by setting the global variable $WriteHostAutoIndent = $true. #...
combined_dataset/train/non-malicious/sample_61_92.ps1
sample_61_92.ps1
<# : batch portion @REM ---------------------------------------------------------------------------- @REM Licensed to the Apache Software Foundation (ASF) under one @REM or more contributor license agreements. See the NOTICE file @REM distributed with this work for additional information @REM regarding copyright owner...
combined_dataset/train/non-malicious/sample_29_33.ps1
sample_29_33.ps1
Import-LocalizedData -BindingVariable locSbeTxt -FileName AzStackHci.SBEHealth.Strings.psd1 function Copy-SBEContentLocalToNode { [CmdletBinding()] param ( [Parameter(Mandatory=$true)] [string]$PackagePath, [Parameter(Mandatory=$true)] [string]$TargetNodeName, ...
combined_dataset/train/non-malicious/Get-OnlineHelp.ps1
Get-OnlineHelp.ps1
## This is a VERY EARLY prototype of a function that could retrieve cmdlet help from TechNet ... ## and hypothetically, other online help sites which used the same format (none) # REQUIRES the HttpRest module, to convert XHTML to XML (Uses Get-WebPageContent below) # Otherwise I'm getting 503 errors when trying ...
combined_dataset/train/non-malicious/Install-Solarized.ps1
Install-Solarized.ps1
param($Path = "~\\AppData\\Roaming\\Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\TaskBar\\Windows PowerShell.lnk" ) # SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB # --------- ------- ---- ------- ----------- ---------- ----------- ----------- # base03 #002b36 8/4 brblack ...
combined_dataset/train/non-malicious/New-Activity.ps1
New-Activity.ps1
# # By Adam Driscoll # This is very much a test function to see if this was possible. There was no polishing done. Please visit # http://csharpening.net/?p=867 for more information. # function global:Test-IsCommonParameter { param ( $Parameter ) 'WhatIf','Confirm','UseTra...
combined_dataset/train/non-malicious/1492.ps1
1492.ps1
function Remove-ItemWithRetry($item, [Switch]$Recurse) { if( -not (Test-Path $item) ) { return } $RecurseParam = if( $Recurse ) { '-Recurse' } else { '' } $numTries = 0 do { if( -not (Test-Path $item) ) { return $true } ...
combined_dataset/train/non-malicious/122.ps1
122.ps1
function Get-AuthToken { [cmdletbinding()] param ( [Parameter(Mandatory=$true)] $User ) $userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User $tenant = $userUpn.Host Write-Host "Checking for AzureAD module..." $AadModule = Get-Module -Name "AzureAD" -ListAvailable if ($Aa...