full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/535.ps1 | 535.ps1 |
function Add-SPONumberFieldtoList
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string] $listTitle,
[Parameter(Mandatory=$true, Position=2)]
[string] $fieldName
)
$newField = "<Field Type='Number' DisplayName='$fieldName' Name='$fieldName' required='FALSE'/>"
Add-SPOFi... |
combined_dataset/train/non-malicious/Hash Checker.ps1 | Hash Checker.ps1 | #.Synopsis
# Test the HMAC hash(es) of a file
#.Description
# Takes the HMAC hash of a file using specified algorithm, and optionally, compare it to a baseline hash
#.Example
# Test-Hash npp.5.3.1.Installer.exe -HashFile npp.5.3.1.release.md5
#
# Searches the provided hash file for a line matching the "... |
combined_dataset/train/non-malicious/List Windows File Shares.ps1 | List Windows File Shares.ps1 | Get-WmiObject Win32_Share -computerName SERVERNAME |
Select Name, Caption, Path | Export-csv "c:\\temp\\SERVERNAME.csv" -NoTypeInformation
|
combined_dataset/train/non-malicious/928.ps1 | 928.ps1 |
$resourceGroup = "myResourceGroup"
$location = "westeurope"
$vmName = "myVM"
$securePassword = ConvertTo-SecureString ' ' -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ("azureuser", $securePassword)
New-AzResourceGroup -Name $resourceGroup -Location $location
$subnetConfig = Ne... |
combined_dataset/train/non-malicious/211.ps1 | 211.ps1 |
[CmdletBinding(DefaultParameterSetName="All")]
PARAM (
[parameter(Mandatory = $true)]
$Credential,
[parameter(Mandatory = $true)]
$Vcenter,
[Parameter(mandatory=$true,ParameterSetName = "All")]
[Switch]$AllVib,
[Parameter(mandatory=$true,ParameterSetName = "VIBName")]
$VibName,
[Par... |
combined_dataset/train/non-malicious/Install-ISPackage_1.ps1 | Install-ISPackage_1.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/Issue-PendingRequest.ps1 | Issue-PendingRequest.ps1 | #####################################################################
# Issue certificate.ps1
# Version 1.5
#
# Issues certificate request from a pending request
#
# For this function to succeed, the certificate request must be pending
#
# Vadims Podans (c) 2010
# http://en-us.sysadmins.lv/
##################... |
combined_dataset/train/non-malicious/sample_19_26.ps1 | sample_19_26.ps1 | # Localized 06/28/2023 07:56 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Problembehandlung
Troubleshoot_DetectNetworkCache=Netzwerkcache von Windows Media Player wird überprüft...
Resolution_Title=Auflösung
Resolution_ResetConfiguration=Alle Konfiguration... |
combined_dataset/train/non-malicious/398.ps1 | 398.ps1 | [PSFramework.TabExpansion.TabExpansionHost]::InputCompletionTypeData['System.IO.FileInfo'] = @(
[PSCustomObject]@{
Name = 'PSChildName'
Type = ([type]'System.String')
TypeKnown = $true
},
[PSCustomObject]@{
Name = 'PSDrive'
Type = ([type]'System.Management.Automation.PSDriveInfo')
TypeKnown = $tr... |
combined_dataset/train/non-malicious/sample_21_58.ps1 | sample_21_58.ps1 | #
# Module manifest for module 'ExtensionService'
#
# Generated by: Microsoft
#
# Generated on: 04/09/2020
#
@{
# Script module or binary module file associated with this manifest.
ModuleToProcess = 'ExtensionService.psm1'
# Version number of this module.
ModuleVersion = '1.0'
# ID used to uniquely ... |
combined_dataset/train/non-malicious/627.ps1 | 627.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Version = "1.1.2"
Url = "http://freefr.dl.sourceforge.net/project/windirstat/windirstat/1.1.2%20installer%20re-release%20%28more%20languages%21%29/windirstat1_1_2_setup.exe"
Path = "$(Split-Path -Path $My... |
combined_dataset/train/non-malicious/4089.ps1 | 4089.ps1 |
[CmdletBinding()]
param
(
[switch]$Logging,
[string]$LogLocation
)
function Get-Architecture {
[CmdletBinding()][OutputType([string])]
param ()
$OSArchitecture = (Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture).OSArchitecture
Return $OSArchitecture
}
function Get-DellCommandUpd... |
combined_dataset/train/non-malicious/sample_1_30.ps1 | sample_1_30.ps1 | ConvertFrom-StringData @'
progressbar_id_crm_missingauthtypes_check=Checking CRM 4.0 web.config for missing authorizedTypes elements
progressbar_id_crm_missingauthtypes_checkdesc=Checking CRM 4.0 web.config for missing authorizedTypes elements
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQ... |
combined_dataset/train/non-malicious/sample_0_52.ps1 | sample_0_52.ps1 | ConvertFrom-StringData @'
id_surfacepro3detectconnectedstandbystatus=Detect Surface Pro 3 Connected Standby Status Issue
id_surfacepro3detectconnectedstandbystatusdesc=Detected Surface Pro 3 Connected Standby Status Issue
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEF... |
combined_dataset/train/non-malicious/format-iislog for AWStat.ps1 | format-iislog for AWStat.ps1 | param
(
[Parameter(
Mandatory=$true,
Position = 0,
ValueFromPipeline=$true,
HelpMessage="Specifies the path to the IIS *.log file to import. You can also pipe a path to Import-Iss-Log."
)]
[ValidateNotNullOrEmpty()]
[string]
$Path,
[Parameter(
Mandatory=$true,
Position = 1,
Value... |
combined_dataset/train/non-malicious/sample_47_66.ps1 | sample_47_66.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.a... |
combined_dataset/train/non-malicious/3638.ps1 | 3638.ps1 |
function Test-CreateAndUpdateVirtualNetworkRule
{
$location = "East US 2"
$rg = Create-ResourceGroupForTest $location
$server = Create-ServerForTest $rg $location
$virtualNetworkRuleName = Get-VirtualNetworkRuleName
$vnetName1 = "vnet1"
$virtualNetwork1 = CreateAndGetVirtualNetwork $rg $vnetNam... |
combined_dataset/train/non-malicious/sample_11_49.ps1 | sample_11_49.ps1 | ConvertFrom-StringData @'
id_ctsdnsserver=DNS Server
id_ctsdnsserverdescription=Collects information about DNS Server.
'@
# SIG # Begin signature block
# MIIoOAYJKoZIhvcNAQcCoIIoKTCCKCUCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAI... |
combined_dataset/train/non-malicious/669.ps1 | 669.ps1 |
Describe "Out-RsCatalogItem" {
Context "Out-RsCatalogItem with min parameters"{
$folderName = 'SutOutRsCatalogItem_MinParameters' + [guid]::NewGuid()
New-RsFolder -Path / -FolderName $folderName
$folderPath = '/' + $folderName
... |
combined_dataset/train/non-malicious/sample_13_21.ps1 | sample_13_21.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.AppConfiguration.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Module]::Instance
# Export nothing to clear i... |
combined_dataset/train/non-malicious/DriveSpace_1.format.ps1xml.ps1 | DriveSpace_1.format.ps1xml.ps1 | <?xml version="1.0" encoding="utf-8" ?>
<Configuration>
<ViewDefinitions>
<View>
<Name>SpaceGraph</Name>
<ViewSelectedBy>
<TypeName>System.Management.ManagementObject#root\\cimv2\\Win32_LogicalDisk</TypeName>
</ViewSelectedBy>
<WideControl>
... |
combined_dataset/train/non-malicious/958.ps1 | 958.ps1 |
$uniqueId=$(-join ((97..122) + (48..57) | Get-Random -Count 15 | % {[char]$_}))
$apiVersion = "2015-04-08"
$location = "West US 2"
$resourceGroupName = "MyResourceGroup"
$accountName = "mycosmosaccount-$uniqueId"
$apiType = "MongoDB"
$accountResourceType = "Microsoft.DocumentDb/databaseAccounts"
$databaseName = "... |
combined_dataset/train/non-malicious/Get-Gender.ps1 | Get-Gender.ps1 | function get-gender {
param([string]$name)
if($name.Length -lt 2) { throw "You need at least two letters in the name" }
$name = "$($name[0])".ToUpper() + $name.SubString(1).ToLower()
$page = get-web "http://www.babynameaddicts.com/cgi-bin/search.pl?gender=ALL;searchfield=Names;origins=ALL;search... |
combined_dataset/train/non-malicious/sample_0_53.ps1 | sample_0_53.ps1 | #************************************************
# DC_DFSServer-Component.ps1
# Version x
# Date: 20022
# Author: WalterE
# Description: Collects information about DFS Server.
# Called from: Networking Diags
#*******************************************************
Trap [Exception]
{
# Handle exception a... |
combined_dataset/train/non-malicious/sample_51_8.ps1 | sample_51_8.ps1 | function trySetDesignerProp(tname, ttype, val) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0);
trait.value = val;
}
if (command.getTrait("state").value == 0) {
command.getTrait("state").value = 2;
trySetDesignerProp("embedMedia", "bool", true);
}
else {
command.get... |
combined_dataset/train/non-malicious/sample_0_57.ps1 | sample_0_57.ps1 | ConvertFrom-StringData @'
id_lockingkb296264check=Checking Opportunistic Locking
id_lockingkb296264checkdesc=Checking if Opportunistic Locking is disabled
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFl... |
combined_dataset/train/non-malicious/Convert-BounceToX_6.ps1 | Convert-BounceToX_6.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/sample_41_8.ps1 | sample_41_8.ps1 | # Localized 05/07/2022 03:57 AM (GMT) 303:7.0.30723 MSFT_ScriptResourceStrings.psd1
# Localized MSFT_ScriptResourceStrings.psd1
ConvertFrom-StringData @'
###PSLOC
SetScriptWhatIfMessage=Executing the SetScript with the user supplied credential
InValidResultFromGetScriptError=Failure to get the results from the ... |
combined_dataset/train/non-malicious/Reflection.ps1 | Reflection.ps1 | #requires -version 2.0
#History:
# 1.0 - First public release (March 19, 2010)
function Get-Type {
<#
.Synopsis
Gets the types that are currenty loaded in .NET,
or gets information about a specific type
.Description
Gets all of the loaded types, or gets the possible valu... |
combined_dataset/train/non-malicious/sample_54_79.ps1 | sample_54_79.ps1 | #
# Module manifest for module 'OCI.PSModules.Audit'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Audit.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/3436.ps1 | 3436.ps1 |
function Upload-ModuleToStorage (
[hashtable] $storage,
[string] $modulePath,
[string] $moduleName) {
Write-Verbose "Uploading module '$moduleName' to Storage container..."
$zipName = "$moduleName.zip"
$now = Get-Date
$context = (Get-AzSt... |
combined_dataset/train/non-malicious/sample_64_51.ps1 | sample_64_51.ps1 | #
# Module manifest for module 'OCI.PSModules.Objectstorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Objectstorage.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_36_73.ps1 | sample_36_73.ps1 | [CmdletBinding()]
param
(
[Parameter(Mandatory)]
[string]$PullRequestNumber,
[Parameter()]
[string]$Base="master",
[Parameter()]
[bool]$Force
)
$PSModuleAutoLoadingPreference = "ModuleQualified"
Function Test-Empty
{
[CmdletBinding()]
[Output... |
combined_dataset/train/non-malicious/3986.ps1 | 3986.ps1 |
function ServiceBusTests {
$location = Get-Location
$resourceGroupName = getAssetName "RGName-"
$namespaceName = getAssetName "Namespace1-"
$namespaceName2 = getAssetName "Namespace2-"
Write-Debug "Create resource group"
New-AzResourceGroup -Name $resourceGroupName -... |
combined_dataset/train/non-malicious/LetterDiamondOneliner v_1.ps1 | LetterDiamondOneliner v_1.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_45_27.ps1 | sample_45_27.ps1 | #
# Module manifest for module 'OCI.PSModules.Stackmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Stackmonitoring.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_0_82.ps1 | sample_0_82.ps1 | ConvertFrom-StringData @'
id_windowsexplorerdatfiles_title=Windows Explorer DAT files
id_windowsexplorerdatfiles_status=Collecting Windows Explorer DAT files
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7... |
combined_dataset/train/non-malicious/4264.ps1 | 4264.ps1 | $scriptblock =
{
function Invoke-MS16-032
{
Param(
[Parameter(ParameterSetName = "CustomCommand", Position = 0)]
[String]
$Command
)
Set-StrictMode -Version 2
$RemoteScriptBlock = {
[CmdletBinding()]
Param(
[Parameter(Position = 0, Mandatory = $true)]
[String]
$PEBytes64,
[Parameter(... |
combined_dataset/train/non-malicious/sample_36_34.ps1 | sample_36_34.ps1 | #
# Module manifest for module 'OCI.PSModules.Computeinstanceagent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computeinstanceagent.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# S... |
combined_dataset/train/non-malicious/3058.ps1 | 3058.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Should -BeLikeExactly" {
It "passes for things that are like wildcard" {
"foobar" | Should BeLikeExactly "*ob*"
"foobar" | Should -BeLikeExactly "*ob*"
}
It "fails for strings with different case" {
... |
combined_dataset/train/non-malicious/332.ps1 | 332.ps1 | function Join-PSFPath
{
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, Position = 0)]
[string]
$Path,
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]
$Child,
[switch]
$Normalize
)
$resultingPath = $Path
foreach ($childItem in $Child)
{
$resultingPath = Join-Path -... |
combined_dataset/train/non-malicious/sample_52_33.ps1 | sample_52_33.ps1 | Signature-Version: 1.0
Created-By: 11.0.13 (International Business Machines Corporation)
SHA-256-Digest-Manifest: g+UjU8HFDwbcF869hkPbD+QHCDacpIUf+jrrWD590dY=
SHA-256-Digest-Manifest-Main-Attributes: 2GCh4hVSk7LMD6jJ6Wz6tSFItKBBP+R
GYac2e5zx7QU=
Name: plugin.xml
SHA-256-Digest: HS4k5kzk7m0pjUQJvLR9k++EVmv2eb/w... |
combined_dataset/train/non-malicious/sample_19_34.ps1 | sample_19_34.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 = '75.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_23_55.ps1 | sample_23_55.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Get-AMTEventLog {
<#
.Synopsis
Returns the Intel Active Management Technology event log.
.Description
This Cmdlet returns the Intel Active Management Technology(AMT) event log from clients that have Intel AMT firmware versi... |
combined_dataset/train/non-malicious/sample_15_1.ps1 | sample_15_1.ps1 | /*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
define("vs/languages/typescript/lib/typescriptServices.nls.keys",[],{});
// SIG // Begin signature block
// SIG // MIIjiAYJKoZIhvcNAQ... |
combined_dataset/train/non-malicious/sample_4_74.ps1 | sample_4_74.ps1 | #
# Module manifest for module 'OCI.PSModules.Visualbuilder'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Visualbuilder.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/Workstation_users Matrix.ps1 | Workstation_users Matrix.ps1 | ####################################################################
#
#Script will list all selected workstations and currently logged on user.
#Results will be output to a file. A query can be placed on a previous search.
#Currently script only works when run directly from a DC
#Author: Adam Liquorish
#Date: ... |
combined_dataset/train/non-malicious/sample_39_15.ps1 | sample_39_15.ps1 | #
# Module manifest for module 'OCI.PSModules.Monitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Monitoring.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/468.ps1 | 468.ps1 | Write-Host "Installing Pester" -ForegroundColor Cyan
Install-Module Pester -Force -SkipPublisherCheck
Write-Host "Installing PSScriptAnalyzer" -ForegroundColor Cyan
Install-Module PSScriptAnalyzer -Force -SkipPublisherCheck
Write-Host "Installing latest PackageManagement" -ForegroundColor Cyan
Install-Module PackageMan... |
combined_dataset/train/non-malicious/sample_27_27.ps1 | sample_27_27.ps1 | #
# Module manifest for module 'OCI.PSModules.Accessgovernancecp'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Accessgovernancecp.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Suppo... |
combined_dataset/train/non-malicious/2547.ps1 | 2547.ps1 |
$erroractionpreference = "SilentlyContinue"
$a = New-Object -comobject Excel.Application
$a.visible = $True
$b = $a.Workbooks.Add()
$c = $b.Worksheets.Item(1)
$ColHeaders = ("DBName", "addl_loan_data", "appraisal", "borrower", "br_address",
"br_expense", "br_income", "br_liability", "br_REO",
"channels... |
combined_dataset/train/non-malicious/sample_58_15.ps1 | sample_58_15.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeai'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeai.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_61_36.ps1 | sample_61_36.ps1 | #
# Module manifest for module 'OCI.PSModules.Analytics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Analytics.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/Pause.ps1 | Pause.ps1 | ## Pause (aka Pause-Script)
## Pause the script and wait for user action
###################################################################################################
## Parameters (are all OPTIONAL)
## Message - the message to use as the prompt to the user
## ReturnKey - when present, the scri... |
combined_dataset/train/non-malicious/sample_7_50.ps1 | sample_7_50.ps1 | function GetSuccessAsEnumType
{
param (
$result
)
if($null -eq $result) {
return [Microsoft.AzureStack.ArcHci.Ubercrud.Observability.Events.EventConstants+Status]::SKIPPED
}
elseif($true -eq $result) {
return [Microsoft.AzureStack.ArcHci.Ubercrud.Observability.Event... |
combined_dataset/train/non-malicious/sample_57_95.ps1 | sample_57_95.ps1 | $global:VerbosePreference = 'Continue'
Function Write-Custom-Output
{
Param([string]$message)
$date = Get-Date
$newMessage = '[{0}] {1}' -f $date, $message
Write-Output $newMessage
}
trap [Exception]
{
Write-Custom-Output "WARN: Terminating error encountered on line $($_.Invoc... |
combined_dataset/train/non-malicious/sample_4_53.ps1 | sample_4_53.ps1 | #************************************************
# DC_BackgroundCollector.ps1
# Version 2.0.0
# Date: 9-23-2011
# Author: Patrick Lewis - patlewis@microsoft.com
# Description: This script compresses and collects background process file
#************************************************
PARAM($process=$null, $fil... |
combined_dataset/train/non-malicious/2822.ps1 | 2822.ps1 | Function Start-StatsToGraphite
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory = $false)]
[switch]$TestMode,
[switch]$ExcludePerfCounters = $false,
[switch]$SqlMetrics = $false
)
$Config = Import-XMLConfig -ConfigPath $configPath
$sleep = 0
... |
combined_dataset/train/non-malicious/sample_39_22.ps1 | sample_39_22.ps1 | "use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Debug = void 0;
const switch_1 = require("../switch");
class Debug extends switch_1.Switch {
switch = 'debug';
}
exports.Debug = Debug;
//# sourceMappingURL... |
combined_dataset/train/non-malicious/ConvertTo-MultiArray_1.ps1 | ConvertTo-MultiArray_1.ps1 | function ConvertTo-MultiArray {
<#
.Notes
NAME: ConvertTo-MultiArray
AUTHOR: Tome Tanasovski
Website: http://powertoe.wordpress.com
Twitter: http://twitter.com/toenuff
Version: 1.1
CREATED: 11/5/2010
LASTEDIT:
11/5/2010 1.0
Initial Release
11/5/2010 1.1
Removed array parameter and passes a ... |
combined_dataset/train/non-malicious/sample_33_1.ps1 | sample_33_1.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#####################################################################################################
#
# Registers the WinRM endpoint for this instance of PowerShell.
#
# If the parameters '-PowerShellHome' were specified, it means that t... |
combined_dataset/train/non-malicious/sample_55_9.ps1 | sample_55_9.ps1 | # ---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------------------------... |
combined_dataset/train/non-malicious/sample_17_67.ps1 | sample_17_67.ps1 | #
# Module manifest for module 'OCI.PSModules.Logging'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Logging.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_1_65.ps1 | sample_1_65.ps1 | #************************************************
# TS_AdapterKB980486Check.ps1
# Version 1.0
# Date: 11-8-2011
# Author: v-anecho
# Description: It was detected that the number of 6to4 adapters exceeded the number of physical network adapters on this computer. This may be a symptom of the issue described in KB98... |
combined_dataset/train/non-malicious/sample_29_48.ps1 | sample_29_48.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 = '79.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_29_64.ps1 | sample_29_64.ps1 | #
# Module manifest for module 'OCI.PSModules.Nosql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Nosql.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/479.ps1 | 479.ps1 |
function New-TreeObjectArray{
param(
$Array,
$Objects,
$Attribute,
$Filter,
$Level = 0,
$MaxLoops = 10
)
$Objects = $Objects.psobject.Copy()
if( -not ($Level -eq $MaxLoops)){
$Level++
... |
combined_dataset/train/non-malicious/Save-Credentials_3.ps1 | Save-Credentials_3.ps1 | <#
.SYNOPSIS
The script saves a username and password, encrypted with a custom key to to a file.
.DESCRIPTION
The script saves a username and password, encrypted with a custom key to to a file. The key is coded into the script but should be changed before use. The key allows the password to be decrypted ... |
combined_dataset/train/non-malicious/876.ps1 | 876.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests', ''
. "$here\$sut"
$clusterName = $ENV:ClusterName
$httpUserPassword = $ENV:HttpPassword
$securePassword = ConvertTo-SecureString $httpUserPassword -AsPlainText -Force
$creds = New-Object -... |
combined_dataset/train/non-malicious/2802.ps1 | 2802.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT DISTINCT
CreationDate,
ProcessId,
ParentProcessId,
CommandLine,
PSComputerName
FROM
*ProcsWMI.tsv
ORDER BY
PSComputerName,
CreationDate,
ProcessId ASC
"@
& logparser -stat... |
combined_dataset/train/non-malicious/2798.ps1 | 2798.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(FullName) as CT,
FullName
FROM
*PrefetchListing.tsv
GROUP BY
FullName
ORDER BY
ct
"@
& logparser -stats:off -i:csv -fixedsep:on -dtlines:0 -rtp:-1 $lpquery
} else {
$ScriptName = [System.... |
combined_dataset/train/non-malicious/2136.ps1 | 2136.ps1 |
Describe "Range Operator" -Tags CI {
Context "Range integer operations" {
It "Range operator generates arrays of integers" {
$Range = 5..8
$Range.count | Should -Be 4
$Range[0] | Should -BeOfType [int]
$Range[1] | Should -BeOfType [int]
$Range[2]... |
combined_dataset/train/non-malicious/sample_16_9.ps1 | sample_16_9.ps1 | #************************************************
# TS_HPZ12ServiceCheck.ps1
# Version 1.0
# Date: 1-11-2011
# Author: v-anecho
# Description: Checks if 'Net Driver HPZ12' or 'Pml Driver HPZ12' is one of the installed services and startup type is something different than Disabled
#********************************... |
combined_dataset/train/non-malicious/1849.ps1 | 1849.ps1 |
Describe "Remove-Module -Name | -FullyQualifiedName | -ModuleInfo" -Tags "CI" {
BeforeAll {
Remove-Module -Name "Foo", "Bar", "Baz" -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Path "$testdrive\Modules\Foo\1.0\" -Force > $null
New-Item -ItemType Directory -Path "$testdrive... |
combined_dataset/train/non-malicious/sample_24_48.ps1 | sample_24_48.ps1 | # ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apach... |
combined_dataset/train/non-malicious/sample_14_45.ps1 | sample_14_45.ps1 |
. ./contrib/cirrus/win-lib.ps1
# Targets
function Podman-Remote{
New-Item -ItemType Directory -Force -Path "./bin/windows"
$buildInfo = Get-Date -UFormat %s -Millisecond 0
$buildInfo = "-X github.com/containers/podman/v4/libpod/define.buildInfo=$buildInfo "
$commit = Git-Commit
$commit = "-X gith... |
combined_dataset/train/non-malicious/665.ps1 | 665.ps1 |
Describe "Get-RsFolderContent" {
Context "Get folder with ReportServerUri parameter"{
$folderName = 'SutGetFolderReportServerUriParameter' + [guid]::NewGuid()
New-RsFolder -Path / -FolderName $folderName
$folderPath = '/' + $folderName
$reportServerUri = 'http://... |
combined_dataset/train/non-malicious/sample_35_23.ps1 | sample_35_23.ps1 | #
# Module manifest for module 'OCI.PSModules.Monitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Monitoring.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_26_10.ps1 | sample_26_10.ps1 | #
# Module manifest for module 'OCI.PSModules.Devops'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Devops.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_60_87.ps1 | sample_60_87.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_30_34.ps1 | sample_30_34.ps1 | #
# Module manifest for module 'OCI.PSModules.Aivision'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aivision.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/PowerBoots Gadgets.ps1 | PowerBoots Gadgets.ps1 | $gadgetWindow = @{
# Transparency, WindowStyle, and background work together
# to get rid of the standard window's chrome and make the window "irregular" shaped
# that is, the window will be the shape of it's content.
AllowsTransparency = $True
WindowStyle = "None"
Background = "Transparent"
... |
combined_dataset/train/non-malicious/345.ps1 | 345.ps1 | function Register-PSFConfigValidation
{
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFConfigValidation')]
Param (
[Parameter(Mandatory = $true)]
[string]
$Name,
[Parameter(Mandatory = $true)]
[ScriptBlock]
$ScriptBlock
)
[PSFramework.Configuratio... |
combined_dataset/train/non-malicious/3831.ps1 | 3831.ps1 |
function RelayAuthTests
{
$location = "West US"
$resourceGroupName = getAssetName
$namespaceName = getAssetName "Relay-NS"
$wcfRelayName = getAssetName "Relay-WcfR"
$HybridConnectionsName = getAssetName "Relay-HybrdCon"
$authRuleName = getAssetName "Relay-NSAuthoRule"
$WcfRelayAuthRul... |
combined_dataset/train/non-malicious/134.ps1 | 134.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory = $true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checkin... |
combined_dataset/train/non-malicious/sample_28_76.ps1 | sample_28_76.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/Get-PageUrls.ps1 | Get-PageUrls.ps1 | ##############################################################################\n##\n## Get-PageUrls\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nParse all of th... |
combined_dataset/train/non-malicious/sample_22_29.ps1 | sample_22_29.ps1 | # region Generated
# ----------------------------------------------------------------------------------
# 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 obt... |
combined_dataset/train/non-malicious/sample_16_42.ps1 | sample_16_42.ps1 | <#
.SYNOPSIS
Deploys a Service Fabric application type to a cluster.
.DESCRIPTION
This script deploys a Service Fabric application type to a cluster. It is invoked by Visual Studio when deploying a Service Fabric Application project.
.NOTES
WARNING: This script file is invoked by Visual Studio. Its paramet... |
combined_dataset/train/non-malicious/247.ps1 | 247.ps1 | function Remove-StringSpecialCharacter
{
[CmdletBinding()]
param
(
[Parameter(ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[Alias('Text')]
[System.String[]]$String,
[Alias("Keep")]
[String[]]$SpecialCharacterToKeep
)
PROCESS
{
... |
combined_dataset/train/non-malicious/2958.ps1 | 2958.ps1 | Task default -Depends TaskA
Task TaskA -Depends TaskB {
"Task - A"
}
Task TaskB -Depends TaskC -ContinueOnError {
"Task - B"
throw "I failed on purpose!"
}
Task TaskC {
"Task - C"
}
|
combined_dataset/train/non-malicious/sample_31_95.ps1 | sample_31_95.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=找不到必要的 PowerShell 模組 (FailoverClusters)。請使用角色與功能工具來安裝: 遠端伺服器管理工具 | 功能管理工具 | 容錯移轉叢集工具 | Windows PowerShell 的容錯移轉叢集模組。
'@
# SIG # Begin signature block
# MIIn0AYJKoZIhvcNAQcCoIInwTCCJ70CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeM... |
combined_dataset/train/non-malicious/out-form with sort colum_2.ps1 | out-form with sort colum_2.ps1 | # I think OUT-FORM is a very usefull function. I've added code to sort columns by clicking on headers.
# You nedd just add the columnTag parameters specifing if colunm value is text or numeric:
# out-form -data (get-process) -columnNames ("Name", "ID" ) -columnProperties ("Name", "ID") -columnTag ("Text", "Numeri... |
combined_dataset/train/non-malicious/New-CustomColumn (V1.0).ps1 | New-CustomColumn (V1.0).ps1 | # Function New-CustomColumn for PowerShell V1.0
#
# Helper function to create Custom Columns for select or format cmdlets
# for more info and examples see :
# http://thepowershellguy.com/blogs/posh/archive/2009/01/26/new-customcolumn-function-powershell-v1-0.aspx
#
# /\\/\\o\\/\\/ 2008
# http://thePowerShellGuy.... |
combined_dataset/train/non-malicious/sample_31_69.ps1 | sample_31_69.ps1 | @{
GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Start-Transcript", "Stop-Transcript"
AliasesTo... |
combined_dataset/train/non-malicious/sample_58_23.ps1 | sample_58_23.ps1 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apa... |
combined_dataset/train/non-malicious/Start-Elevated.ps1 | Start-Elevated.ps1 | #function Start-Elevated {
param ($app)
$psi = new-object "System.Diagnostics.ProcessStartInfo"
$psi.FileName = $app;
$psi.Arguments = [string]$args;
$psi.Verb = "runas";
[System.Diagnostics.Process]::Start($psi)
#}
|
combined_dataset/train/non-malicious/sample_61_66.ps1 | sample_61_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Recovery'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Recovery.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/Snippet Compiler_3.ps1 | Snippet Compiler_3.ps1 | $def = $(if ((gi .).FullName -eq (gi .).Root) {
([string](gi .).Root).TrimEnd("\\")
}
else { (gi .).FullName }
)
##################################################################################################
function Get-CursorPoint {
$x = $rtbEdit.SelectionStart - $... |
combined_dataset/train/non-malicious/sample_5_55.ps1 | sample_5_55.ps1 | #************************************************
# DC_Setup_Addons.ps1
# Version 1.1
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects additional Setup information.
# Called from: TS_AutoAddCommands_Setup.ps1
#*******************************************************
Param... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.