full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_65_26.ps1
sample_65_26.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/CertMgmt pack_4.ps1
CertMgmt pack_4.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/connect-domain.ps1
connect-domain.ps1
function connect-domain_X { BEGIN {$foregroundcolor= (get-host).ui.rawui.get_foregroundcolor() Write-Host ""; "---------------------------------" ; "Entering Nested Prompt for Quest connection to DOMAIN_X."; "Type `"Exit`" when finished."; "---------------------------------" ; "" ...
combined_dataset/train/non-malicious/1269.ps1
1269.ps1
function Get-CHttpUrlAcl { [CmdletBinding(DefaultParameterSetName='AllUrls')] [OutputType([Carbon.Security.HttpUrlSecurity])] param( [Parameter(ParameterSetName='ByWildcardUrl')] [string] $Url, [Parameter(ParameterSetName='ByLiteralUrl')] ...
combined_dataset/train/non-malicious/Memory helper functions.ps1
Memory helper functions.ps1
Function Add-SessionVariable() { param ([string[]]$VariableName=$null) [string[]]$VariableNames = [AppDomain]::CurrentDomain.GetData('Variable') $VariableNames += $VariableName if ($input) { $VariableNames += $input } #To Not Waste Space, Remove Duplicates $VariableNames = $VariableNames | ...
combined_dataset/train/non-malicious/sample_0_47.ps1
sample_0_47.ps1
# *********************************************************************************************************** # Version 1.0 # Date: 03-01-2012 # Author: Vinay Pamnani - vinpa@microsoft.com # Description: # Collects Configuration Manager SQL Server Information. # *************************************************...
combined_dataset/train/non-malicious/2548.ps1
2548.ps1
function Import-Excel { [CmdletBinding()] Param([Parameter(Mandatory=$true,ValueFromPipeline=$true)][string]$Path, [Parameter(Mandatory=$false)][switch]$NoHeaders ) $Path = if([IO.Path]::IsPathRooted($Path)){$Path}else{Join-Path -Path (Get-Location) -ChildPath $Path} if(!(T...
combined_dataset/train/non-malicious/sample_45_79.ps1
sample_45_79.ps1
# # Script module for module 'Az.IotHub' that is executed when 'Az.IotHub' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 05/16/2024 06:33:07 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try { i...
combined_dataset/train/non-malicious/sample_9_40.ps1
sample_9_40.ps1
#************************************************ # TS_DCDiag.ps1 # Version 1.0.1 # Date: 09-23-2009 # Author : Andre Teixeira/ David Fisher (CSS)/ Craig Landis # Description: Obtain DCPromo and DCPromoUI logs #************************************************ if($debug -eq $true){[void]$shell.popup("Run DC...
combined_dataset/train/non-malicious/sample_23_27.ps1
sample_23_27.ps1
# # Module manifest for module 'OCI.PSModules.Sch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Sch.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/JSON 1.4.ps1
JSON 1.4.ps1
#requires -version 2.0 # Version History: # v 0.5 - First Public version # v 1.0 - Made ConvertFrom-Json work with arbitrary JSON # - switched to xsl style sheets for ConvertTo-JSON # v 1.1 - Changed ConvertFrom-Json to handle single item results # v 1.2 - CodeSigned to make a fellow geek happy # v 1.3 - ...
combined_dataset/train/non-malicious/461.ps1
461.ps1
Set-PSFConfig -Module PSFramework -Name 'Runspace.StopTimeoutSeconds' -Value 30 -Initialize -Validation "integerpositive" -Handler { [PSFramework.Runspace.RunspaceHost]::StopTimeoutSeconds = $args[0] } -Description "Time in seconds that Stop-PSFRunspace will wait for a scriptspace to selfterminate before killing it."
combined_dataset/train/non-malicious/sample_24_91.ps1
sample_24_91.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/2667.ps1
2667.ps1
cls Import-Module b:\PnPPowerShell\V16\OfficeDevPnP.PowerShell.Commands.dll Import-Module "C:\Program Files (x86)\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.PowerShell.dll" $outputFile = "<output file location>" $site = "<site url>" ...
combined_dataset/train/non-malicious/sample_2_28.ps1
sample_2_28.ps1
# # Module manifest for module 'OCI.PSModules.Marketplaceprivateoffer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Marketplaceprivateoffer.dll' # Version number of this module. ModuleVersion = '92.1.0...
combined_dataset/train/non-malicious/Bootstrap psake w_ PsGet.ps1
Bootstrap psake w_ PsGet.ps1
function Get-MyModule { param ([string] $name) write-host "Is '$name' already imported? " -NoNewline -ForegroundColor Cyan if (-not(Get-Module -name $name)) { write-host "No." -ForegroundColor Red write-host "Can we import '$name'? " -NoNewline if (Get-Module -ListAvailable | W...
combined_dataset/train/non-malicious/1389.ps1
1389.ps1
function Test-CPermission { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Path, [Parameter(Mandatory=$true)] [string] $Identity, [Parameter(Mandatory=$true)] [string[]] $P...
combined_dataset/train/non-malicious/2092.ps1
2092.ps1
Describe 'Tests for indexers' -Tags "CI" { It 'Indexer in dictionary' { $hashtable = @{ "Hello"="There" } $hashtable["Hello"] | Should -BeExactly "There" } It 'Accessing a Indexed property of a dictionary that does not exist should return $NULL' { $hashtable = @{ "Hello"="There" ...
combined_dataset/train/non-malicious/3946.ps1
3946.ps1
function Test-DnsAvailability { $domainQualifiedName = Get-ResourceName $resourceTypeParent = "Microsoft.Network/publicIPAddresses" $location = Get-ProviderLocation $resourceTypeParent $checkdnsavailability = Test-AzDnsAvailability -Location "westus" -DomainQualifiedName $domai...
combined_dataset/train/non-malicious/sample_42_38.ps1
sample_42_38.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 = '73.1.0' # Supported PSEdi...
combined_dataset/train/non-malicious/661.ps1
661.ps1
Describe "Write-RsFolderContent" { Context "Write-RsFolderContent with min parameters" { $folderName = 'SutWriteRsFolderContentMinParameters' + [guid]::NewGuid() New-RsFolder -Path / -FolderName $folderName $folderPath = '/' + $folderName $localReportPath = (Get-Item -Path ".\")....
combined_dataset/train/non-malicious/SearchZIP.psm1 Module Fi.ps1
SearchZIP.psm1 Module Fi.ps1
function SearchZIPfiles { <# .SYNOPSIS Search for (filename) strings inside compressed ZIP or RAR files. .DESCRIPTION In any directory containing a large number of ZIP/RAR compressed Web Page files this procedure will search each individual file name for simple text strings, listing both the source RAR/ZIP fi...
combined_dataset/train/non-malicious/2512.ps1
2512.ps1
$ColHeaders = ("SQLServer", "DBName", "addl_loan_data", "appraisal", "borrower", "br_address", "br_expense", "br_income", "br_liability", "br_REO", "channels", "codes", "customer_elements", "funding", "inst_channel_assoc", "institution", "institution_association", "loan_appl", "loan_fees", "loan...
combined_dataset/train/non-malicious/4378.ps1
4378.ps1
function New-NugetPackage { [CmdletBinding()] Param( [Parameter(Mandatory = $true)] [string]$NuspecPath, [Parameter(Mandatory = $true)] [string]$NugetPackageRoot, [Parameter()] [string]$OutputPath = $NugetPackageRoot, [Parameter(Mandatory = $true, Param...
combined_dataset/train/non-malicious/sample_37_38.ps1
sample_37_38.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ##############################################################>...
combined_dataset/train/non-malicious/sample_10_22.ps1
sample_10_22.ps1
# To check useKernelMode and useAppPoolCredentials For IIS 7 # support.microsoft.com/kb/2536453 # Kernel mode authentication within IIS is disabled for the Microsoft Dynamics CRM website in IIS 7.0 and 7.5 # # Created: 3/23/2012 # Author: Jonathan Randall #*********************************************************...
combined_dataset/train/non-malicious/sample_5_52.ps1
sample_5_52.ps1
#************************************************ # DC_BitsServer-Component.ps1 # Version 1.0 # Date: 2009 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about the BITS Server Component. #******************************************************* Trap [Exception] { # Handle...
combined_dataset/train/non-malicious/sample_49_18.ps1
sample_49_18.ps1
[KillbotsRuleset] Name=Killbots Name[ar]=معركة الآليين Name[bs]=Ubij botove Name[ca]=Killbots Name[ca@valencia]=Killbots Name[cs]=Killbots Name[da]=Killbots Name[de]=Killbots Name[el]=Killbots Name[en_GB]=Killbots Name[eo]=Killbots Name[es]=Killbots Name[et]=Killbots Name[eu]=Killbots Name[fi]=Killbots Name[fr]=Killbot...
combined_dataset/train/non-malicious/Copy files _1.ps1
Copy files _1.ps1
cls <# Writer: Ritesh P. #> # Core Declaration $date = ((get-date).toString('MM-dd-yyyy')) $time = ((Get-Date).toString('HH-mm-ss')) #$what = "/COPYALL /S /B" #$options = "/R:0 /W:0 /FP" $NewDestinationPath = '\\\\'+'infra'+'\\c$\\data1\\'+$date+'-'+$time # When I add $time to create Destination f...
combined_dataset/train/non-malicious/sample_29_32.ps1
sample_29_32.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 = '82.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_10_63.ps1
sample_10_63.ps1
ConvertFrom-StringData @' id_mats_networkadapter=Network Adapter id_mats_networkadaptertype=Type id_mats_networkadapterspeed=Speed id_mats_ipaddresses=IP Addresses id_mats_defaultgateway=Default Gateway id_mats_dnsservers=DNS Servers id_mats_proxyenabled=Proxy Server id_enabled=Enabled id_mats_proxyserveradd=P...
combined_dataset/train/non-malicious/sample_30_30.ps1
sample_30_30.ps1
# # Module manifest for module 'OCI.PSModules.Redis' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Redis.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_41_66.ps1
sample_41_66.ps1
function Initialize-AzDataProtectionBackupInstance { [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBackupInstanceResource')] [CmdletBinding(PositionalBinding=$false)] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Initializes Backup instance Req...
combined_dataset/train/non-malicious/Set-KeepAliveTime_1.ps1
Set-KeepAliveTime_1.ps1
<# .SYNOPSIS Change the setting for TCPIP KeepAliveTime on a server or several servers. .DESCRIPTION Change the setting for TCPIP KeepAliveTime on a server or several servers. When moving mailboxes with lar...
combined_dataset/train/non-malicious/Script-Object_1.ps1
Script-Object_1.ps1
#Copyright (c) 2011 Justin Dearing # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, publish, dist...
combined_dataset/train/non-malicious/3865.ps1
3865.ps1
function Test-GetLocationKindDirect { try { $asn = 65000 $asnPeerName = makePeerAsn $asn $location = Get-AzPeeringLocation -Kind Direct Assert-NotNull $location Assert-True { $location.Count -gt 30 } } finally { Remove-AzPeerAsn -Name $asnPeerNa...
combined_dataset/train/non-malicious/Show-ADObject.ps1
Show-ADObject.ps1
# Author: Steven Murawski http://www.mindofroot.com # This script requires the modified Show-NetMap script (originally from Doug Finke) # Show-NodeXLMap which can be found on http://poshcode.org/733 # and the NodeXL files # These can be found at http://www.codeplex.com/NodeXL/Release/ProjectReleases.aspx?ReleaseId=...
combined_dataset/train/non-malicious/101.ps1
101.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 ($A...
combined_dataset/train/non-malicious/sample_49_96.ps1
sample_49_96.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 = '80.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/481.ps1
481.ps1
function Update-ScheduledTask{ param( [Parameter(Position=0, Mandatory=$false)] $Name, [switch] $All ) if(-not ($All -or $Name)){ throw "Provide at least one parameter for this function." } function Get-WindowsScheduledTasks{ ...
combined_dataset/train/non-malicious/sample_9_59.ps1
sample_9_59.ps1
ConvertFrom-StringData @' id_devcon=Information about devices and connections id_devconrunning=Gathering devices and connections information (devcon) id_devconoutput=DevCon Output id_devconoutputdesc=Devices and connections information '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzAN...
combined_dataset/train/non-malicious/sample_11_71.ps1
sample_11_71.ps1
ConvertFrom-StringData @' id_hypervkb2263829check=Checking for KB2263829 id_hypervkb2263829checkdesc=Checking version of Hvax64.exe and other binaries '@ # SIG # Begin signature block # MIIoVAYJKoZIhvcNAQcCoIIoRTCCKEECAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE6...
combined_dataset/train/non-malicious/sample_40_80.ps1
sample_40_80.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\glob@10.3.10\node_modules\glob\dist\esm\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\glob@10....
combined_dataset/train/non-malicious/1143.ps1
1143.ps1
$username = 'CarbonRevokePrivileg' $password = 'a1b2c3d4 function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { Install-User -Username $username -Password $password -Description 'Account for testing Carbon Revoke-P...
combined_dataset/train/non-malicious/495.ps1
495.ps1
function Get-HostFileEntries{ [CmdletBinding()] param( [Parameter(Mandatory=$false)] [String] $Filter ) function New-ObjectHostFileEntry{ param( [string]$IP, [string]$DNS ) New-Object PSObject -Property @{ IP = $IP ...
combined_dataset/train/non-malicious/2046.ps1
2046.ps1
Describe "File encoding tests" -Tag CI { Context "ParameterType for parameter 'Encoding' should be 'Encoding'" { BeforeAll { $testCases = Get-Command -Module Microsoft.PowerShell.* | Where-Object { $_.Parameters -and $_.Parameters['Encoding'] } | ForEach-Object...
combined_dataset/train/non-malicious/sample_55_50.ps1
sample_55_50.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/2474.ps1
2474.ps1
function Save-AzrWebApp { [OutputType([System.IO.FileInfo])] [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$Name, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$TargetPath, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [pscredential]$Cre...
combined_dataset/train/non-malicious/Get-ProcessCount_1.ps1
Get-ProcessCount_1.ps1
# Get-ProcessCount uses 2 main variables, server and process name. # Process name is typically the end exe, such as "svchost.exe" # Will accept unnamed args (Get-ProcessCount servername processname) # or named args (Get-ProcessCount -Computer servername -Process processname) Function Get-ProcessCount([string]$proce...
combined_dataset/train/non-malicious/sample_2_97.ps1
sample_2_97.ps1
ConvertFrom-StringData @' id_printerkb2457866check=Checking for KB 2457866 id_printerkb2457866checkdesc=Checking for Event 602 on Microsoft-Windows-PrintService/Admin Event Log '@ # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3A...
combined_dataset/train/non-malicious/sample_54_46.ps1
sample_54_46.ps1
# # Module manifest for module 'OCI.PSModules.Ospgateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ospgateway.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_41_46.ps1
sample_41_46.ps1
let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl(); let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/web.eventHandlers.js"]; let currentScriptElement = document.querySelector("script[src='Scripts/web.plugin.js']"); if (currentScriptElement !== null) { scripts.for...
combined_dataset/train/non-malicious/3111.ps1
3111.ps1
function ConvertTo-Base64 { [CmdletBinding(DefaultParameterSetName='Text')] param( [Parameter( ParameterSetName='Text', Mandatory=$true, Position=0, HelpMessage='Text (command), which is to be converted to a Base64 encoded string')] [Stri...
combined_dataset/train/non-malicious/312.ps1
312.ps1
function Get-PSFLicense { [CmdletBinding(PositionalBinding = $false, HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFLicense')] [OutputType([PSFramework.License.License])] param ( [Parameter(Position = 0)] [Alias('Product')] [String] $Filter = "*", [PSFramework.License.Prod...
combined_dataset/train/non-malicious/sample_38_73.ps1
sample_38_73.ps1
######################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # Localized PSGet.Resource.psd1 # ######################################################################################### ConvertFrom-StringData @' ###PSL...
combined_dataset/train/non-malicious/sample_32_14.ps1
sample_32_14.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> [DscLocalConfigurationManager()] Configuration ...
combined_dataset/train/non-malicious/365.ps1
365.ps1
function ConvertFrom-PSFClixml { [CmdletBinding()] Param ( [Parameter(ValueFromPipeline = $true, Mandatory = $true)] $InputObject ) begin { $byteList = New-Object System.Collections.ArrayList function Convert-Item { [CmdletBinding()] param ( $Data ) if ($Data -is [System.String]...
combined_dataset/train/non-malicious/1672.ps1
1672.ps1
function ConvertTo-Bytes { param ( [string]$file ) if (!$file -or !(Test-Path $file)) { throw "file not found: '$file'" } [convert]::ToBase64String((Get-Content $file -Encoding Byte)) }
combined_dataset/train/non-malicious/3412.ps1
3412.ps1
function Test-CreateNewAppServicePlan { $rgname = Get-ResourceGroupName $whpName = Get-WebHostPlanName $location = Get-Location $capacity = 2 $skuName = "S2" try { New-AzureRmResourceGroup -Name $rgname -Location $location $createResult = New-AzureRmAppServicePlan -ResourceGroupName ...
combined_dataset/train/non-malicious/sample_0_75.ps1
sample_0_75.ps1
// ================================================================== // DCIM_SPLogsConcreteCollection // ================================================================== [dynamic, provider("dcismprovider"), Description( "DCIM_SPLogsConcreteCollection is a" "trivial derivation of CIM...
combined_dataset/train/non-malicious/2466.ps1
2466.ps1
function Validate-Xml { param ([string]$XmlFilePath) try { $XmlFile = Get-Item($XmlFilePath) $script:ErrorCount = 0 $ReaderSettings = New-Object -TypeName System.Xml.XmlReaderSettings $ReaderSettings.ValidationType = [System.Xml.ValidationType]::Schema $ReaderSettings.ValidationFlags = [Syste...
combined_dataset/train/non-malicious/SqlProxy_2.psm1.ps1
SqlProxy_2.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/Create-Certificate.ps1
Create-Certificate.ps1
##################################################################### # Create PowerShell cert.ps1 # Version 1.0 # # Creates self-signed signing certificate and install it to certificate store # # Note: Requires at least Windows Vista. Windows XP/Windows Server 2003 # are not supported. # # Vadims Podans (c) 2...
combined_dataset/train/non-malicious/sample_5_73.ps1
sample_5_73.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 = '92.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_40_33.ps1
sample_40_33.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 = '82.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_53_83.ps1
sample_53_83.ps1
param ( [string]$Workspace, [string]$Key ) $sourceLang = "EN" $headers = @{ "Ocp-Apim-Subscription-Key" = $Key; "Ocp-Apim-Subscription-Region" = "westeurope"; "Content-Type" = "application/json" } $jsonFile = Join-Path $Workspace "\Translations\Translation.json" if (Test-Path $jsonFi...
combined_dataset/train/non-malicious/15.ps1
15.ps1
try { $poshgitPath = join-path (Get-ToolsLocation) 'poshgit' $currentVersionPath = Get-ChildItem "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime | Select-Object -Last 1 if(Test-Path $PROFILE) { $oldProfile = @(Get-Content $PROFILE) . $currentVersionPath\src\Utils.ps1 ...
combined_dataset/train/non-malicious/sample_39_88.ps1
sample_39_88.ps1
$serviceName = "udcservice" $controlCommand = "211" # Construct the full path to sc.exe $system32Path = Join-Path -Path $env:SystemRoot -ChildPath 'System32' $scPath = Join-Path -Path $system32Path -ChildPath 'sc.exe' # Construct the sc.exe command $scArgs = "control $serviceName $controlCommand" # Execute...
combined_dataset/train/non-malicious/605.ps1
605.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "http://download.microsoft.com/download/D/E/0/DE02CCED-5209-49FC-9F1B-0F86D3269D4C/sharepointclientcomponents_x64.msi" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" } $Con...
combined_dataset/train/non-malicious/4417.ps1
4417.ps1
function Install-Script { [CmdletBinding(DefaultParameterSetName = 'NameParameterSet', HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=619784', SupportsShouldProcess = $true)] Param ( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ...
combined_dataset/train/non-malicious/JSON 1.2.ps1
JSON 1.2.ps1
#requires -version 2.0 # Version History: # v 0.5 - First Public version # v 1.0 - Made ConvertFrom-Json work with arbitrary JSON # - switched to xsl style sheets for ConvertTo-JSON # v 1.1 - Changed ConvertFrom-Json to handle single item results # v 1.2 - CodeSigned to make a fellow geek happy # There i...
combined_dataset/train/non-malicious/732.ps1
732.ps1
function New-RsDataSource { [cmdletbinding()] param ( [Alias('Destination', 'ItemPath', 'Path')] [Parameter(Mandatory = $True)] [string] $RsFolder, [Parameter(Mandatory = $True)] [string] $Name, [string] $Description,...
combined_dataset/train/non-malicious/LetterDiamondOneliner v_2.ps1
LetterDiamondOneliner v_2.ps1
&{param([char]$c)[int]$s=65;$p=$c-$s;$r=,(' '*$p+[char]$s);$r+=@(do{"{0,$p} {1}{0}"-f([char]++$s),(' '*$f++)}until(!--$p));$r;$r[-2..-99]}Z # trimmed 130 chars w/o arg &{param([char]$c)$p=$c-($s=65);$r=,(' '*$p+[char]$s);do{$r+="{0,$p} {1}{0}"-f([char]++$s),(' '*$f++)}until(!--$p);$r;$r[-2..-99]}J
combined_dataset/train/non-malicious/sample_27_88.ps1
sample_27_88.ps1
. $PSScriptRoot\common\pipeline-logging-functions.ps1 function Test-FilesUseTelemetryOutput { $requireTelemetryExcludeFiles = @( "enable-cross-org-publishing.ps1", "performance-setup.ps1", "retain-build.ps1" ) $filesMissingTelemetry = Get-ChildItem -File -Recurse -Path "$PSScriptRoot\co...
combined_dataset/train/non-malicious/4068.ps1
4068.ps1
[CmdletBinding()] param ( [switch]$FileOutput, [ValidateNotNullOrEmpty()][string]$FileName = 'TrustedSitesReport.txt' ) function Get-RelativePath { [CmdletBinding()][OutputType([string])] param () $Path = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent) + "\" Return $Path } $HKCU = $(get-item "HK...
combined_dataset/train/non-malicious/1053.ps1
1053.ps1
if( Test-AdminPrivilege ) { $originalTrustedHosts = $null function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { $originalTrustedHosts = @( Get-TrustedHost ) Clear-TrustedHos...
combined_dataset/train/non-malicious/Format-TablePlus_1.ps1
Format-TablePlus_1.ps1
#requires -version 2.0 ## Format-Table with wrapping and string trimming. function Format-TablePlus() { [CmdletBinding()] param( [Switch] ${AutoSize}, [Switch] ${HideTableHeaders}, [Switch] ${Wrap}, [Parameter(Position=0)] [System.Object[]] ${Property}, [System.Object...
combined_dataset/train/non-malicious/sample_44_4.ps1
sample_44_4.ps1
##------------------------------------------------------------------ ## <copyright file="ReportStatus.ps1" company="Microsoft"> ## Copyright (C) Microsoft. All rights reserved. ## </copyright> ##------------------------------------------------------------------ <# .SYNOPSIS Generate json file for reco...
combined_dataset/train/non-malicious/sample_35_4.ps1
sample_35_4.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/Beginner event 10 .ps1
Beginner event 10 .ps1
# # Summer 2009 Scripting games # Beginner Event 10 - The 1,500-Meter race # http://blogs.technet.com/heyscriptingguy/archive/2009/06/18/hey-scripting-guy-2009-scripting-games-event-10-details-beginner-and-advanced-1-500-meter-race.aspx # # ToDo: In this event, you must write a script that will count down from th...
combined_dataset/train/non-malicious/sample_59_17.ps1
sample_59_17.ps1
#This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER #EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABI...
combined_dataset/train/non-malicious/Get-DominosOrderStatus.ps1
Get-DominosOrderStatus.ps1
# Get-DominosOrderStatus.psm1 # Author: xcud.com # # Inspired by Dana Merrick's Dominos Pizza Script # http://shakti.trincoll.edu/~dmerrick/dominos.html function Get-DominosOrderStatus($phone_number) { $url = "http://trkweb.dominos.com/orderstorage/GetTrackerData?Phone=$phone_number" [xml]$content = (n...
combined_dataset/train/non-malicious/Set-ADUserRandomPassword_2.ps1
Set-ADUserRandomPassword_2.ps1
###########################################################################" # # NAME: Set-ADUserRandomPassword.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # # COMMENT: This script are used to set a random password for Active Directory users in a specified Organizational Unit. It stores th...
combined_dataset/train/non-malicious/4281.ps1
4281.ps1
function Invoke-WMIExec { [CmdletBinding()] param ( [parameter(Mandatory=$true)][String]$Target, [parameter(Mandatory=$true)][String]$Username, [parameter(Mandatory=$false)][String]$Domain, [parameter(Mandatory=$false)][String]$Command, [parameter(Mandatory=$false)][String]$Password, [parameter...
combined_dataset/train/non-malicious/sample_22_13.ps1
sample_22_13.ps1
########################################################### # # 'ExtensionService' module # ########################################################### $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest Import-Module "$PSScriptRoot\ServiceHelper.psm1" $script:GCInstallPath = "$PSScriptRoot\.....
combined_dataset/train/non-malicious/sample_60_74.ps1
sample_60_74.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> Import-Module "NetworkControllerRESTWrappers.psm...
combined_dataset/train/non-malicious/sample_50_53.ps1
sample_50_53.ps1
# # Module manifest for module 'OCI.PSModules.Osubbillingschedule' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osubbillingschedule.dll' # Version number of this module. ModuleVersion = '80.0.0' # Sup...
combined_dataset/train/non-malicious/Get-CompPartitionTable.ps1
Get-CompPartitionTable.ps1
param($computer,$instance,$database) import-module sqlps -disablenamechecking $path = "SQLSERVER:\\SQL\\$($computer)\\$($instance)\\Databases\\$($database)\\Tables" SET-LOCATION $path get-childitem | where {$_.HasCompressedPartitions -or $_.IsPartitioned} | select @{n='ServerInstance';e={"$computer\\$instance...
combined_dataset/train/non-malicious/sample_57_40.ps1
sample_57_40.ps1
# Localized 05/07/2022 06:55 AM (GMT) 303:7.0.30723 Power_Troubleshooter.psd1 ConvertFrom-StringData @' ###PSLOC Check_DisplayIdleTimeout=Ekran boşta kalma zaman aşımı süresi denetleniyor... Check_Idlesleepsetting=Boşta kalma uyku ayarı denetleniyor... Check_DiskIdleTimeout=Disk boşta kalma zaman aşımı süresi den...
combined_dataset/train/non-malicious/3978.ps1
3978.ps1
function Test-ExpressRouteBGPServiceCommunities { $communities = Get-AzBgpServiceCommunity Assert-NotNull $communities $crmOnlineCommunity = $communities | Where-Object {$_.ServiceName -match "CRMOnline"} Assert-NotNull $crmOnlineCommunity.BgpCommunities Assert-AreEqual true $crmOnlineCommunity.Bgp...
combined_dataset/train/non-malicious/Get-Credential 1.2.ps1
Get-Credential 1.2.ps1
## Get-Credential ## An improvement over the default cmdlet which has no options ... ################################################################################################### ## History ## v 1.2 Refactor ShellIds key out to a variable, and wrap lines a bit ## v 1.1 Add -Console switch and set registry v...
combined_dataset/train/non-malicious/sample_40_54.ps1
sample_40_54.ps1
## Copyright (c) Microsoft Corporation. All rights reserved. <# .SYNOPSIS This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. .DESCRIPTION This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. These performance recordings contain Microsoft-Antimal...
combined_dataset/train/non-malicious/DNS functions.ps1
DNS functions.ps1
Param ( [Parameter(Mandatory=$true, Position=1)][string] $SourceServer, [Parameter(Mandatory=$true, Position=2)][string] $SourceZone, [Parameter(Mandatory=$true, Position=3)][string] $DestinationServer, [Parameter(Mandatory=$true, Position=4)][string] $DestinationZone, [string[]] $RRtypes = @("MicrosoftDNS_AType")...
combined_dataset/train/non-malicious/sample_4_72.ps1
sample_4_72.ps1
ConvertFrom-StringData @' id_ctskerberos=Kerberos id_ctskerberosdescription=Collects information about Kerberos using the KList utility. '@ # SIG # Begin signature block # MIIoQgYJKoZIhvcNAQcCoIIoMzCCKC8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zU...
combined_dataset/train/non-malicious/sample_34_30.ps1
sample_34_30.ps1
# # Module manifest for module 'OCI.PSModules.Ons' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ons.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/1586.ps1
1586.ps1
$source = 'c:\temp\new' $files = Get-Files $source -Recurse -Method AlphaFS $drives = [io.driveinfo]::getdrives() | % {$_.name[0]} $alpha = [char[]](65..90) $avail = (diff $drives $alpha).inputobject $sourcedrive = $avail[0] + ':' $destdrive = $avail[1] + ':' $result = foreach ($file in $files) { ...
combined_dataset/train/non-malicious/sample_37_13.ps1
sample_37_13.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> $ErrorActionPreference = 'Stop' $observabilityNuget...
combined_dataset/train/non-malicious/3840.ps1
3840.ps1
function New-AzManagedServicesAssignmentWithId { [CmdletBinding()] param( [string] [Parameter()] $Scope, [string] [Parameter()] $RegistrationDefinitionResourceId, [Guid] [Parameter()] $RegistrationAssignmentId ) $profile = [Microsoft.Azure.Commands.Common.Authe...
combined_dataset/train/non-malicious/Search-Network.ps1
Search-Network.ps1
#Define PreReqs $timeStamp = Get-Date -UFormat "%m-%d-%Y-%H-%M" $systemVars = Gwmi Win32_ComputerSystem -Comp "." $userName = $systemVars.UserName $compName = $systemVars.Name #User Vars $serviceName = "Spooler" # Spooler will check the Print Spooler <<< Change To Suit Your needs $errorLog = "C:\\Temp\\Log_"+$...
combined_dataset/train/non-malicious/4168.ps1
4168.ps1
$File = "<Path to CSV file>\ProfileSizeReport.csv" $Exclusions = ("Administrator", "Default", "Public") $Profiles = Get-ChildItem -Path $env:SystemDrive"\Users" | Where-Object { $_ -notin $Exclusions } $AllProfiles = @() foreach ($Profile in $Profiles) { $object = New-Object -TypeName System.Management.Automation...