full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_9_45.ps1 | sample_9_45.ps1 | #************************************************
# TS_DisablePagingExecutiveCheck.ps1
# Version 1.0.1
# Date: 7/16/2013
# Author: v-maam
# Description: [Idea ID 8012] [Windows] SDP-UDE check for reg key DisablePagingExecutive
# Rule number: a0827633-6742-40cf-be40-e6de772a4e2f
# Rule URL: https://kse.microso... |
combined_dataset/train/non-malicious/sample_41_69.ps1 | sample_41_69.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... |
combined_dataset/train/non-malicious/4308.ps1 | 4308.ps1 |
if($PSEdition -eq 'Core')
{
Write-Verbose 'uiProxy is not supported on PowerShell Core Edition'
return
}
$source = @"
using System;
using System.Collections.Generic;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
using System.Management.Automation.Host;
namespace HostUIPro... |
combined_dataset/train/non-malicious/2435.ps1 | 2435.ps1 | function Enable-DynamicDnsRegistration
{
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$ComputerName,
[Parameter()]
[ValidateNotNullOrEmpty()]
[pscredential]$Credential
)
$icmParams = @{
'ComputerName' = $ComputerName
}
if ($PSBoundParameters.ContainsKey('C... |
combined_dataset/train/non-malicious/sample_39_11.ps1 | sample_39_11.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Invoke-AMTForceBoot {
<#
.Synopsis
Invokes the Intel Active Management Technology force boot command
.Description
This CmdLet invokes an Intel Active Management Technology (AMT) force boot to a PXE server, the local hard ... |
combined_dataset/train/non-malicious/562.ps1 | 562.ps1 |
function Add-SPOChoiceFieldtoList
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string] $listTitle,
[Parameter(Mandatory=$true, Position=2)]
[string] $fieldName,
[Parameter(Mandatory=$true, Position=3)]
[string] $values
)
$options = ""
$valArray = $values.Split... |
combined_dataset/train/non-malicious/sample_42_19.ps1 | sample_42_19.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_5_23.ps1 | sample_5_23.ps1 | ConvertFrom-StringData @'
id_rpcunauthenticatedsessions_sd=RPC is set to Restrict Unauthenticated RPC client session setups
'@
# SIG # Begin signature block
# MIIoKQYJKoZIhvcNAQcCoIIoGjCCKBYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAI... |
combined_dataset/train/non-malicious/Get-Parameter_4.ps1 | Get-Parameter_4.ps1 | function Get-Parameter ( $Cmdlet, [switch]$ShowCommon ) {
foreach ($paramset in (Get-Command $Cmdlet).ParameterSets){
$Output = @()
foreach ($param in $paramset.Parameters) {
if ( !$ShowCommon ) {
if ($param.aliases -match "vb|db|ea|wa|ev|wv|ov|ob") { continue }
}
$process = "" | Select-Object ... |
combined_dataset/train/non-malicious/4422.ps1 | 4422.ps1 | function New-ScriptFileInfo
{
[CmdletBinding(PositionalBinding=$false,
SupportsShouldProcess=$true,
HelpUri='https://go.microsoft.com/fwlink/?LinkId=619792')]
Param
(
[Parameter(Mandatory=$false,
Position=0,
ValueFromPi... |
combined_dataset/train/non-malicious/1243.ps1 | 1243.ps1 |
if( -not (Test-CTypeDataMember -TypeName 'System.IO.FileInfo' -MemberName 'GetCarbonFileInfo') )
{
Write-Timing ('Updating System.IO.FileInfo type data (GetCarbonFileInfo).')
Update-TypeData -TypeName 'System.IO.FileInfo' -MemberType ScriptMethod -MemberName 'GetCarbonFileInfo' -Value {
param(
... |
combined_dataset/train/non-malicious/VMware Lab Manager _1.x.ps1 | VMware Lab Manager _1.x.ps1 | function Ignore-SslErrors {
# Create a compilation environment
$Provider=New-Object Microsoft.CSharp.CSharpCodeProvider
$Compiler=$Provider.CreateCompiler()
$Params=New-Object System.CodeDom.Compiler.CompilerParameters
$Params.GenerateExecutable=$False
$Params.GenerateInMemory=$True
$Params.IncludeDebugIn... |
combined_dataset/train/non-malicious/sample_30_23.ps1 | sample_30_23.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\resolve@1.22.8\node_modules\resolve\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\resolve@... |
combined_dataset/train/non-malicious/Colorize Subversion SVN_1.ps1 | Colorize Subversion SVN_1.ps1 | ## SVN STAT colorizer - http://www.overset.com/2008/11/18/colorized-subversion-svn-stat-powershell-function/
function ss () {
$c = @{ "A"="Magenta"; "D"="Red"; "C"="Yellow"; "G"="Blue"; "M"="Cyan"; "U"="Green"; "?"="DarkGray"; "!"="DarkRed" }
foreach ( $svno in svn stat ) {
@@ $color = $c[$svno.SubString(0,1).... |
combined_dataset/train/non-malicious/sample_60_85.ps1 | sample_60_85.ps1 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... |
combined_dataset/train/non-malicious/_4.168.1.1.ps1 | _4.168.1.1.ps1 | function Set-IPAddress {
param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"),
[string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"),
[string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"),
[string]$gateway = $(read-host "Enter... |
combined_dataset/train/non-malicious/390.ps1 | 390.ps1 | Describe "Validating the module manifest" {
$moduleRoot = (Resolve-Path "$PSScriptRoot\..\..").Path
$manifest = ((Get-Content "$moduleRoot\PSFramework.psd1") -join "`n") | Invoke-Expression
Context "Basic resources validation" {
$files = Get-ChildItem "$moduleRoot\functions" -Recurse -File -Filter "*.ps1"
It "Ex... |
combined_dataset/train/non-malicious/sample_23_91.ps1 | sample_23_91.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function get-AMTMPSStatus {
<#
.Synopsis
Returns the status of the Intel Fast Call for Help Management Presence Server (MPS) interface settings
.Description
Returns the status of the Intel Fast Call for Help Management Presence Se... |
combined_dataset/train/non-malicious/sample_5_11.ps1 | sample_5_11.ps1 | <#
.SYNOPSIS
Biztalk Integration module for collecting traces
.DESCRIPTION
Define ETW traces for Windows Biztalk Integration components
Add any custom tracing functinaliy for tracing Biztalk components
For Developers:
1. Component test: .\TSS.ps1 -Start -INT_TEST1
2. Scenario test: .\TSS.ps1 -start -Sc... |
combined_dataset/train/non-malicious/1274.ps1 | 1274.ps1 |
function Get-CIisMimeMap
{
[CmdletBinding(DefaultParameterSetName='ForWebServer')]
[OutputType([Carbon.Iis.MimeMap])]
param(
[Parameter(Mandatory=$true,ParameterSetName='ForWebsite')]
[string]
$SiteName,
[Parameter(ParameterSetName='ForWebsite')]
... |
combined_dataset/train/non-malicious/2113.ps1 | 2113.ps1 |
Describe 'Tests for lossless rehydration of serialized types.' -Tags 'CI' {
BeforeAll {
$cmdBp = Set-PSBreakpoint -Command Get-Process
$varBp = Set-PSBreakpoint -Variable ?
$lineBp = Set-PSBreakpoint -Script $PSScriptRoot/PSSerializer.Tests.ps1 -Line 1
function ShouldRehydrateLos... |
combined_dataset/train/non-malicious/sample_42_57.ps1 | sample_42_57.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/chkhash_18.ps1 | chkhash_18.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... |
combined_dataset/train/non-malicious/sample_29_59.ps1 | sample_29_59.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudbridge'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudbridge.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/Get-User.ps1 | Get-User.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/502.ps1 | 502.ps1 |
function Get-File{
[CmdletBinding()]
param(
[Parameter( Mandatory=$true)]
[String]
$Url,
[Parameter( Mandatory=$false)]
[String]
$Path,
[Switch]
$Force
)
begin {
$WebClient = New-Object System.Net.WebClient
$Global:Downl... |
combined_dataset/train/non-malicious/3423.ps1 | 3423.ps1 |
function Test-AzureLocation
{
$providerLocations = Get-AzureRmLocation
Assert-True { $providerLocations.Count -gt 0 }
foreach ($location in $providerLocations)
{
Assert-True { $location.Providers.Count -gt 0 }
}
} |
combined_dataset/train/non-malicious/Test if file is writable_1.ps1 | Test if file is writable_1.ps1 | function Test-IsWritable(){
<#
.Synopsis
Command tests if a file is present and writable.
.Description
Command to test if a file is writeable. Returns true if file can be opened for write access.
.Example
Test-IsWritable -path $foo
Test if file $foo is accesible for write a... |
combined_dataset/train/non-malicious/489.ps1 | 489.ps1 |
function Get-PathAndFilename{
[CmdletBinding()]
param(
[Parameter( Mandatory=$true)]
[String]
$Path
)
$Path = [System.Environment]::ExpandEnvironmentVariables($Path)
if($Path.contains("$")){
$Path = Invoke-Expression "`"$Path`""
}
if($Path.StartsWith("\... |
combined_dataset/train/non-malicious/1499.ps1 | 1499.ps1 |
function Assert-Empty
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[object]
$InputObject,
[Parameter(Position=1)]
[string]
$Message
)
Set-StrictMode -Version 'Latest'
if( $InputObject -eq $null )
{
... |
combined_dataset/train/non-malicious/sample_3_14.ps1 | sample_3_14.ps1 | <#
.SYNOPSIS
MSRD-Collect framework functions
.DESCRIPTION
Module for the MSRD-Collect framework functions
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedback : https://aka.ms/MSRD-Collect-Feedback
#>
if (!($global:msr... |
combined_dataset/train/non-malicious/sample_43_53.ps1 | sample_43_53.ps1 | #
# Module manifest for module 'OCI.PSModules.Ospgateway'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ospgateway.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_26_75.ps1 | sample_26_75.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudbridge'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudbridge.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/2709.ps1 | 2709.ps1 |
[CmdletBinding()]
Param(
[Parameter(Mandatory=$False,Position=0)]
[ValidateSet("MD5","SHA1","SHA256","SHA384","SHA512","RIPEMD160")]
[string]$HashType = "SHA256",
[Parameter(Mandatory=$True,Position=1)]
[string[]]$Paths = @("C:\Windows\*\xwizard.exe", "C:\users\*\AppData\Roamin... |
combined_dataset/train/non-malicious/4415.ps1 | 4415.ps1 | function Update-ModuleManifest
{
[CmdletBinding(SupportsShouldProcess=$true,
PositionalBinding=$false,
HelpUri='https://go.microsoft.com/fwlink/?LinkId=619311')]
Param
(
[Parameter(Mandatory=$true,
Position=0,
ValueFrom... |
combined_dataset/train/non-malicious/Convert Raw SID to SID.ps1 | Convert Raw SID to SID.ps1 | #For intel concerning how to convert raw hex SID to Standard SID got to
#http://blogs.msdn.com/b/oldnewthing/archive/2004/03/15/89753.aspx
#to convert Hex to Dec
function Convert-HEXtoDEC
{
param($HEX)
ForEach ($value in $HEX)
{
[string][Convert]::ToInt32($value,16)
}
}
#to reassort decimal values to co... |
combined_dataset/train/non-malicious/sample_6_84.ps1 | sample_6_84.ps1 | if($OSVersion.Major -ge 6)
{
$EventLogNames ="Microsoft-Windows-TaskScheduler/Operational",
"Microsoft-Windows-TaskScheduler/Debug",
"Microsoft-Windows-TaskScheduler/Diagnostic",
"Microsoft-Windows-TaskScheduler/Maintenance"
$OutputFormats = "TXT", "CSV", "EVTX"
.\TS_GetEvents.ps1 -EventLogName... |
combined_dataset/train/non-malicious/sample_24_96.ps1 | sample_24_96.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 = '80.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/Measure-CommandPerforman.ps1 | Measure-CommandPerforman.ps1 | ##############################################################################\n##\n## Measure-CommandPerformance\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\... |
combined_dataset/train/non-malicious/sample_62_5.ps1 | sample_62_5.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_67_96.ps1 | sample_67_96.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 = '86.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/2833.ps1 | 2833.ps1 |
[cmdletbinding()]
param(
[Parameter(Position = 0, Mandatory = $false)]
[string]$buildFile,
[Parameter(Position = 1, Mandatory = $false)]
[string[]]$taskList = @(),
[Parameter(Position = 2, Mandatory = $false)]
[string]$framework,
[Parameter(Position = 3, Mandatory = $false)]
[sw... |
combined_dataset/train/non-malicious/2417.ps1 | 2417.ps1 |
[CmdletBinding(DefaultParameterSetName = 'name')]
[OutputType('System.Management.Automation.PSCustomObject')]
param (
[Parameter(ParameterSetName = 'name',
Mandatory,
ValueFromPipeline,
ValueFromPipelineByPropertyName)]
[ValidateSet("Tom","Dick","Jane")]
[ValidateRange(21,65)]
[ValidateScript({Test-Path $_ -... |
combined_dataset/train/non-malicious/2017.ps1 | 2017.ps1 |
function Test-ResourceStrings
{
param ( $AssemblyName, $ExcludeList )
$repoBase = (Resolve-Path (Join-Path $psScriptRoot ../../../..)).Path
$asmBase = Join-Path $repoBase "src/$AssemblyName"
$resourceDir = Join-Path $asmBase resources
$resourceFiles = Get-ChildItem $resourceDir -Filter ... |
combined_dataset/train/non-malicious/sample_64_93.ps1 | sample_64_93.ps1 | @{
GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
FunctionsToExport = @()
CmdletsToExport = "Get-Acl", "Set-Acl", "G... |
combined_dataset/train/non-malicious/sample_32_54.ps1 | sample_32_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Emaildataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emaildataplane.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSE... |
combined_dataset/train/non-malicious/3269.ps1 | 3269.ps1 |
class ApprovalCommandConfiguration {
[string]$Expression
[System.Collections.ArrayList]$ApprovalGroups
[bool]$PeerApproval
ApprovalCommandConfiguration() {
$this.Expression = [string]::Empty
$this.ApprovalGroups = New-Object -TypeName System.Collections.ArrayList
$this.PeerAppr... |
combined_dataset/train/non-malicious/Test-Prompt_2.ps1 | Test-Prompt_2.ps1 | $choices = [System.Management.Automation.Host.ChoiceDescription[]](
(New-Object System.Management.Automation.Host.ChoiceDescription "&Yes","Choose me!"),
(New-Object System.Management.Automation.Host.ChoiceDescription "&No","Pick me!"))
$Answer = $host.ui.PromptForChoice('Caption',"Message",$choices,(1))
Write-... |
combined_dataset/train/non-malicious/45599912-3e19-46a3-830b-4a7948b8f56d.ps1 | 45599912-3e19-46a3-830b-4a7948b8f56d.ps1 | Function Test-XVM
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory=$true,Position=1)]
[string[]]$Name,
[Parameter(Mandatory=$true,Position=2)]
[string[]]$ComputerName
)
Process
{
$results = @()
foreach ($cName in $ComputerName) {
... |
combined_dataset/train/non-malicious/Find-DuplicateSMTP.ps1 | Find-DuplicateSMTP.ps1 | #######################################################################
#### Written By: Kevin Dunn ####
#### Date: 1/21/2009 ####
#### ####
#### FindDu... |
combined_dataset/train/non-malicious/sample_36_99.ps1 | sample_36_99.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 = '74.1.0'
# Suppo... |
combined_dataset/train/non-malicious/Set-AssemblyBindLogging.ps1 | Set-AssemblyBindLogging.ps1 | function Set-AssemblyBindLogging {
#.Synopsis
# Enable or disable Assembly Bind logging for the machine
#.Parameter EnableLogging
# Whether or not to enable logging. Accepts partial matching of Enable/Disable or True/False or even 1/0 ...
#.Parameter LogPath
# The location of the folder you want to save fusio... |
combined_dataset/train/non-malicious/1916.ps1 | 1916.ps1 |
Describe "Register-ObjectEvent" -Tags "CI" {
BeforeEach {
$pesterobject = (New-Object System.Collections.ObjectModel.ObservableCollection[object])
}
AfterEach {
Unregister-Event -SourceIdentifier PesterTestRegister -ErrorAction SilentlyContinue
}
Context "Check return type of Register-ObjectE... |
combined_dataset/train/non-malicious/sample_35_35.ps1 | sample_35_35.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=필요한 PowerShell 모듈(FailoverClusters)을 찾을 수 없습니다. 역할 및 기능 도구를 사용하여 원격 서버 관리 도구 | 기능 관리 도구 | 장애 조치(failover) 클러스터링 도구 | Windows PowerShell용 장애 조치(failover) 클러스터 모듈을 설치하세요.
HyperVModuleRequired=필요한 PowerShell 모듈(Hyper-V)을 찾을 수 없습니다. 역할 및 기능 도구를 사용하여 원격 서버 관리 도구 | 역... |
combined_dataset/train/non-malicious/sample_0_1.ps1 | sample_0_1.ps1 | ConvertFrom-StringData @'
progressbar_id_crmapppoolaccountprivusergroup_exists=Checking to see if CRMAppPool Account is member of PrivUserGroup
progressbar_id_crmapppoolaccountprivusergroup_existsdesc=Checking to see if CRMAppPool Account is member of PrivUserGroup
'@
# SIG # Begin signature block
# MIIoKgYJKoZI... |
combined_dataset/train/non-malicious/Get-Process -eq PSList.ps1 | Get-Process -eq PSList.ps1 | ps | % -b {$arr = @()} -p {
$str = "" | select Name, PID, Time
$str.Name = $_.ProcessName
$str.PID = $_.Id
$str.Time = $(try {$_.StartTime} catch {return [DateTime]::MinValue})
$arr += $str
} -end {$arr | sort Time | ft -a}
|
combined_dataset/train/non-malicious/906.ps1 | 906.ps1 | $fqdn="<Replace with your custom domain name>"
$pfxPath="<Replace with path to your .PFX file>"
$pfxPassword="<Replace with your .PFX password>"
$webappname="mywebapp$(Get-Random)"
$location="West Europe"
New-AzResourceGroup -Name $webappname -Location $location
New-AzAppServicePlan -Name $webappname -Location $loc... |
combined_dataset/train/non-malicious/sample_37_89.ps1 | sample_37_89.ps1 | #
# Module manifest for module 'OCI.PSModules.Dts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dts.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_37_57.ps1 | sample_37_57.ps1 | -- SPARK-44871: Fix percentile_disc behaviour
SELECT
percentile_disc(0.0) WITHIN GROUP (ORDER BY a) as p0,
percentile_disc(0.1) WITHIN GROUP (ORDER BY a) as p1,
percentile_disc(0.2) WITHIN GROUP (ORDER BY a) as p2,
percentile_disc(0.3) WITHIN GROUP (ORDER BY a) as p3,
percentile_disc(0.4) WITHIN GROUP (ORDER ... |
combined_dataset/train/non-malicious/1832.ps1 | 1832.ps1 |
Describe "Get-Process for admin" -Tags @('CI', 'RequireAdminOnWindows') {
It "Should support -IncludeUserName" {
(Get-Process -Id $pid -IncludeUserName).UserName | Should -Match $env:USERNAME
}
It "Should support -Module" -Pending:$IsMacOS {
$modules = Get-Process -Id $pid -Module
... |
combined_dataset/train/non-malicious/sample_31_29.ps1 | sample_31_29.ps1 | function Test-PlasterManifest {
[CmdletBinding()]
[OutputType([System.Xml.XmlDocument])]
param(
[Parameter(Position=0,
ParameterSetName="Path",
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
HelpMessage="Spe... |
combined_dataset/train/non-malicious/1946.ps1 | 1946.ps1 |
Describe 'Tests for Wait-Debugger' -Tags "CI" {
BeforeAll {
Register-DebuggerHandler
}
AfterAll {
Unregister-DebuggerHandler
}
Context 'Wait-Debugger should break on the statement containing the Wait-Debugger command' {
BeforeAll {
$testScript = {
... |
combined_dataset/train/non-malicious/RESTful Server.ps1 | RESTful Server.ps1 | # PowerShell RESTful server by Parul Jain paruljain@hotmail.com
# Version 0.1 April 4th, 2013
#
# Use to offer services to other programs as a simple alternative to remoting and webservice technologies
# Does not require a webserver such as IIS. Works on its own!
# Single threaded; will process requests in order.... |
combined_dataset/train/non-malicious/ELIM (Event Log IM) 1.0.ps1 | ELIM (Event Log IM) 1.0.ps1 | $ELIMServer = $Env:ComputerName
$ELIMChannel = "ELIM"
$ELIMUser = $Env:UserName
function New-ELIMUser {
#.Synopsis
# Send a message to the ELIM (Event Log Instant Messaging) Log
[CmdletBinding()]
param (
# The Computer whose event logs will be used for instant messaging
[String]$Server = $ELIMServer,... |
combined_dataset/train/non-malicious/sample_2_86.ps1 | sample_2_86.ps1 | #************************************************
# TS_ModernAppsFailureForRegistryPermissionCheck.ps1
# Version 1.0.1
# Date: 3/13/2013
# Author: v-kaw
# Description: [Idea ID 7510] [Windows] WinStore - Apps fail to start if default registry permissions modified
# Rule number: 7510
# Rule URL: http://sharepo... |
combined_dataset/train/non-malicious/Added_Deleted AD Objects.ps1 | Added_Deleted AD Objects.ps1 | #REQUIRES -pssnapin quest.activeroles.admanagement
#REQUIRES -pssnapin Pscx
begin {
# Build variables
$strSMTPServer = "192.168.251.144";
$strEmailFrom = "AD_Admin@hfinc.com";
$strEmailTo = "jdelatorre@hfinc.com";
$borders = "=" * 25;
[int]$days = -60
function TombStonedObjects {
# create Directory Sea... |
combined_dataset/train/non-malicious/Invoke-SqlCmd_3.ps1 | Invoke-SqlCmd_3.ps1 | #######################
<#
.SYNOPSIS
Runs a T-SQL script.
.DESCRIPTION
Runs a T-SQL script. Invoke-Sqlcmd2 only returns message output, such as the output of PRINT statements when -verbose parameter is specified
.INPUTS
None
You cannot pipe objects to Invoke-Sqlcmd2
.OUTPUTS
System.Data.DataTable
.EXA... |
combined_dataset/train/non-malicious/sample_20_7.ps1 | sample_20_7.ps1 | ConvertFrom-StringData @'
id_crmcollectactivity=Collecting System Information
id_crmformattingdata=Formatting Data
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADA... |
combined_dataset/train/non-malicious/4093.ps1 | 4093.ps1 |
cls
$Printers = Get-WmiObject Win32_Printer
$EXE = $env:windir + "\system32\printui.exe"
$PrintUI = "/dn /n "
Foreach ($Printer in $Printers) {
If ($Printer.ShareName -ne $null) {
Write-Host "Uninstall"$Printer.ShareName"....." -NoNewline
$Parameters = $PrintUI + [char]34+ $Printer.Name + [char]34
$ErrCode = (... |
combined_dataset/train/non-malicious/sample_40_19.ps1 | sample_40_19.ps1 |
function getWorldMatrix(element) {
return element.getTrait("WorldTransform").value;
}
var isOrtho = false;
function getCameraElement() {
var camera = document.elements.findElementByTypeId("Microsoft.VisualStudio.3D.PerspectiveCamera");
if (camera == null) {
isOrtho = true;
came... |
combined_dataset/train/non-malicious/sample_34_8.ps1 | sample_34_8.ps1 |
# Tenant admin can add their own applocker policy here if needed
[string]$CleanupScript =
@"
<?xml version="1.0"?>
<AppLockerPolicy Version="1" />
"@
[string]$SidecarMiPolicy =
@"
<?xml version="1.0"?>
<AppLockerPolicy Version="1">
<RuleCollection Type="Appx" EnforcementMode="NotConfigured" />
... |
combined_dataset/train/non-malicious/176.ps1 | 176.ps1 | function Enable-RemoteDesktop
{
[CmdletBinding(DefaultParameterSetName = 'CimSession',
SupportsShouldProcess = $true)]
param
(
[Parameter(ParameterSetName = 'Main',
ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true)]
... |
combined_dataset/train/non-malicious/sample_60_94.ps1 | sample_60_94.ps1 | #
# Module manifest for module 'GCArcService'
#
# Generated by: Microsoft
#
# Generated on: 08/09/2020
#
@{
# Script module or binary module file associated with this manifest.
ModuleToProcess = 'GCArcService.psm1'
# Version number of this module.
ModuleVersion = '1.0'
# ID used to uniquely identify... |
combined_dataset/train/non-malicious/sample_31_59.ps1 | sample_31_59.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 = '77.0.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/725.ps1 | 725.ps1 |
function Get-RsSubscription
{
[cmdletbinding()]
param
(
[Alias('Path')]
[Parameter(Mandatory = $True, ValueFromPipeline = $true)]
[string[]]
$RsItem,
[string]
$ReportServerUri,
[ValidateSet('2005','2006','2010')]
[string]
$Ap... |
combined_dataset/train/non-malicious/sample_18_33.ps1 | sample_18_33.ps1 | #************************************************
# DC_ClusterResourcesProperties.ps1
# Version 1.1.1
# Date: 11-22-2011
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script writes cluster resources properties
# on a text file called COMPUTERNAME_ClusterProperties.txt
#*******... |
combined_dataset/train/non-malicious/WSUS-Settings.ps1 | WSUS-Settings.ps1 | #==================================================================================================
# File Name : WSUS-Settings.ps1
# Original Author : Kenneth C. Mazie (kcmjr at kcmjr.com)
# Description : As written will manually apply all settings associated with a local
# ... |
combined_dataset/train/non-malicious/17.ps1 | 17.ps1 | . $PSScriptRoot\Shared.ps1
. $modulePath\Utils.ps1
$expectedEncoding = if ($PSVersionTable.PSVersion.Major -le 5) { "utf8" } else { "ascii" }
Describe 'Utils Function Tests' {
Context 'Add-PoshGitToProfile Tests' {
BeforeAll {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDec... |
combined_dataset/train/non-malicious/Vim25-less Crazy Magic_1.ps1 | Vim25-less Crazy Magic_1.ps1 | cls
$ws = New-WebServiceProxy -Uri "http://192.168.1.1/sdk/vimService?wsdl" -Namespace "vimService1" ;
$ws.Url = "http://192.168.1.1/sdk/vimService";
$ws.UserAgent = "VMware VI Client/4.0.0";
$ws.CookieContainer = New-Object system.net.CookieContainer;
$mor_ret = new-object vimService1.ManagedObjectReferen... |
combined_dataset/train/non-malicious/sample_52_60.ps1 | sample_52_60.ps1 | # ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License... |
combined_dataset/train/non-malicious/3363.ps1 | 3363.ps1 | [CmdletBinding()]
Param(
[Parameter(Mandatory=$False, Position=0)]
[String]$Folder,
[Parameter(Mandatory=$False)]
[bool]$Major,
[Parameter(Mandatory=$False)]
[bool]$Minor,
[Parameter(Mandatory=$False)]
[bool]$Patch
)
function ReplaceVersion([string]$key, [string]$line)
{
$matches = ([regex]::matches($line, "$key = '(... |
combined_dataset/train/non-malicious/2940.ps1 | 2940.ps1 | properties {
$testMessage = 'Executed Test!'
$compileMessage = 'Executed Compile!'
$cleanMessage = 'Executed Clean!'
}
task default -depends Test
task Test -depends Compile, Clean {
$testMessage
}
task Compile -depends Clean {
$compileMessage
}
task Clean {
$cleanMessage
} |
combined_dataset/train/non-malicious/1375.ps1 | 1375.ps1 |
function Get-CIisApplication
{
[CmdletBinding()]
[OutputType([Microsoft.Web.Administration.Application])]
param(
[Parameter(Mandatory=$true)]
[string]
$SiteName,
[Parameter()]
[Alias('Name')]
[string]
$VirtualPath
)... |
combined_dataset/train/non-malicious/sample_29_70.ps1 | sample_29_70.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicecatalog'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicecatalog.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSE... |
combined_dataset/train/non-malicious/sample_39_41.ps1 | sample_39_41.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("manipulationWorldMode", "bool", true);
}
else {
... |
combined_dataset/train/non-malicious/sample_67_66.ps1 | sample_67_66.ps1 | # -*- coding: utf-8 -*- #
# Copyright 2024 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
combined_dataset/train/non-malicious/sample_13_70.ps1 | sample_13_70.ps1 | #************************************************
# DC_WebClient-Component.ps1
# Version 1.0
# Date: 2009-2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about WebClient/WebDAV.
# Called from: Networking Diagnostics
#*******************************************************
... |
combined_dataset/train/non-malicious/sample_23_51.ps1 | sample_23_51.ps1 | #
# Module manifest for module 'OCI.PSModules.Ocvp'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ocvp.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_8_91.ps1 | sample_8_91.ps1 | PARAM($XMLFilename)
. ./utils_cts.ps1
SkipSecondExecution
trap [Exception]
{
WriteTo-ErrorDebugReport -ErrorRecord $_
continue
}
if (Test-Path ($XMLFilename))
{
$AlertDisplay = "Performance Monitor Warning"
[xml] $ReportXML = Get-Content -Path $XMLFilename
foreach ($Table in $ReportXML.Selec... |
combined_dataset/train/non-malicious/3563.ps1 | 3563.ps1 |
$JobQueryWaitTimeInSeconds = 0
$ResourceGroupName = "E2ERg"
$VaultName = "E2ETest"
$PrimaryFabricName = "primaryFriendlyName"
$RecoveryFabricName = "IDCLAB-A147.ntdev.corp.microsoft.com"
$PolicyName = "B2APolicyTest1"
$PrimaryProtectionContainerName = "primaryFriendlyName"
$RecoveryProtectionContainerN... |
combined_dataset/train/non-malicious/1090.ps1 | 1090.ps1 |
Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath 'CarbonDscTest' -Resolve) -Force
$RuleName = 'CarbonDscFirewallRule'
Start-CarbonDscTestFixture 'FirewallRule'
Describe 'Carbon_FirewallRule' {
function Remove-FirewallRule
{
param(
$Name = $RuleName
)
... |
combined_dataset/train/non-malicious/3304.ps1 | 3304.ps1 |
function Save-PoshBotConfiguration {
[cmdletbinding(SupportsShouldProcess)]
param(
[parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[Alias('Configuration')]
[BotConfiguration]$InputObject,
[string]$Path = (Join-Path -Path $script:defaultPoshBotDir... |
combined_dataset/train/non-malicious/sample_11_15.ps1 | sample_11_15.ps1 | #
# Module manifest for module 'OCI.PSModules.Healthchecks'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/2212.ps1 | 2212.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed.")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMess... |
combined_dataset/train/non-malicious/sample_21_90.ps1 | sample_21_90.ps1 | <#
.SYNOPSIS
Removes an entry matching the given IP address and hostname from a hosts file.
Does nothing if a matching entry is not found.
.PARAMETER Hostname
Hostname for the address/name pair which should be removed from the hosts file.
.PARAMETER HostsFilePath
(Optional) Path to the hosts ... |
combined_dataset/train/non-malicious/Log ports used by applic.ps1 | Log ports used by applic.ps1 | #######################################################################################################################
# File: LogPortsUsedByApplication.ps1 #
# Author: Alexander Petrovskiy ... |
combined_dataset/train/non-malicious/2823.ps1 | 2823.ps1 | Function ConvertTo-GraphiteMetric
{
param
(
[CmdletBinding()]
[parameter(Mandatory = $true)]
[string]$MetricToClean,
[parameter(Mandatory = $false)]
[switch]$RemoveUnderscores,
[parameter(Mandatory = $false)]
[switch]$NicePhysicalDisks,
[parame... |
combined_dataset/train/non-malicious/sample_48_92.ps1 | sample_48_92.ps1 | #
# Module manifest for module 'OCI.PSModules.Goldengate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Goldengate.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_36_65.ps1 | sample_36_65.ps1 | # Inspired by https://eslint.org/docs/rules/brace-style#stroustrup
@{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
'PSUseConsistentWhitespace',
'PSUseConsistentIndentation',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'
)
Rules = @{
... |
combined_dataset/train/non-malicious/Get Network Utilization.ps1 | Get Network Utilization.ps1 | $cnt = 'Bytes Total/sec'
$inst = 'Broadcom NetXtreme Gigabit Ethernet - Packet Scheduler Miniport'
$cat = 'Network Interface'
$cnt2 = 'Current Bandwidth'
$cur = New-Object system.Diagnostics.PerformanceCounter($cat,$cnt,$inst)
$max = New-Object system.Diagnostics.PerformanceCounter($cat,$cnt2,$inst)
$curnum = $cu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.