full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_41_14.ps1 | sample_41_14.ps1 |
. $PSScriptRoot\PathProcessingNonExistingPaths.ps1
. $PSScriptRoot\PathProcessingNoWildcards.ps1
. $PSScriptRoot\PathProcessingWildcards.ps1
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7... |
combined_dataset/train/non-malicious/3051.ps1 | 3051.ps1 | function Should-HaveParameter (
$ActualValue,
[String] $ParameterName,
$Type,
[String]$DefaultValue,
[Switch]$Mandatory,
[Switch]$HasArgumentCompleter,
[Switch]$Negate,
[String]$Because ) {
if ($null -eq $ActualValue -or $ActualValue -isnot [Management.Automation.CommandInfo]) ... |
combined_dataset/train/non-malicious/Install-ISPackage.ps1 | Install-ISPackage.ps1 | #######################
<#
.SYNOPSIS
Installs an SSIS package to a SQL Server store.
.DESCRIPTION
The Install-ISPackage script installs an Dtsx file to a SQL Server store using the command-line utility dtutil.
Works for 2005 and higher
.EXAMPLE
./install-ispackage.ps1 -DtsxFullName "C:\\Users\\Public\\bin\\SSIS... |
combined_dataset/train/non-malicious/New-Password 1.1.ps1 | New-Password 1.1.ps1 | #.Synopsis
# Generate pseudo-random passwords based on templates
#
#.Parameter Template
# The template for the password you want to generate. This defines which types of characters are generated for each character in the password.
# IMPORTANT: the US English alphabet is hardcoded ... (we make no apologies, but... |
combined_dataset/train/non-malicious/Send-SMSMessage.ps1 | Send-SMSMessage.ps1 | #requires -version 2
function Send-SMSMessage {
<#
.SYNOPSIS
Send a Text Message (SMS) using Microsoft Outlook
.DESCRIPTION
Sends a Text Message (SMS) using the supplied parameters.
.PARAMETER To
Telephone number to send the text message to.
.PARAMETER Message
The message to send.
.EXAMPLE
Send-SMSMessag... |
combined_dataset/train/non-malicious/3147.ps1 | 3147.ps1 | $From = ""
$To = ""
$MailServer = ""
function SendMailMessage
{
param(
[String]$Subject,
[String]$Body
)
Send-MailMessage -SmtpServer $MailServer -From $From -To $To -Subject $Subject -Body $Body
}
|
combined_dataset/train/non-malicious/sample_53_54.ps1 | sample_53_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Networkloadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Networkloadbalancer.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Sup... |
combined_dataset/train/non-malicious/Start-Verify_2.ps1 | Start-Verify_2.ps1 | # Author: Steven Murawski http://www.mindofroot.com
# This script creates two functions (and a helper function). One starts logging all commands entered,
# and the second removes the logging.
# This script is similar to the Start-Transcript, but only logs the command line and not the output.
# Modified to add ... |
combined_dataset/train/non-malicious/sample_49_31.ps1 | sample_49_31.ps1 | # SharePoint references that need to remove when uninstall
$ReferencesToRemoveWhenUninstall = @(
@("System.IdentityModel.Tokens.Jwt"),
@("Microsoft.IdentityModel.Tokens")
)
# SharePoint references that need to be copy local
$CopyLocalReferences = @(
@("System.IdentityModel.Tokens.Jwt"),
@("Mic... |
combined_dataset/train/non-malicious/3449.ps1 | 3449.ps1 |
function Test-GetNonExistingDataFactoryGateway
{
$dfname = Get-DataFactoryName
$rgname = Get-ResourceGroupName
$rglocation = Get-ProviderLocation ResourceManagement
New-AzResourceGroup -Name $rgname -Location $rglocation -Force
New-AzDataFactory -Name $dfname -Location $rglocati... |
combined_dataset/train/non-malicious/3280.ps1 | 3280.ps1 |
$platform = 'linux'
Add-Type -Path "$ModulePath/lib/$platform/Microsoft.Azure.Amqp.dll"
Add-Type -Path "$ModulePath/lib/$platform/Microsoft.Azure.ServiceBus.dll"
$receiver = [Microsoft.Azure.ServiceBus.Core.MessageReceiver]::new(
$connectionString,
$QueueName,
[Microsoft.Azure.ServiceBus.ReceiveMode]::Pe... |
combined_dataset/train/non-malicious/sample_48_87.ps1 | sample_48_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 = '81.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_37_94.ps1 | sample_37_94.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/sample_27_17.ps1 | sample_27_17.ps1 | #
# Module manifest for module 'OCI.PSModules.Emwarehouse'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emwarehouse.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/1307.ps1 | 1307.ps1 |
function Invoke-CPowerShell
{
[CmdletBinding(DefaultParameterSetName='ScriptBlock')]
param(
[Parameter(Mandatory=$true,ParameterSetName='ScriptBlock')]
[ScriptBlock]
$ScriptBlock,
[Parameter(Mandatory=$true,ParameterSetName='Command')]
[object]
... |
combined_dataset/train/non-malicious/PS2WCF_7.ps1 | PS2WCF_7.ps1 | <#
.SYNOPSIS
Functions to call WCF Services With PowerShell.
.NOTES
Version 1.2 11.02.2012
Requires Powershell v2 and .NET 3.5
Copyright (c) 2008 Christian Glessner
Copyright (c) 2012 Justin Dearing
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software an... |
combined_dataset/train/non-malicious/sample_21_17.ps1 | sample_21_17.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/New-Choice_1.ps1 | New-Choice_1.ps1 |
function New-Choice {
<#
.SYNOPSIS
The New-Choice function is used to provide extended control to a script author who writing code
that will prompt a user for information.
.PARAMETER Choices
An Array of Choices, ie Yes, No and Maybe
.PARAMETER Caption
Caption to present to end user
... |
combined_dataset/train/non-malicious/1888.ps1 | 1888.ps1 |
Describe "Object cmdlets" -Tags "CI" {
Context "Group-Object" {
It "AsHashtable returns a hashtable" {
$result = Get-Process | Group-Object -Property ProcessName -AsHashTable
$result["pwsh"].Count | Should -BeGreaterThan 0
}
It "AsString returns a string" {
... |
combined_dataset/train/non-malicious/sample_61_55.ps1 | sample_61_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplacepublisher'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplacepublisher.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# S... |
combined_dataset/train/non-malicious/sample_10_2.ps1 | sample_10_2.ps1 | #************************************************
# TS_ServicingCorruptionCheck.ps1
# Version 1.0.1
# Date: 12/28/2012
# Author: v-kaw
# Description: [Idea ID 5712] [Windows] Run Dism checkhealth on Win8 or 2012 to detect possible servicing corruption
# Rule number: 5712
# Rule URL: http://sharepoint/sites/ru... |
combined_dataset/train/non-malicious/2241.ps1 | 2241.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true)]
[string]$SiteServer,
[parameter(Mandatory=$true)]
[ValidateScript({Test-Path -Path $_ -PathType Container})]
[string]$DriverSourcePath,
[parameter(Mandatory=$true)]
[ValidateScript({Test-Path -Path $_ -PathTyp... |
combined_dataset/train/non-malicious/BufferBox _1.6.ps1 | BufferBox _1.6.ps1 | ####################################################################################################
## This script is just a demonstration of some of the things you can do with the buffer
## in the default PowerShell host... it serves as a reminder of how much work remains on
## PoshConsole, and as an inspiration t... |
combined_dataset/train/non-malicious/4021.ps1 | 4021.ps1 |
function Test-GetManagementGroup
{
New-AzManagementGroup -GroupName TestPSGetGroup1
New-AzManagementGroup -GroupName TestPSGetGroup2 -ParentId "/providers/Microsoft.Management/managementGroups/TestPSGetGroup1"
$response = Get-AzManagementGroup -GroupName TestPSGetGroup2
Remove-AzManagementGroup -G... |
combined_dataset/train/non-malicious/2220.ps1 | 2220.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[ValidateNotNullOrEmpty()]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMessa... |
combined_dataset/train/non-malicious/New-FilesystemHardLink.p.ps1 | New-FilesystemHardLink.p.ps1 | ##############################################################################\n##\n## New-FileSystemHardLink\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nC... |
combined_dataset/train/non-malicious/Backup Hyper-V VMs.ps1 | Backup Hyper-V VMs.ps1 | # Directions for use:
# Import this script using the Import-Module cmdlet
# All output is logged to the backup directory in the $($BackupDriveLetter):\\VMBackup\\Backup-VMs.log file
# Use the Backup-VMs cmdlet to begin the process
# Parameter BackupDriveLetter indicates the drive to put this backup onto. It must b... |
combined_dataset/train/non-malicious/1835.ps1 | 1835.ps1 |
try {
$defaultParamValues = $PSdefaultParameterValues.Clone()
$PSDefaultParameterValues["it:skip"] = !$IsWindows
Describe "Basic Registry Provider Tests" -Tags @("CI", "RequireAdminOnWindows") {
BeforeAll {
if ($IsWindows) {
$restoreLocation = Get-Location
$registryBa... |
combined_dataset/train/non-malicious/sample_59_75.ps1 | sample_59_75.ps1 | #requires -Version 5.0
enum BcArtifactSource {
OnPrem
Sandbox
Insider
}
Import-Module (Join-Path $PSScriptRoot ClientContext\ClientContext.psd1) -Global
Import-Module (Join-Path $PSScriptRoot ClientContext\ClientContext.psm1) -Global
Import-Module (Join-Path $PSScriptRoot EntraIdAuth\EntraIdAu... |
combined_dataset/train/non-malicious/3751.ps1 | 3751.ps1 |
function GetDefaultClusterProperties
{
$orchestratorType = "Kubernetes"
$location = "East US 2"
$clusterType = "ACS"
$description = "Deployed from powershell"
$containerServiceProps = New-Object Microsoft.Azure.Management.MachineLearningCompute.Models.AcsClusterProperties($orchestrat... |
combined_dataset/train/non-malicious/sample_28_61.ps1 | sample_28_61.ps1 | #
# Module manifest for module 'OCI.PSModules.Psql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Psql.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/2718.ps1 | 2718.ps1 |
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1)]
[String[]]$FileHashes,
[Parameter(Mandatory=$False,Position=2)]
[ValidateSet("MD5","SHA1","SHA256","SHA384","SHA512","RIPEMD160")]
[string]$HashType = "SHA256",
[Parameter(Mandatory=$False,Position=3)]
[String... |
combined_dataset/train/non-malicious/sample_64_94.ps1 | sample_64_94.ps1 | #Since InstallShied suite advanced now runs in x86,
#64bit registry is set in different function
#Tests the path is present and then Unhides
function Test-Hide($path) {
if (Test-Path -Path $path)
{
Set-ItemProperty -Path $path -Name "SystemComponent" -Value 0
}
}
function Test-Hide64 {
param($... |
combined_dataset/train/non-malicious/sample_30_65.ps1 | sample_30_65.ps1 | #
# Module manifest for module 'OCI.PSModules.Datalabelingservicedataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datalabelingservicedataplane.dll'
# Version number of this module.
ModuleVersion... |
combined_dataset/train/non-malicious/sample_28_83.ps1 | sample_28_83.ps1 | #
# Module manifest for module 'OCI.PSModules.Events'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Events.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_44_52.ps1 | sample_44_52.ps1 | #
# Script module for module 'Az.DataProtection' that is executed when 'Az.DataProtection' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:40
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
... |
combined_dataset/train/non-malicious/24.ps1 | 24.ps1 | . $PSScriptRoot\Shared.ps1
Describe 'Module Manifest Tests' {
It 'Passes Test-ModuleManifest' {
Test-ModuleManifest -Path $moduleManifestPath | Should Not BeNullOrEmpty
$? | Should Be $true
}
}
|
combined_dataset/train/non-malicious/sample_52_35.ps1 | sample_52_35.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module $PSScriptRoot\HelperFiles\TestOb... |
combined_dataset/train/non-malicious/sample_15_36.ps1 | sample_15_36.ps1 | #########################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Localized PSGet.Resource.psd1
#
#########################################################################################
ConvertFrom-StringData @'
###PSL... |
combined_dataset/train/non-malicious/Get-CrystalReportTable.ps1 | Get-CrystalReportTable.ps1 | function Get-CrystalReportTable()
{
#Requires -Version 2
<#
.Synopsis
Examines a Crystal Report and returns the tables used
.Description
Examines a Crystal Report and returns the tables used by the main report and subreports
.Example
$reports = Dir *.rpt | Get-Crysta... |
combined_dataset/train/non-malicious/sample_19_10.ps1 | sample_19_10.ps1 | data LocalizedData
{
# culture="en-US"
ConvertFrom-StringData @'
PathNotFoundError=The path '{0}' either does not exist or is not a valid file system path.
ExpandArchiveInValidDestinationPath=The path '{0}' is not a valid file system directory path.
InvalidZipFileExtensionError={0} is not a su... |
combined_dataset/train/non-malicious/SqlProxy_1.psm1.ps1 | SqlProxy_1.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/777.ps1 | 777.ps1 |
$copyrightHeaderString =
@'
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
'@
$global:updateCount = 0;
function Add-CopyrightHeaders($basePath)
{
Push-Location $basePath
$allSourceFiles = Get-ChildItem... |
combined_dataset/train/non-malicious/e3d743cf-73b0-4cbc-b91e-bf279e52655e.ps1 | e3d743cf-73b0-4cbc-b91e-bf279e52655e.ps1 | param(
[string] $dirRoot = ".",
[string] $Spec = "*.*"
)
#
# Description:
# Use the wide unicode versions (FindFirstFileW and FindNextFileW) to report a directory listing of all files, including those that exceed the MAX_PATH ANSI limitations
#
# Assumptions, this script works on the assumption that... |
combined_dataset/train/non-malicious/sample_13_77.ps1 | sample_13_77.ps1 | #************************************************
# TS_SkypeFailureForMissingKB2703761Check.ps1
# Version 1.0.1
# Date: 3/13/2013
# Author: v-blchen
# Description: [Idea ID 7499] [Windows] Win8:APP - Skype fails to start
# Rule number: 7499
# Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/Disp... |
combined_dataset/train/non-malicious/GPRS Online log_7.ps1 | GPRS Online log_7.ps1 | <#
.SYNOPSIS
Get-GprsTime (V4.0 Update for Windows 7 and allow time correction) Check the
total connect time of any GPRS devices from a specified date.
Use 'Get-Help .\\Get-GprsTime -full' to view Help for this script.
.DESCRIPTION
Display all the GPRS modem Event Log entries. While applications issued by the ... |
combined_dataset/train/non-malicious/sample_33_97.ps1 | sample_33_97.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Test-ScriptExtent {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[OutputType([bool], ParameterSetName='__AllParameterSets')]
[OutputType([System.Management.Automation.Language.IScriptExten... |
combined_dataset/train/non-malicious/750.ps1 | 750.ps1 | $branch = [uri]::EscapeDataString($env:PSES_BRANCH)
$headers = @{Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"}
$buildsUrl = $env:VSTS_PSES_URL_TEMPLATE -f $branch, "succeeded"
$succeededBuilds = Invoke-RestMethod -ContentType application/json -Uri $buildsUrl -Headers $headers
Write-Host "Requested URL: $buildsUrl"... |
combined_dataset/train/non-malicious/4025.ps1 | 4025.ps1 |
function Test-DeploymentEndToEnd
{
try
{
$rgname = Get-ResourceGroupName
$deploymentName = Get-ResourceName
$location = "WestUS"
New-AzResourceGroup -Name $rgname -Location $location
$deployment = New-AzDeployment -Name $deploymentName -Location $location -TemplateFile subscript... |
combined_dataset/train/non-malicious/2393.ps1 | 2393.ps1 |
function Get-Uptime
{
[OutputType('System.Management.Automation.PSCustomObject')]
[CmdletBinding()]
param
(
[Parameter(ValueFromPipeline)]
[string[]]$ComputerName = $env:COMPUTERNAME
)
begin
{
$today = Get-Date
}
process
{
foreach ($computer in $ComputerName)
{
try
{
$output =... |
combined_dataset/train/non-malicious/sample_22_32.ps1 | sample_22_32.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 = '83.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_52_75.ps1 | sample_52_75.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Get-AMTIDER {
<#
.Synopsis
Lists the Intel Active Management Technology IDE redirection sessions
.Description
This CmdLet lists the Intel Active Management Technology (AMT) IDE redirection (IDER) sessions.
.Notes
S... |
combined_dataset/train/non-malicious/sample_6_3.ps1 | sample_6_3.ps1 | ConvertFrom-StringData @'
id_clustervalidationreport=Cluster Validation Report
id_clustervalidationreportobtaining=Obtaining Cluster Validation Report
id_clustervalidationreportstatus=Connecting to %Node% Service Control Manager
id_clustervalidationreporttestnet=Testing Networking and obtaining Cluster Validation r... |
combined_dataset/train/non-malicious/Select-Alive.ps1 | Select-Alive.ps1 | filter Select-Alive {
param ( [switch]$Verbose )
trap {
Write-Verbose "$(get-date -f 's') ping failed: $computer"
continue
}
if ($Verbose) {
$VerbosePreference = "continue"
$ErrorActionPreference = "continue"
}
else {
$VerbosePreference = "silentlycontinue"
$ErrorActionPreference = "silent... |
combined_dataset/train/non-malicious/4035.ps1 | 4035.ps1 |
$managementGroup = 'AzGovTest7'
$description = 'Unit test junk: sorry for littering. Please delete me!'
$updatedDescription = "Updated $description"
$metadataName = 'testName'
$metadataValue = 'testValue'
$metadata = "{'$metadataName':'$metadataValue'}"
$enforcementModeDefault = 'Default'
$enforcementMode... |
combined_dataset/train/non-malicious/sample_50_88.ps1 | sample_50_88.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/sample_39_60.ps1 | sample_39_60.ps1 | #
# Module manifest for module 'OCI.PSModules.Waas'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waas.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/ConvertFrom-FahrenheitWi_1.ps1 | ConvertFrom-FahrenheitWi_1.ps1 | ## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n\nparam([double] $Fahrenheit)\n\nSet-StrictMode -Version Latest\n\n## Convert it to Celsius\n$celsius = $fahrenheit - 32\n$celsius = $celsius / 1.8\n\n## Output the answer\n"$fahrenheit degrees Fahrenheit is $celsius degr... |
combined_dataset/train/non-malicious/sample_3_64.ps1 | sample_3_64.ps1 | ConvertFrom-StringData @'
id_collectactivity=Collecting Basic System Information TXT
id_collectingdata=Collecting Basic Data
id_formattingdata=Formatting Data
id_uacadminmode=Admin Mode
id_uacnoprompt=No Prompt
id_uacpromptcredentials=Prompt for credentials
id_uacpromptconsent=Prompt for consent
id_uacpromptcon... |
combined_dataset/train/non-malicious/Set Logfile length_1.ps1 | Set Logfile length_1.ps1 | ################################################################################
# Set-FileLines.ps1
# This script will maintain the PS Transcript file, or any text file, at a fixed
# length and can be used to prevent such files from becoming too large, with the
# option of removing any blank lines. Defaults to 10... |
combined_dataset/train/non-malicious/Check latest BIOS Rev_2.ps1 | Check latest BIOS Rev_2.ps1 | $BiosRev = Get-WmiObject -Class Win32_BIOS -ComputerName $ComputerName -Credential $Credentials
# Shortened URL for the Dell Support page, fileid=441102, appears to be the identifier for BIOS downloads
# I tested this on a few different models of Dell workstations.
$DellBIOSPage = "http://support.dell.com/suppor... |
combined_dataset/train/non-malicious/Get-OleDBPSObject.ps1 | Get-OleDBPSObject.ps1 | function Get-OleDBPSObject ([string]$ConnectionString, [string]$Query) {
$ConnObj = new-object System.Data.OleDb.OleDbConnection $ConnectionString
$command = New-Object System.Data.OleDb.OleDbCommand $Query, $ConnObj
try {
$ConnObj.Open()
[System.Data.OleDB.OleDbDataReader]$reader = $command.ExecuteReader()... |
combined_dataset/train/non-malicious/sample_4_63.ps1 | sample_4_63.ps1 | #************************************************
# TS_KB2655998_InactiveTSPorts.ps1
# Version 1.0.1
# Date: 03/21/2012 11:19:10
# Author: jasonf
# Description: Checks for inactive ts ports described in http://blogs.technet.com/b/askperf/archive/2012/03/06/performance-issues-due-to-inactive-terminal-server-ports.... |
combined_dataset/train/non-malicious/Create VMKernel on vDS.ps1 | Create VMKernel on vDS.ps1 | @@ New-VMHostNetworkAdapter -VMHost $myHost -VirtualSwitch "myVDS"-PortGroup "vdPortGroup"
|
combined_dataset/train/non-malicious/853.ps1 | 853.ps1 |
Get-AzLocation | select Location
$location = "eastus"
$resourceGroup = "rotatekeystestrg"
New-AzResourceGroup -Name $resourceGroup -Location $location
$storageAccountName = "contosotestkeys"
New-AzStorageAccount -ResourceGroupName $resourceGroup `
-Name $storageAccountName `
-Location $location `
-SkuNa... |
combined_dataset/train/non-malicious/3132.ps1 | 3132.ps1 |
function Get-IPv4Subnet
{
[CmdletBinding(DefaultParameterSetName='CIDR')]
param(
[Parameter(
Position=0,
Mandatory=$true,
HelpMessage='IPv4-Address which is in the subnet')]
[IPAddress]$IPv4Address,
[Parameter(
ParameterSetName='... |
combined_dataset/train/non-malicious/sample_30_90.ps1 | sample_30_90.ps1 | #
# Module manifest for module 'OCI.PSModules.Jms'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jms.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/2542.ps1 | 2542.ps1 | $a = "XSQLUTIL18", "XSQLUTIL19"
$a | % `
{
$ServerName = $_;
cd sqlserver:\
cd sql\$ServerName\default\databases
$DBs = dir;
$DBs | % `
{
$LastBackupDate = $_.LastBackupDate;
$LastLogBackupDate = $_.LastLogBackupDate;
$LastDiffBackupDate = $_.LastDifferentialBackupDate;
invoke-sqlcmd -ServerInstance ... |
combined_dataset/train/non-malicious/sample_54_23.ps1 | sample_54_23.ps1 | #
# Module manifest for Dell Command | PowerShell Provider 'DellBIOSProvider'
#
# Generated by: Dell BizClient Team
#
# Generated on: 4/30/2014
#
@{
# Script module or binary module file associated with this manifest
RootModule = 'DellBIOSProviderARM64.dll'
# Version number of this module.
ModuleVersio... |
combined_dataset/train/non-malicious/sample_5_9.ps1 | sample_5_9.ps1 | #************************************************
# TS_ProLiantDL385NMICrashDump.ps1
# Version 1.0.1
# Date: 5/16/2012
# Author: v-alyao
# Description: [Idea ID 2753] [Windows] HP DL385 G5p machine cannot generate dump file
# Rule number: 2753
# Rule URL: //sharepoint/sites/rules/Rule%20Submissions/Forms/Disp... |
combined_dataset/train/non-malicious/FuncionInfo_1.types.ps1xml.ps1 | FuncionInfo_1.types.ps1xml.ps1 | <?xml version="1.0" encoding="utf-8" ?>
<Types>
<Type>
<Name>System.Management.Automation.FunctionInfo</Name>
<Members>
<ScriptProperty>
<Name>Verb</Name>
<GetScriptBlock>
if ($this.Name.Contains("-")) {
$this.Name.Substring(0,$this.Name.Indexof("-"))
} else {
$null
... |
combined_dataset/train/non-malicious/sample_14_86.ps1 | sample_14_86.ps1 | ConvertFrom-StringData @'
id_systemfiles_title=System Files
id_systemfiles_status=Collecting System Files
id_systemfilesdirectorylistings_title=System Files Directory Listings
id_systemfilesdirectorylistings_status=Collecting System Files Directory Listings
id_systemfilesacllistings_title=System Files ACL Listings... |
combined_dataset/train/non-malicious/sample_23_38.ps1 | sample_23_38.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/Security group monitor_2.ps1 | Security group monitor_2.ps1 | #Get group membership for a list of security
#groups and export to an XML for comparison
#against baseline.
#
$script:WorkingDirectory = split-path $myinvocation.Mycommand.Definition -parent
Function Re-Baseline
{
#First, declare array and hashtable.
$securitygroups = @()
$table = @{}
#Import Security... |
combined_dataset/train/non-malicious/Get-User_2.ps1 | Get-User_2.ps1 | function Get-User($user)
{
# this function should be passed the CN of the user to be returned
$dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
$root = [ADSI] "LDAP://$($dom.Name)"
$searcher = New-Object System.DirectoryServices.DirectorySearcher $root
$searcher.filter = "(&(objec... |
combined_dataset/train/non-malicious/sample_13_14.ps1 | sample_13_14.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/NPS Server Synchronize.ps1 | NPS Server Synchronize.ps1 | ###Network Policy Server Synchronization Script
#This script copies the configuration from the NPS Master Server and imports it on this server.
#The Account that this script runs under must have Local Administrator rights to the NPS Master.
#This was designed to be run as a scheduled task on the NPS Secondary Server... |
combined_dataset/train/non-malicious/Start-Countdown.ps1 | Start-Countdown.ps1 | function Start-Countdown{
<#
.Synopsis
Initiates a countdown on your session. Can be used instead of Start-Sleep.
Use case is to provide visual countdown progress during "sleep" times
.Example
Get-Countdown -Seconds 10
This method will clear the screen and display descending seconds
.Exam... |
combined_dataset/train/non-malicious/sample_65_84.ps1 | sample_65_84.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
[CmdletBinding(DefaultParamet... |
combined_dataset/train/non-malicious/sample_1_26.ps1 | sample_1_26.ps1 | #
# Module manifest for module 'OCI.PSModules.Cims'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cims.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/List Object Discoveries.ps1 | List Object Discoveries.ps1 | # Enumerate OpsMgr 2007 Object Discoveries targeted to Windows Server
# Date: 13/10/2008
# Author: Stefan Stranger (help from Jeremy Pavleck and Marco Shaw)
get-discovery |? {$_.Target -match (get-monitoringclass | where {$_.Name -eq "Microsoft.Windows.Server.Computer"}).Id} | select Name, DisplayName
|
combined_dataset/train/non-malicious/Compare Table & DataRow_1.ps1 | Compare Table & DataRow_1.ps1 | function Compare-DataRow
{
param( $a, $b)
# @bernd_k http://pauerschell.blogspot.com/
$diff = ''
$a_columncount = $a.Table.columns.count
$b_columncount = $b.Table.columns.count
if ( $a_columncount -ne $b_columncount)
{
Write-host "Tables have different numbe... |
combined_dataset/train/non-malicious/sample_4_49.ps1 | sample_4_49.ps1 | #
# Module manifest for module 'OCI.PSModules.Databasemigration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Databasemigration.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Support... |
combined_dataset/train/non-malicious/2623.ps1 | 2623.ps1 |
param([string]$DName
)
configuration LabDC_DHCP{
param(
[string[]] $ComputerName = 'localhost'
,[string] $DomainName
)
Import-DscResource -Module xDHCPServer
xDhcpServerScope DHCPScope
{
Ensure = 'Present'
IPStartRange = '10.10.10.1... |
combined_dataset/train/non-malicious/486.ps1 | 486.ps1 |
function Add-HostFileEntry{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[String]
$IP,
[Parameter(Mandatory=$true)]
[String]
$DNS
)
$HostFile = "$env:windir\System32\drivers\etc\hosts"
[string]$LastLine = Get-Content $HostFile | select -Las... |
combined_dataset/train/non-malicious/sample_16_91.ps1 | sample_16_91.ps1 | ijSTF2QMV0d+rdP3fk8k5y2AS/ebcK7CHG2X2nokwHLF05hD+QxvLzu1OjsMUPvlZp6zayBJa/HTiDEatPJMCB4cZ+HtVF2CEAvBX7ml9ezRRGjwpSN/Ujbi+aBAjqMRiFouV36sRlwlYGSEn2k2LGh6p8GVjTnPgtyaUtITyOqJeZ3LRBIFsUE9y8uHfiB9wIiqVfLcnBz3Qhfc9+gXDl9CoXVuw+Xt0MMhv1FI5+vTAT7yf6+D2ptJJmseEEur9f1rus2iDrywauU60znbeR54JX6JgmuYb0vqzHQobCE4kYJNBxH+t/FqIRncYhyq... |
combined_dataset/train/non-malicious/sample_66_9.ps1 | sample_66_9.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_7_22.ps1 | sample_7_22.ps1 | # Load Common Library
# Load Reporting Utilities
#_#$debug = $false
. ./utils_cts.ps1
. ./TS_RemoteSetup.ps1
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.S... |
combined_dataset/train/non-malicious/sample_20_67.ps1 | sample_20_67.ps1 | <#########################################################################################################
# File: Run-Task.ps1
#
# .DESCRIPTION
#
# Run powershell scripts using scheduled task. It requires two pre-defined variables ($taskName and $script).
#
# Copyright (c) Microsoft Corp 2016.
#
##... |
combined_dataset/train/non-malicious/sample_27_64.ps1 | sample_27_64.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Microsoft.PowerShell.Management\Get-Item function:Clear-Host | Microsoft.PowerShell.Management\Set-Item function:__clearhost
function Clear-Host {
[Alias('cls')]
param()
__clearhost
if ($host.Runspace.LanguageMode -eq ... |
combined_dataset/train/non-malicious/sample_19_74.ps1 | sample_19_74.ps1 | #
# Module manifest for module 'OCI.PSModules.Onesubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_62_61.ps1 | sample_62_61.ps1 | #
# Module manifest for module 'OCI.PSModules.Networkloadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Networkloadbalancer.dll'
# Version number of this module.
ModuleVersion = '89.0.0'
# Sup... |
combined_dataset/train/non-malicious/Lock close button.ps1 | Lock close button.ps1 | $code = @'
using System;
using System.Runtime.InteropServices;
namespace CloseButtonToggle {
internal static class WinAPI {
[DllImport("kernel32.dll")]
internal static extern IntPtr GetConsoleWindow();
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static e... |
combined_dataset/train/non-malicious/sample_62_50.ps1 | sample_62_50.ps1 | #
# Module manifest for module 'OCI.PSModules.Mysql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Mysql.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_47_73.ps1 | sample_47_73.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerengine'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerengine.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_4_39.ps1 | sample_4_39.ps1 | # Copyright ?008, Microsoft Corporation. All rights reserved.
if($debug -eq $true){[void]$shell.popup("Run TS_Virtualization.ps1")}
Import-LocalizedData -BindingVariable VirtualizationStrings
Write-DiagProgress -Activity $VirtualizationStrings.ID_Virtualization -Status $VirtualizationStrings.ID_Virtualizatio... |
combined_dataset/train/non-malicious/1332.ps1 | 1332.ps1 |
function Start-PowerShellProcess
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$CommandLine,
[Parameter(Mandatory=$true)]
[pscredential]
$Credential
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Sessio... |
combined_dataset/train/non-malicious/Move-Template.ps1 | Move-Template.ps1 | #requires -version 2.0
Function Move-Template{
<#
.Synopsis
Move a VM template
.Description
Move a VM template either to a new host via vmotion or to a new datastore via svmotion
.Parameter Name
Name of the VM to be migrated
.Parameter VIObject
Template to ... |
combined_dataset/train/non-malicious/sample_64_47.ps1 | sample_64_47.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 = '85.2.0'
# Supported P... |
combined_dataset/train/non-malicious/2154.ps1 | 2154.ps1 |
Describe "Verify PowerShell Runs" {
BeforeAll{
$options = (Get-PSOptions)
$path = split-path -path $options.Output
Write-Verbose "Path: '$path'" -Verbose
$rootPath = split-Path -path $path
$mount = 'C:\powershell'
$container = 'mcr.microsoft.com/powershell:nanoserv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.