full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/Filtering hosts.ps1 | Filtering hosts.ps1 | set-psdebug -strict
Function Where-Host
{
<#
.SYNOPSIS
Filter hosts according to hostname resolution, ping reachability or WMI capability
.DESCRIPTION
Filter hostnames by hostname resolution, ping reachbility or WMI capabilities.
Filter can be positive or negative. Positive filter includes hosts that c... |
combined_dataset/train/non-malicious/1044.ps1 | 1044.ps1 |
[CmdletBinding()]
param(
)
Set-StrictMode -Version 'Latest'
$ErrorActionPreference = 'Stop'
$base64Snk = $env:SNK
if( -not $base64Snk )
{
return
}
$snkPath = Join-Path -Path $PSScriptRoot -ChildPath 'Source\Carbon.snk'
Write-Verbose -Message ('Saving signing key to "{0}".' -f $snkPath)
[IO.File]:... |
combined_dataset/train/non-malicious/sample_66_77.ps1 | sample_66_77.ps1 | <policyDefinitionResources revision="1.0" schemaVersion="1.0">
<displayName>
</displayName>
<description>
</description>
<resources>
<stringTable>
<string id="LAPS">LAPS</string>
<string id="LAPS_BackupDirectory">Настройка каталога резервного копирования паролей</string>
<string... |
combined_dataset/train/non-malicious/2165.ps1 | 2165.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, ParameterSetName="AppName", HelpMessage="Specify the app name to search for within the App Store.")]
[ValidateNotNullOrEmpty()]
[ValidatePattern("^[A-Za-z\s]*$")]
[string]$AppName,
[parameter(Mandatory=$true, Parameter... |
combined_dataset/train/non-malicious/Get-Codecs.ps1 | Get-Codecs.ps1 | [string[]]$key = "SOFTWARE\\Classes\\CLSID\\{083863F1-70DE-11d0-BD40-00A0C911CE86}\\Instance",
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32"
function ModuleInfo([string]$path) {
$item.SubItems.Add((gci $path).VersionInfo.CompanyName)
$item.SubItems.Add((gci $path).VersionInfo.F... |
combined_dataset/train/non-malicious/sample_42_71.ps1 | sample_42_71.ps1 | let resizeObserver;
let observerAddRemove;
export function FluentOverflowInitialize(dotNetHelper, id, isHorizontal, querySelector) {
var localSelector = querySelector;
if (!localSelector) {
// cannot use :scope for node.matches() further down
localSelector = ".fluent-overflow-item";
... |
combined_dataset/train/non-malicious/sample_29_60.ps1 | sample_29_60.ps1 | #
# Module manifest for module 'OCI.PSModules.Globallydistributeddatabase'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Globallydistributeddatabase.dll'
# Version number of this module.
ModuleVersion =... |
combined_dataset/train/non-malicious/sample_23_43.ps1 | sample_23_43.ps1 | $ServerCertificateName = "CN=ServiceFabricServerCert"
$ClientCertificateName = "CN=ServiceFabricClientCert"
function IsSecurityX509([string]$ClusterConfigFilePath)
{
$jsonConfig = Get-Content $ClusterConfigFilePath -Raw | ConvertFrom-Json
$properties = $jsonConfig.properties
if ($properties -ne $Nul... |
combined_dataset/train/non-malicious/Connect-VMHost_1.ps1 | Connect-VMHost_1.ps1 | #requires -version 2
#requires -pssnapin VMware.VimAutomation.Core
Function Connect-VMHost {
<#
.Summary
Used to Connect a disconnected host to vCenter.
.Parameter VMHost
VMHost to reconnect to virtual center
.Example
Get-VMHost | Where-Object {$_.state -eq "Disconnect... |
combined_dataset/train/non-malicious/sample_3_59.ps1 | sample_3_59.ps1 | ConvertFrom-StringData @'
id_sbsl_mcafee_eepc_slowboot_sd=McAfee Endpoint Encryption for PCs (EEPC) may cause slow boot or delay between CTRL+ALT+DEL and Credential logon dialog
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3A... |
combined_dataset/train/non-malicious/sample_5_53.ps1 | sample_5_53.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/sample_54_32.ps1 | sample_54_32.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Suppor... |
combined_dataset/train/non-malicious/sample_58_49.ps1 | sample_58_49.ps1 | #!/usr/bin/env pwsh
$PlaywrightFileName = Join-Path $PSScriptRoot "Microsoft.Playwright.dll"
[Reflection.Assembly]::LoadFile($PlaywrightFileName) | Out-Null
exit [Microsoft.Playwright.Program]::Main($args)
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3Ag... |
combined_dataset/train/non-malicious/ffdb7026-570c-4644-8a9f-b2c8fcdabfd5.ps1 | ffdb7026-570c-4644-8a9f-b2c8fcdabfd5.ps1 | # Code to auto update the Address policy, GAL, OAB and storage groups and mailbox databases of an Exchange 2007 server by John McLear
# This code is good for hosting providers or people who wish to use lots of storage groups and mailbox databases.
#
# Thanks to Joel Bennett (Jaykul) for general scripting help and t... |
combined_dataset/train/non-malicious/1979.ps1 | 1979.ps1 |
Describe "CliXml test" -Tags "CI" {
BeforeAll {
$testFilePath = Join-Path "testdrive:\" "testCliXml"
$subFilePath = Join-Path $testFilePath ".test"
if(test-path $testFilePath)
{
Remove-Item $testFilePath -Force -Recurse
}
New-Item -Path $test... |
combined_dataset/train/non-malicious/2792.ps1 | 2792.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(IpAddr, Mac, Type) as ct,
IpAddr,
Mac,
Type
FROM
*arp.csv
GROUP BY
IpAddr,
Mac,
Type
ORDER BY
ct ASC
"@
& logparser -stats:off -i:csv -dtlines:0 -rtp:-1 "$lpque... |
combined_dataset/train/non-malicious/Set-Wallpaper (CTP3)_2.ps1 | Set-Wallpaper (CTP3)_2.ps1 | #requires -version 2.0
## Set-Wallpaper - set your windows desktop wallpaper
###################################################################################################
## Usage:
## Set-Wallpaper "C:\\Users\\Joel\\Pictures\\Wallpaper\\Dual Monitor\\mandolux-tiger.jpg" "Tile"
## ls *.jpg | get-random ... |
combined_dataset/train/non-malicious/sample_9_73.ps1 | sample_9_73.ps1 | #************************************************
# TS_MCALite.ps1
# Version 1.0.1
# Date: 7/17/2012
# Author: tspring
# Description: [Idea ID 4796] [Windows] MaxConcurrentApi Problem Detection Lite
# Rule number: 4796
# Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.aspx?ID=4796
#**... |
combined_dataset/train/non-malicious/757.ps1 | 757.ps1 |
$null = New-Item -Path "$PSScriptRoot\foo[1].txt" -Force
Import-Module $PSScriptRoot\..\SampleModule.psd1
$WorkspaceRoot = Convert-Path $PSScriptRoot/..
Set-Location $WorkspaceRoot
Describe 'Verify Path Processing for Non-existing Paths Allowed Impl' {
It 'Processes non-wildcard absolute path to non-ex... |
combined_dataset/train/non-malicious/1381.ps1 | 1381.ps1 |
function Set-CSslCertificateBinding
{
[CmdletBinding(SupportsShouldProcess=$true)]
[OutputType([Carbon.Certificates.SslCertificateBinding])]
param(
[IPAddress]
$IPAddress = '0.0.0.0',
[UInt16]
$Port = 443,
[Parameter(Mandatory... |
combined_dataset/train/non-malicious/sample_66_55.ps1 | sample_66_55.ps1 | <#
.Synopsis
Activate a Python virtual environment for the current PowerShell session.
.Description
Pushes the python executable for a virtual environment to the front of the
$Env:PATH environment variable and sets the prompt to signify that you are
in a Python virtual environment. Makes use of the command line... |
combined_dataset/train/non-malicious/911.ps1 | 911.ps1 |
Add-WindowsFeature Web-Server
Get-Disk | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle MBR -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel "myDataDisk" -Confirm:$false
|
combined_dataset/train/non-malicious/sample_1_80.ps1 | sample_1_80.ps1 | param( [string]$DataPath, `
[switch]$AcceptEula, `
[switch]$Trace, `
[switch]$Logs, `
[switch]$Activity, `
[switch]$Fwd, `
[switch]$FwdCli, `
[switch]$RemShell, `
[switch]$HTTPSYS, `
[switch]$WinHTTP, `
[switch]$CAPI, `
[switch]$Ker... |
combined_dataset/train/non-malicious/ConvertFrom-Hashtable.ps1 | ConvertFrom-Hashtable.ps1 | # function ConvertFrom-Hashtable {
PARAM([[HashTable]$hashtable,[switch]$combine)
BEGIN { $output = New-Object PSObject }
PROCESS {
if($_) {
$hashtable = $_;
if(!$combine) {
$output = New-Object PSObject
}
}
$hashtable.GetEnumerator() |
ForEach-Object { Add-Member -inputObject $obje... |
combined_dataset/train/non-malicious/sample_49_49.ps1 | sample_49_49.ps1 | #
# Module manifest for module 'PowerShellEditorServices'
#
# Generated by: daviwil
#
# Generated on: 5/12/2016
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'PowerShellEditorServices.Commands.psm1'
# Version number of this module.
ModuleVersion = '0.2.0'
# I... |
combined_dataset/train/non-malicious/sample_11_79.ps1 | sample_11_79.ps1 | ConvertFrom-StringData @'
id_dirs=Collecting Directory Output
'@
# SIG # Begin signature block
# MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDRy8kiReDoGdLC
# nmSgV1SViLYbd... |
combined_dataset/train/non-malicious/sample_20_64.ps1 | sample_20_64.ps1 | #
# Module manifest for module 'OCI.PSModules.Opa'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Opa.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/Convert-BounceToX_5.ps1 | Convert-BounceToX_5.ps1 | # $Id: Convert-BounceToX500.ps1 610 2010-11-16 00:39:19Z jon $
# $Revision: 610 $
#.Synopsis
# Convert Bounce to X500
#.Description
# Convert URL Encoded address in a Bounce message to an X500 address
# that can be added as an alias to the mail-enabled object
#.Parameter bounceAddress
# URL Encoded bounce... |
combined_dataset/train/non-malicious/1185.ps1 | 1185.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
function Start-Test
{
$dir = Join-Path -Path $env:TEMP -ChildPath ([IO.Path]::GetRandomFileName())
Install-Directory -Path $dir
}
function Stop-Test
{
if( (Test-Path -Path $dir -PathType Container) )
{
... |
combined_dataset/train/non-malicious/sample_21_62.ps1 | sample_21_62.ps1 | #
# Module manifest for module 'OCI.PSModules.Databasemanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Databasemanagement.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Suppo... |
combined_dataset/train/non-malicious/sample_34_28.ps1 | sample_34_28.ps1 | #
# Module manifest for module 'OCI.PSModules.Appmgmtcontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Appmgmtcontrol.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSE... |
combined_dataset/train/non-malicious/123.ps1 | 123.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aad... |
combined_dataset/train/non-malicious/sample_28_85.ps1 | sample_28_85.ps1 | #
# Module manifest for module 'OCI.PSModules.Secrets'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Secrets.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/3226.ps1 | 3226.ps1 |
describe 'New-PoshBotFileUpload' {
BeforeAll {
$readme = Join-Path -Path $env:BHProjectPath -ChildPath 'README.md'
}
it 'Returns a [PoshBot.File.Upload] object' {
$resp = New-PoshBotFileUpload -Path $readme
$resp.PSObject.TypeNames[0] | should be 'PoshBot.File.Upload'
}
i... |
combined_dataset/train/non-malicious/O-ChristmasTree.ps1 | O-ChristmasTree.ps1 | ipmo PowerBoots
## Merry Christmas
boots {
$global:lights = @()
grid {
# A trunk
rectangle -width 20 -height 40 -fill brown -HorizontalAlignment Center -VerticalAlignment Bottom
# A perfect, triangular, tree
polygon -points { "87.5,0","0,150","175,150","87.5,0" } -margin "0,2... |
combined_dataset/train/non-malicious/sample_2_82.ps1 | sample_2_82.ps1 | #************************************************
# DC_KIR-RBC-RegEntries.ps1
# Version 1.0
# Date: 2020
# Author: + Walter Eder (waltere@microsoft.com)
# Description: Collects KIR (for 2019) and RBC (for 2016) Registry Entries
# Called from: TS_AutoAddCommands_*.ps1
#*******************************************... |
combined_dataset/train/non-malicious/sample_14_91.ps1 | sample_14_91.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al... |
combined_dataset/train/non-malicious/sample_45_91.ps1 | sample_45_91.ps1 | #
# Module manifest for module 'OCI.PSModules.Functions'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Functions.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_53_4.ps1 | sample_53_4.ps1 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apa... |
combined_dataset/train/non-malicious/sample_9_53.ps1 | sample_9_53.ps1 |
#************************************************
# DC_EnvVars.ps1
# Version 2.0
# Date: 10-09-2012
# Author: clandis, andret
# Description: Collects environment variables (output of SET command)
#************************************************
Import-LocalizedData -BindingVariable EnvVarsStrings
Write-D... |
combined_dataset/train/non-malicious/sample_44_8.ps1 | sample_44_8.ps1 | <#
.SYNOPSIS
Install and run the 'Microsoft.DotNet.VersionTools.Cli' tool with the 'trim-artifacts-version' command to trim the version from the NuGet assets file name.
.PARAMETER InputPath
Full path to directory where artifact packages are stored
.PARAMETER Recursive
Search for NuGet packages recursively
#>
Param(... |
combined_dataset/train/non-malicious/Send-HTMLFormattedEmail_7.ps1 | Send-HTMLFormattedEmail_7.ps1 | ##################################################
# cmdlets
##################################################
#-------------------------------------------------
# Send-HTMLFormattedEmail
#-------------------------------------------------
# Usage: Send-HTMLFormattedEmail -?
#------------------------------------... |
combined_dataset/train/non-malicious/3491.ps1 | 3491.ps1 |
function Test-GetBlueprintAssignment
{
$assignments = Get-AzBlueprintAssignment
Assert-True { $assignments.Count -ge 1 }
Assert-NotNull $assignments[0].Name
Assert-NotNull $assignments[0].Id
Assert-NotNull $assignments[0].BlueprintId
Assert-NotNull $assignments[0].Scope
Assert-NotNull $assignments[0].Loca... |
combined_dataset/train/non-malicious/Start-ComputerJobs_1.ps1 | Start-ComputerJobs_1.ps1 | #requires -version 2.0
function Start-ComputerJobs{
<#
.NOTES
Name: Start-ComputerJobs
Author: Tome Tanasovski
Created: 6/25/2010
Modified: 6/25/2010
Version: 1.1
Website: http://powertoe.wordpress.com
.SYNOPSIS
Multithreads a scriptblock with jobs
... |
combined_dataset/train/non-malicious/Custom Accelerators_1.ps1 | Custom Accelerators_1.ps1 | #requires -version 2.0
## Custom Accelerators for PowerShell 2
####################################################################################################
## A script module for PowerShell 2 which allows the user to create their own custom type accelerators.
## Thanks to "Oisin Grehan for the discovery":h... |
combined_dataset/train/non-malicious/sample_59_96.ps1 | sample_59_96.ps1 | #
# Module manifest for module 'OCI.PSModules.Waa'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waa.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_66_89.ps1 | sample_66_89.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicemanagerproxy'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicemanagerproxy.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Sup... |
combined_dataset/train/non-malicious/sample_8_94.ps1 | sample_8_94.ps1 | #************************************************
# TS_SurfacePro3DetectFirmwareVersions.ps1
# Version 1.0.09.19.14: Created and tested SurfacePro3 scripts from Sep12-19
# Date: 2014
# Author: bbenson
# Description: SurfacePro3DetectFirmwareVersions
#
# Rule GUID: 34F6567E-7B92-4C37-B1CA-5DE6E66D4881
#
# Files... |
combined_dataset/train/non-malicious/1931.ps1 | 1931.ps1 |
Describe "Set-Alias DRT Unit Tests" -Tags "CI" {
It "Set-Alias Invalid Scope Name should throw PSArgumentException"{
{ Set-Alias -Name "ABCD" -Value "foo" -Scope "bogus" } | Should -Throw -ErrorId "Argument,Microsoft.PowerShell.Commands.SetAliasCommand"
}
It "Set-Alias ReadOnly Force"{
Set-Alias -Name ABCD... |
combined_dataset/train/non-malicious/4024.ps1 | 4024.ps1 |
function Test-CreatesNewSimpleResourceGroup
{
$rgname = Get-ResourceGroupName
$location = Get-Location "Microsoft.Resources" "resourceGroups" "West US"
try
{
$actual = New-AzResourceGroup -Name $rgname -Location $location -Tags @{ testtag = "testval"}
$expec... |
combined_dataset/train/non-malicious/sample_9_83.ps1 | sample_9_83.ps1 | #************************************************
# TS_DetectMTU1514.ps1
# Version 1.0
# Date: 02/06/2014
# Author: BBenson
# Description: Detect if LinkMTU is set to 1514.
# Rule number: 262751
# Rule ID: 7a316c95-272b-4207-983d-57acb91d0eea
# Rule URL: https://kse.microsoft.com/Contribute/Idea/1456f71b-f3... |
combined_dataset/train/non-malicious/1458.ps1 | 1458.ps1 |
function Install-CCertificate
{
[CmdletBinding(SupportsShouldProcess=$true,DefaultParameterSetName='FromFileInWindowsStore')]
[OutputType([Security.Cryptography.X509Certificates.X509Certificate2])]
param(
[Parameter(Mandatory=$true,Position=0,ParameterSetName='FromFileInWindowsStore')]
... |
combined_dataset/train/non-malicious/sample_62_42.ps1 | sample_62_42.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.Synopsis
Group Policy tools use administrative template files (.admx, .adml) to populate policy settings in the user interface.
This allows administrators to manage registry-based policy settings.
This script installes Powe... |
combined_dataset/train/non-malicious/1278.ps1 | 1278.ps1 |
function Convert-CSecureStringToString
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[Security.SecureString]
$SecureString
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
$st... |
combined_dataset/train/non-malicious/sample_44_98.ps1 | sample_44_98.ps1 | # Use this PowerShell script to register required cmdlets
# The script must be executed as local admin
.\cru.ps1 -installcmdlet CredRoamLocalUserData
.\cru.ps1 -installcmdlet CredRoamADUserData -AcceptEula
.\cru.ps1 -installcmdlet CredRoamLVRData -AcceptEula
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNA... |
combined_dataset/train/non-malicious/New-SQLComputerLogin.ps1 | New-SQLComputerLogin.ps1 | function New-SQLComputerLogin {
param(
[Parameter(Mandatory=$True,Position=0)]
[String]$SQLServer,
[Parameter(Mandatory=$True,Position=1)]
[String]$ComputerName,
[Switch]$Force
)
## Import-Module QAD, SQLPS -DisableNameChecking
$Computer = Get-QADComputer $ComputerName
#$NTAccountName = $Computer.NTA... |
combined_dataset/train/non-malicious/2332.ps1 | 2332.ps1 |
[CmdletBinding()]
[OutputType('Selected.Microsoft.Management.Infrastructure.CimInstance')]
param ()
begin {
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
Set-StrictMode -Version Latest
}
process {
try {
$DhcpServers = Get-DhcpServerInDC | where { Test-Connection -ComputerName ... |
combined_dataset/train/non-malicious/sample_3_35.ps1 | sample_3_35.ps1 | #************************************************
# TS_EventLogStoppedGPPCheck.ps1
# Version 1.0.1
# Date: 4/3/2013
# Author: v-blchen
# Description: [Idea ID 7018] [Windows] Event Log Service won't start
# Rule number: 7018
# Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.aspx?ID=701... |
combined_dataset/train/non-malicious/wlanscan.ps1 | wlanscan.ps1 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=
# Name: wlanscan
# Author: Kris Cieslak (defaultset.blogspot.com)
# Date: 2010-04-03
# Description: Simple script that uses netsh to show wireless networks.
#
# Parameters: wireless interface name (optional... |
combined_dataset/train/non-malicious/3951.ps1 | 3951.ps1 |
function Test-GetAvailableAliasList
{
$location = Get-ProviderLocation ResourceManagement
try
{
$results = Get-AzAvailableServiceAlias -Location $location;
Assert-NotNull $results;
}
finally
{
Clean-ResourceGroup $rgname
}
}
|
combined_dataset/train/non-malicious/251.ps1 | 251.ps1 | Function Invoke-Ping
{
[cmdletbinding(DefaultParameterSetName = 'Ping')]
param (
[Parameter(ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true,
Position = 0)]
[string[]]$ComputerName,
[Parameter(ParameterSetName = 'Detail')]
... |
combined_dataset/train/non-malicious/sample_11_45.ps1 | sample_11_45.ps1 | Signature-Version: 1.0
SHA-256-Digest-Manifest-Main-Attributes: g/TqwshCROFJVmhV1QEn61Fg1W2Oo
tyaowJxbJy6WMI=
SHA-256-Digest-Manifest: sLmosxa9qYRSiP8Jdd0CG1edmUi8x/G3yNnagMjj5Lc=
Created-By: 1.8.0_112 (Oracle Corporation)
Name: com/microsoft/azure/toolkit/lib/appservice/webapp/WebAppServiceS
ubscription.clas... |
combined_dataset/train/non-malicious/sample_38_92.ps1 | sample_38_92.ps1 | ConvertFrom-StringData -StringData @'
AdapterNotFound = 지정된 어댑터를 찾을 수 없음: {0}
InvalidParams = 유효하지 않은 매개변수 집합. 유효한 매개변수 세트를 확인하려면 cmdlet 도움말을 참조하십시오.
InvalidParamsAdapterAndName = 이름 및 어댑터 매개변수를 지정할 수 없습니다.
InvalidParamsConfigAndModule = 모듈과 구성 매개변수를 지정할 수 없습니다.
InvalidModule = {0}: {1}은(는) 유효하지 않은 모듈 이름입니다. 유효한 모... |
combined_dataset/train/non-malicious/1318.ps1 | 1318.ps1 |
function Uninstall-CScheduledTask
{
[CmdletBinding(DefaultParameterSetName='AsBuiltinPrincipal')]
param(
[Parameter(Mandatory=$true)]
[Alias('TaskName')]
[string]
$Name
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session... |
combined_dataset/train/non-malicious/List AD Attributes.ps1 | List AD Attributes.ps1 | $forest = [DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
$Schema = $forest.schema
$Properties = $Schema.FindAllProperties()
foreach($property in $Properties)
{
"#################################"
"Name: {0}" -f $property.Name
"Link: {0}" -f $property.link
"LinkID: {0}" -f $prope... |
combined_dataset/train/non-malicious/2975.ps1 | 2975.ps1 | param (
[Parameter(Mandatory)]
[string] $ApiKey
)
$VerbosePreference = 'Continue'
$ErrorActionPreference = 'Stop'
$baseDir = $PSScriptRoot
try {
$buildDir = "$baseDir\build\psgallery\Pester"
Write-Verbose 'Importing PowerShellGet module'
$psGet = Import-Module PowerShellGet -PassThru -Verbose:$fa... |
combined_dataset/train/non-malicious/1868.ps1 | 1868.ps1 |
Add-TestDynamicType
Describe "Where-Object" -Tags "CI" {
BeforeAll {
$Computers = @(
[PSCustomObject]@{
ComputerName = "SPC-1234"
IPAddress = "192.168.0.1"
NumberOfCores = 1
Drives = 'C','D'
},
[PSCustomOb... |
combined_dataset/train/non-malicious/sample_1_96.ps1 | sample_1_96.ps1 | ConvertFrom-StringData @'
progressbar_id_crm_unsupportedcustomapp_exists=Custom Applications Under CRMAppPool Check
progressbar_id_crm_unsupportedcustomapp_existsdesc=Creating an IIS application inside the Microsoft Dynamics CRM Website for any VDir and specifically within the ISV folder is not supported.
'@
# SI... |
combined_dataset/train/non-malicious/Test-Server_2.ps1 | Test-Server_2.ps1 | Function Test-Server{
[cmdletBinding()]
param(
[parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string[]]$ComputerName,
[parameter(Mandatory=$false)]
[switch]$CredSSP,
[Management.Automation.PSCredential] $Credential)
begin{
$total = Get-Date
$results = @()
if($credssp){if(!($credential)){Wri... |
combined_dataset/train/non-malicious/sample_67_21.ps1 | sample_67_21.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param (
[Parameter(Manda... |
combined_dataset/train/non-malicious/sample_51_34.ps1 | sample_51_34.ps1 | /*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.46.0(21007360cad28648bdf46282a2592cb47c3a7a6f)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-------------... |
combined_dataset/train/non-malicious/sample_21_72.ps1 | sample_21_72.ps1 | # Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2
<#
.SYNOPSIS
VMware Tools script for managing the Salt minion on a Windows guest
.DESCRIPTION
This script manages the Salt minion on a Windows guest. The minion is a OneDir
build hosted on https://repo.saltproject.io/salt/py3/onedir/. You... |
combined_dataset/train/non-malicious/get windows product key_4.ps1 | get windows product key_4.ps1 | function get-windowsproductkey([string]$computer)
{
$Reg = [WMIClass] ("\\\\" + $computer + "\\root\\default:StdRegProv")
$values = [byte[]]($reg.getbinaryvalue(2147483650,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion","DigitalProductId").uvalue)
$lookup = [char[]]("B","C","D","F","G","H","J","K","M","P","Q","R"... |
combined_dataset/train/non-malicious/sample_43_21.ps1 | sample_43_21.ps1 | #
# Module manifest for module 'ThreadJob'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = '.\Microsoft.PowerShell.ThreadJob.dll'
# Version number of this module.
ModuleVersion = '2.0.3'
# ID used to uniquely identify this module
GUID = '0e7b895d-2fec-43f7-8cae-11... |
combined_dataset/train/non-malicious/716.ps1 | 716.ps1 |
function New-RsRestFolder
{
[CmdletBinding()]
param(
[Parameter(Mandatory = $True)]
[string]
$RsFolder,
[Parameter(Mandatory = $True)]
[Alias('Name')]
[string]
$FolderName,
[string]
$ReportPortalUri,
[Alias('ApiVersion')... |
combined_dataset/train/non-malicious/4136.ps1 | 4136.ps1 |
[CmdletBinding()]
param ()
function Uninstall-MSIByName {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][String]$ApplicationName,
[ValidateNotNullOrEmpty()][String]$Switches
)
$Executable = $Env:windir + "\system32\msiexec.exe"
$Uninstall = Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\Curre... |
combined_dataset/train/non-malicious/183.ps1 | 183.ps1 | function Get-LocalGroup
{
PARAM
(
[Alias('cn')]
[String[]]$ComputerName = $Env:COMPUTERNAME,
[String]$AccountName,
[System.Management.Automation.PsCredential]$Credential
)
$Splatting = @{
Class = "Win32_Group"
Namespace = "root\cimv2"
Filter ... |
combined_dataset/train/non-malicious/sample_31_51.ps1 | sample_31_51.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module -Name "$PSScriptRoot\..\RoleHelper... |
combined_dataset/train/non-malicious/sample_26_32.ps1 | sample_26_32.ps1 | #
# Module manifest for module 'OCI.PSModules.Networkfirewall'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Networkfirewall.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported P... |
combined_dataset/train/non-malicious/4217.ps1 | 4217.ps1 |
function New-InMemoryModule
{
Param
(
[Parameter(Position = 0)]
[ValidateNotNullOrEmpty()]
[String]
$ModuleName = [Guid]::NewGuid().ToString()
)
$LoadedAssemblies = [AppDomain]::CurrentDomain.GetAssemblies()
ForEach ($Assembly in $LoadedAssemblies) {
... |
combined_dataset/train/non-malicious/3383.ps1 | 3383.ps1 |
$commands =
function Test-SetAzureStorageBlobContent
{
Assert-ThrowsContains {
Set-AzureStorageBlobContent -File "foo.txt" -Container foo -Blob foo -BlobType Block
} "Could not get the storage context. Please pass in a storage context or set the current storage context." > $null
}
function Te... |
combined_dataset/train/non-malicious/785.ps1 | 785.ps1 |
function Find-Ast {
[CmdletBinding(PositionalBinding=$false, DefaultParameterSetName='FilterScript')]
param(
[Parameter(Position=0, ParameterSetName='FilterScript')]
[ValidateNotNullOrEmpty()]
[scriptblock]
$FilterScript = { $true },
[Parameter(ValueFromPipelin... |
combined_dataset/train/non-malicious/Add-SqlTable_4.ps1 | Add-SqlTable_4.ps1 | try {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop}
catch {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo"}
try {add-type -AssemblyName "Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=8... |
combined_dataset/train/non-malicious/sample_18_61.ps1 | sample_18_61.ps1 | #
# Module manifest for module 'OCI.PSModules.Apigateway'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apigateway.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/3451.ps1 | 3451.ps1 |
function Test-GetNonExistingDataFactory
{
$dfname = Get-DataFactoryName
$rgname = Get-ResourceGroupName
$rglocation = Get-ProviderLocation ResourceManagement
New-AzResourceGroup -Name $rgname -Location $rglocation -Force
Assert-ThrowsContains { Get-AzDataFactory -Resou... |
combined_dataset/train/non-malicious/171.ps1 | 171.ps1 | Function Test-ADCredential {
Param($username, $password, $domain)
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$ct = [System.DirectoryServices.AccountManagement.ContextType]::Domain
$pc = New-Object System.DirectoryServices.AccountManagement.PrincipalContext($ct, $domain)
New-Object PSObject -... |
combined_dataset/train/non-malicious/1811.ps1 | 1811.ps1 |
Describe "Get-Item" -Tags "CI" {
BeforeAll {
if ( $IsWindows ) {
$skipNotWindows = $false
}
else {
$skipNotWindows = $true
}
}
It "Should list all the items in the current working directory when asterisk is used" {
$items = Get-Item (Join-Pat... |
combined_dataset/train/non-malicious/2424.ps1 | 2424.ps1 | [CmdletBinding()]
param(
[Parameter(Mandatory)]
[string[]]$ComputerName,
[Parameter(Mandatory)]
[pscredential]$Credential
)
$Header = @"
<style>
table {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
th {
... |
combined_dataset/train/non-malicious/sample_9_12.ps1 | sample_9_12.ps1 | #************************************************
# RS_BPAinfo.ps1
# 2023-02-20 WalterE mod Trap #we#
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumb... |
combined_dataset/train/non-malicious/sample_9_58.ps1 | sample_9_58.ps1 | # 2023-02-24 WalterE mod Trap #we#
$startTime_AutoAdd = Get-Date
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_"
}
Write-Host -Background... |
combined_dataset/train/non-malicious/sample_9_57.ps1 | sample_9_57.ps1 | ConvertFrom-StringData @'
id_ctssnmp=SNMP
id_ctssnmpdescription=Collects information about SNMP.
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCA... |
combined_dataset/train/non-malicious/4006.ps1 | 4006.ps1 |
$testReposInfo = @{
VsoGit = @{
Name = "AASourceControl-VsoGit"
RepoUrl = "https://francisco-gamino.visualstudio.com/_git/VsoGit-SwaggerAndCmdletsTests"
Branch = "preview"
FolderPath = "Azure/MyRunbooks"
SourceType = "VsoGit"
PersonalAccess... |
combined_dataset/train/non-malicious/580.ps1 | 580.ps1 |
function Add-SPOField
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string] $listTitle,
[Parameter(Mandatory=$true, Position=2)]
[string] $fieldName,
[Parameter(Mandatory=$true, Position=3)]
[string] $fieldXML
)
$web = $clientContext.Web
$list = $web.Lists.GetB... |
combined_dataset/train/non-malicious/Audit Script.ps1 | Audit Script.ps1 | #####################################################
# Audit script by Alan Renouf - Virtu-Al #
# Blog: http://teckinfo.blogspot.com/ #
# #
# Usage: Audit.ps1 'path' #
# ... |
combined_dataset/train/non-malicious/sample_3_45.ps1 | sample_3_45.ps1 | #************************************************
# TS_MemoryManagerSystemPagesCheck.ps1
# Version 1.0.1
# Date: 5/14/2012
# Author: v-kaw
# Description: [Idea ID 2389] [Windows] Hang caused by kernel memory depletion due 'SystemPages' reg key with wrong value
# Rule number: 2389
# Rule URL: //sharepoint/site... |
combined_dataset/train/non-malicious/sample_62_14.ps1 | sample_62_14.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicemanagerproxy'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicemanagerproxy.dll'
# Version number of this module.
ModuleVersion = '88.1.0'
# Sup... |
combined_dataset/train/non-malicious/3701.ps1 | 3701.ps1 |
function Get-AzVMGuestPolicyStatus-VmNameScope
{
$rgName = "vivga"
$vmName = "Viv1809SDDC"
$reports = Get-AzVMGuestPolicyStatus -ResourceGroupName $rgName -VMName $vmName
Assert-NotNull $reports
Assert-True { $reports.Count -gt 0 }
}
function Get-AzVMGuestPolicyStatus-VmNameScope_Custom
{
$rg... |
combined_dataset/train/non-malicious/DefaultParameterValues_2.ps1 | DefaultParameterValues_2.ps1 | # DefaultParameters Module
# 1.3 - fixed denable/disable, added get and remove, and improved import and set
# 1.2 - added help and commands to enable/disable the defaults
# 1.0 - initial release
function Export-DefaultParameter {
#.Synopsis
# Exports the current default parameter values
[CmdletBinding()]
par... |
combined_dataset/train/non-malicious/sample_62_81.ps1 | sample_62_81.ps1 | #
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ... |
combined_dataset/train/non-malicious/sample_27_3.ps1 | sample_27_3.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 = '79.0.0'
# Supported PSEditions
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.