full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/4195.ps1 | 4195.ps1 |
[CmdletBinding()]
param
(
[string]
$MemberExclusionsFile = 'MemberExclusions.txt',
[switch]
$OutputFile,
[string]
$OutputFileLocation = '',
[switch]
$SCCMReporting,
[string]
$SystemExclusionsFile = 'SystemExclusions.txt'
)
function Get-RelativePath {
[CmdletBinding()][OutputType([string])]
param ()
... |
combined_dataset/train/non-malicious/516.ps1 | 516.ps1 |
function Disable-SPBlobCache{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Identity
)
if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Microsoft.SharePoint.PowerShell"}
$SPWebApplication = Get-SPWeb... |
combined_dataset/train/non-malicious/sample_22_56.ps1 | sample_22_56.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/sample_44_49.ps1 | sample_44_49.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/1548.ps1 | 1548.ps1 |
function Get-MrScheduledTask {
[CmdletBinding()]
param (
[ValidateNotNullOrEmpty()]
[string[]]$ComputerName,
[string]$TaskName,
[System.Management.Automation.Credential()]$Credential = [System.Management.Automation.PSCredential]::Empty
)
$Params = @{
C... |
combined_dataset/train/non-malicious/3902.ps1 | 3902.ps1 |
function Test-AddApplication
{
$applicationName = "test"
$applicationVersion = "foo"
$context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext
try
{
$addAppPack = New-AzBatchApplication -AccountName $context.AccountName -ApplicationName... |
combined_dataset/train/non-malicious/sample_20_62.ps1 | sample_20_62.ps1 | # Localized 05/06/2022 10:04 PM (GMT) 303:7.0.30723 ArchiveResources.psd1
# Localized ArchiveResources.psd1
ConvertFrom-StringData @'
###PSLOC
PathNotFoundError=The path '{0}' either does not exist or is not a valid file system path.
ExpandArchiveInValidDestinationPath=The path '{0}' is not a valid file system ... |
combined_dataset/train/non-malicious/set-ipconfigv6.ps1 | set-ipconfigv6.ps1 | # script parameters
param(
[Parameter(Position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$true)]
[alias("Name","ComputerName")][string[]]$Computers = @($env:computername),
$Domain = "domain.local",
$DNSSuffix = @("domain.local,sub.domain.local,domain.com"),
$DNSServers = @("10.10.0.1", "10.10.0.2"... |
combined_dataset/train/non-malicious/Get-NestedGroups.ps1 | Get-NestedGroups.ps1 | <#
.SYNOPSIS
Enumerate all AD group memberships of an account (including nested membership).
.DESCRIPTION
This script will return all the AD groups an account is member of.
.PARAMETER UserName
The username whose group membershipts to find.
.EXAMPLE
.\\Get-NestedGroups.ps1 'johndoe'
Name ... |
combined_dataset/train/non-malicious/1267.ps1 | 1267.ps1 |
function Revoke-CServicePermission
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[Parameter(Mandatory=$true)]
[string]
$Identity
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -C... |
combined_dataset/train/non-malicious/sample_14_23.ps1 | sample_14_23.ps1 | #
# Module manifest for module 'Az.Websites'
#
# Generated by: Microsoft Corporation
#
# Generated on: 23/04/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.Websites.psm1'
# Version number of this module.
ModuleVersion = '3.2.1'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/Restore-Database.ps1 | Restore-Database.ps1 | param($sqlserver, $filepath)
#Note: Uses Changeset 59378 or higher of SQLPSX SQLServer module http://sqlpsx.codeplex.com/SourceControl/changeset/view/58378#564810
#Added FileListOnly option to Invoke-SqlRestore. The option will be included in releases after 2.3.1
import-module sqlserver -force
$server = get... |
combined_dataset/train/non-malicious/358.ps1 | 358.ps1 | function Register-PSFParameterClassMapping
{
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFParameterClassMapping')]
Param (
[Parameter(Mandatory = $true)]
[PSFramework.Parameter.ParameterClasses]
$ParameterClass,
[Parameter(Mandatory = $true)]
[string]
... |
combined_dataset/train/non-malicious/sample_38_81.ps1 | sample_38_81.ps1 | #
# Module manifest for module 'OCI.PSModules.Limits'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Limits.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/Findup_21.ps1 | Findup_21.ps1 | using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.IO;
using System.Text.RegularExpressions;
namespace Findup
{
public class FileLengthComparer : I... |
combined_dataset/train/non-malicious/sample_47_81.ps1 | sample_47_81.ps1 | ---
#
# Get VLANs for each Ethernet Network Policy
#
- name: Get VLANs for each Ethernet Network Policy
hosts: localhost
connection: local
gather_facts: false
vars:
# Create an anchor for api_info that can be used throughout the file
api_info: &api_info
# if api_key vars are omitted, INTERSIGHT_AP... |
combined_dataset/train/non-malicious/Parse-ApacheRedirects.ps1 | Parse-ApacheRedirects.ps1 | <#
.SYNOPSIS
Parses an Apache redirect file to identify broken entries.
.DESCRIPTION
All redirects will be followed and the final response code will be processed as follows:
200 - OK
401 - OK
403 - Broken
404 - Broken
*** - Optionally remove with -RemoveUnknownEr... |
combined_dataset/train/non-malicious/Get-Exchange-Mail_2.ps1 | Get-Exchange-Mail_2.ps1 | [Reflection.Assembly]::LoadFile("C:\\Program Files\\Microsoft\\Exchange\\Web Services\\1.1\\Microsoft.Exchange.WebServices.dll") | Out-Null
$s = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2007_SP1)
$s.Credentials = New-Object Net.Netwo... |
combined_dataset/train/non-malicious/get-netstat 1.3.ps1 | get-netstat 1.3.ps1 | $netstat = netstat -a -n -o | where-object { $_ -match "(UDP|TCP)" }
[regex]$regexTCP = '(?<Protocol>\\S+)\\s+((?<LAddress>(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?))|(?<LAddress>\\[?[0-9a-fA-f]{0,4}(\\:([0-9a-fA-f]{0,4})){1... |
combined_dataset/train/non-malicious/sample_10_50.ps1 | sample_10_50.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'https://aka... |
combined_dataset/train/non-malicious/Ring Monitor.ps1 | Ring Monitor.ps1 | #requires -version 2.0
Import-Module Accelerators # http://poshcode.org/762
Import-Module PowerBoots # http://boots.codeplex.com
# http://dynamicdatadisplay.codeplex.com
## You have to get the DynamicDataDisplay control, and put it's DLLs in the PowerBoots folder...
ls "$PowerBootsP... |
combined_dataset/train/non-malicious/2880.ps1 | 2880.ps1 | task default -depends A,B,C
task A {
"TaskA"
}
task B -precondition { return $false } {
"TaskB"
}
task C -precondition { return $true } {
"TaskC"
}
|
combined_dataset/train/non-malicious/Language.ps1 | Language.ps1 | ## Language.ps1 includes Resolve-Language, Get-English, and Resolve-Anagram
###################################################################################################
## Some language functions, including a language guessing script using a web form
## Xerox Research Center Europe (www.xrce.xerox.com) which... |
combined_dataset/train/non-malicious/sample_39_25.ps1 | sample_39_25.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 = '77.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_54_77.ps1 | sample_54_77.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcesearch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcesearch.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSE... |
combined_dataset/train/non-malicious/2562.ps1 | 2562.ps1 |
Set-ExecutionPolicy Unrestricted
c:\temp\InitPowerSMO.ps1
$server = SMO_Server
$db = SMO_Database $server "PowerDW"
$db.DatabaseOptions.RecoveryModel="Simple"
$db.Create()
c:
cd \
md PowerDW
function global:insert-table ($tablename) {
$dataset = $DB.ExecuteWithResults( "sp_columns ["+$tablename+"]")
$tableC... |
combined_dataset/train/non-malicious/2317.ps1 | 2317.ps1 |
[CmdletBinding()]
param (
[Parameter(Mandatory = $True,
ValueFromPipeline = $True,
ValueFromPipelineByPropertyName = $True,
HelpMessage = 'What is the folder path you would like to burn?')]
[string]$Path,
[Parameter(Mandatory = $False,
ValueFromPipeline = $False,
ValueFromPipelineByP... |
combined_dataset/train/non-malicious/PowerShell Template_6.ps1 | PowerShell Template_6.ps1 | Function new-script
{
$strName = $env:username
$date = get-date -format d
$name = Read-Host "Filename"
$email = Read-Host "eMail Address"
$file = New-Item -type file "c:\\Scripts\\$name.ps1" -force
add-content $file "#=========================================================================="
add-content $file ... |
combined_dataset/train/non-malicious/sample_34_88.ps1 | sample_34_88.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplacepublisher'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplacepublisher.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# S... |
combined_dataset/train/non-malicious/sample_3_5.ps1 | sample_3_5.ps1 | #************************************************
# DC_RDSPowerInfo.ps1
# Version 1.0.1
# Date: 21-01-2012
# Author: Daniel Grund - dgrund@microsoft.com
# Description:
# This script gets the RDP config and
# checks vital signs to inform user.
# 1.0.0 Beta release
#*******************************************... |
combined_dataset/train/non-malicious/359.ps1 | 359.ps1 | function Import-PSFCmdlet
{
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Import-PSFCmdlet')]
param (
[Parameter(Mandatory = $true)]
[String]
$Name,
[Parameter(Mandatory = $true)]
[Type]
$Type,
[string]
$HelpFile,
[System.Management.Automation.PSModul... |
combined_dataset/train/non-malicious/sample_61_5.ps1 | sample_61_5.ps1 | #
# Module manifest for module 'OCI.PSModules.Osmanagementhub'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osmanagementhub.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported P... |
combined_dataset/train/non-malicious/4143.ps1 | 4143.ps1 |
param
(
[switch]$SCCM,
[switch]$NetworkShare,
[string]$NetworkSharePath,
[switch]$SCCMImport
)
function Initialize-HardwareInventory {
[CmdletBinding()]
param ()
$Output = "Initiate SCCM Hardware Inventory....."
$SMSCli = [wmiclass] "\\localhost\root\ccm:SMS_Client"
$ErrCode = ($SMSCli.TriggerSchedule("{... |
combined_dataset/train/non-malicious/2202.ps1 | 2202.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=$false, HelpMes... |
combined_dataset/train/non-malicious/sample_25_32.ps1 | sample_25_32.ps1 | #
# Module manifest for module 'OCI.PSModules.Bastion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bastion.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_9_44.ps1 | sample_9_44.ps1 | #************************************************
# DC_HyperVReplica.ps1
# Version 1.0 - 7/24/14
# Author: jasonf
#*******************************************************
Trap [Exception]
{
$Script:ExceptionMessage = $_
"[info]: Exception occurred." | WriteTo-StdOut
"[info]: Exception.Message $E... |
combined_dataset/train/non-malicious/sample_29_77.ps1 | sample_29_77.ps1 | '*************************************************************
'
' ADOBE SYSTEMS INCORPORATED
' Copyright 2005-2010 Adobe Systems Incorporated
' All Rights Reserved
' NOTICE: Adobe permits you to use, modify, and
' distribute this file in accordance with the terms
' of the Adobe license agreement accompa... |
combined_dataset/train/non-malicious/Search AD Forest.ps1 | Search AD Forest.ps1 | ########################################################################################
## Search Active Directory Forest
## Search-ADForest
########################################################################################
## NOTE: You have to have sufficient privileges on the target domain for this to work... |
combined_dataset/train/non-malicious/Exif query script.ps1 | Exif query script.ps1 | ## Selected 'Exif' statistics script is below. There are a number of ways I can improve it:
## Stream output, skip csv file creation (as an interim step) read list with arrays and parameters,
## using regex expressions to best effect. Still, quite a few lessons learned with this and the output can help
## check fo... |
combined_dataset/train/non-malicious/2247.ps1 | 2247.ps1 |
[CmdletBinding(SupportsShouldProcess = $true)]
param (
[parameter(Mandatory = $true, HelpMessage = "Specify the path containing the WinUPTP or Flash.cmd.")]
[ValidateNotNullOrEmpty()]
[string]$Path,
[parameter(Mandatory = $false, HelpMessage = "Specify the BIOS password if necessary.")]
[ValidateNotNullOrEmpty()]... |
combined_dataset/train/non-malicious/2989.ps1 | 2989.ps1 | Set-StrictMode -Version Latest
Describe 'Clean handling of break and continue' {
Context 'Break' {
break
}
Context 'Continue' {
continue
}
It 'Did not abort the whole test run' { $null = $null }
}
|
combined_dataset/train/non-malicious/sample_51_99.ps1 | sample_51_99.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 = '81.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/2680.ps1 | 2680.ps1 |
Param(
[string]$SourceEnvironment,
[string]$DestinationEnvironment
)
begin
{
Clear-Host
$path = Split-Path -parent $MyInvocation.MyCommand.Definition
if ($env:PSModulePath -notlike "*$path\Modules\TriadModules\Modules*")
{
"Adding ;$path\Modules\TriadModules\Modules to PSModulePath" | Write-Debug
... |
combined_dataset/train/non-malicious/703.ps1 | 703.ps1 |
function New-RsWebServiceProxy
{
[cmdletbinding()]
param
(
[string]
$ReportServerUri = ([Microsoft.ReportingServicesTools.ConnectionHost]::ReportServerUri),
[Alias('Credentials')]
[AllowNull()]
[System.Management.Automation.PSCredential]
$Cre... |
combined_dataset/train/non-malicious/Get-Payment_1.ps1 | Get-Payment_1.ps1 | function Get-Payment {
param ( $LoanAmount, [double]$InterestRatePerPeriod, $NumberPayments )
$a = $LoanAmount
$b = $InterestRatePerPeriod*[math]::Pow(($InterestRatePerPeriod + 1),$NumberPayments)
$c = [math]::Pow((1+$InterestRatePerPeriod),$NumberPayments) - 1
$payment = $a*($b/$c)
"{0:C}" -f $payment
}
|
combined_dataset/train/non-malicious/sample_26_17.ps1 | sample_26_17.ps1 | #
# Module manifest for module 'Microsoft.SME.NetworkSettings'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.NetworkSettings.psm1'
# Version number of this module.
ModuleVersion = '4.11.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# I... |
combined_dataset/train/non-malicious/Test-Hash_1.ps1 | Test-Hash_1.ps1 | function Test-Hash {
#.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
# C:\\PS>ls .\\Bin\\Release -recurse | Test-Hash -BasePath .\\Bin\\Release -Type SHA256 | Export-CSV ~\\Hashes.... |
combined_dataset/train/non-malicious/1105.ps1 | 1105.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldJoinPaths
{
Assert-Equal 'SiteName' (Join-IisVirtualPath 'SiteName' '')
Assert-Equal 'SiteName' (Join-IisVirtualPath 'SiteName' $null)
Assert-Equal 'SiteName' (Join-I... |
combined_dataset/train/non-malicious/sample_6_41.ps1 | sample_6_41.ps1 | ConvertFrom-StringData @'
id_classreg=Class Registration
id_classdesc=Determining if critical Windows Update dll's are registered
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIB... |
combined_dataset/train/non-malicious/41.ps1 | 41.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 ($Aa... |
combined_dataset/train/non-malicious/sample_9_89.ps1 | sample_9_89.ps1 | ConvertFrom-StringData @'
progressbar_id_crm_org_update_check=Checking Microsoft CRM Organizations that have not been updated to latest revision
progressbar_id_crm_org_update_checkdesc=Checking Microsoft CRM Organizations that have not been updated to latest revision. Important database updates should be applied.
'@... |
combined_dataset/train/non-malicious/4135.ps1 | 4135.ps1 |
Set-Variable -Name AdminPassword -Scope Global -Force
Set-Variable -Name AdminUsername -Scope Global -Force
Set-Variable -Name DestinationComputer -Scope Global -Force
Set-Variable -Name DestinationProfile -Scope Global -Force
Set-Variable -Name RelativePath -Scope Global -Force
Set-Variable -Name SourceComputer -S... |
combined_dataset/train/non-malicious/sample_6_46.ps1 | sample_6_46.ps1 | ConvertFrom-StringData @'
id_windowsupdatelogcollect=Collecting Windows Update
id_windowsupdatelogcollectdesc=Collecting \\Windows\\windowsupdate.log
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63... |
combined_dataset/train/non-malicious/205.ps1 | 205.ps1 | Function Add-ADSubnet{
[CmdletBinding()]
PARAM(
[Parameter(
Mandatory=$true,
Position=1,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
HelpMessage="Subnet name to create")]
[Alias("Name")]
[String]$Subnet,
... |
combined_dataset/train/non-malicious/4460.ps1 | 4460.ps1 | function Publish-PSResource {
[OutputType([void])]
[Cmdletbinding(SupportsShouldProcess = $true)]
Param
(
[Parameter(Mandatory = $true,
ParameterSetName = "ModuleNameParameterSet",
ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true)]
... |
combined_dataset/train/non-malicious/sample_44_79.ps1 | sample_44_79.ps1 | #
# Module manifest for module 'OCI.PSModules.Budget'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Budget.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_38_32.ps1 | sample_38_32.ps1 | #
# Module manifest for module 'OCI.PSModules'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
# ID u... |
combined_dataset/train/non-malicious/Set-SecureAutoLogon_1.ps1 | Set-SecureAutoLogon_1.ps1 | [cmdletbinding()]
param (
[Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]
$Username,
[Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [System.Security.SecureString]
$Password,
[string]
$Domain,
[Int]
$AutoLogonCount,
[switch]
$RemoveLegalPrompt,
[System.IO.Fi... |
combined_dataset/train/non-malicious/sample_62_80.ps1 | sample_62_80.ps1 | function Run-AlTests
(
[string] $TestSuite = $script:DefaultTestSuite,
[string] $TestCodeunitsRange = "",
[string] $TestProcedureRange = "",
[string] $ExtensionId = "",
[ValidateSet("Disabled", "Codeunit")]
[string] $TestIsolation = "Codeunit",
[ValidateSet('Windows','NavUserPassword... |
combined_dataset/train/non-malicious/3150.ps1 | 3150.ps1 |
[CmdletBinding()]
param(
)
Begin{
}
Process{
}
End{
}
|
combined_dataset/train/non-malicious/2885.ps1 | 2885.ps1 | Framework '4.7'
task default -depends MsBuild
task MsBuild {
if ( $IsMacOS -OR $IsLinux ) {}
else {
$output = &msbuild /version /nologo 2>&1
Assert ($output -NotLike '15.0') '$output should contain 15.0'
}
}
|
combined_dataset/train/non-malicious/sample_32_86.ps1 | sample_32_86.ps1 | #Volumetric soil moisture content
'soilw' = {
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 9 ;
}
#Upper layer soil temperature
'uplst' = {
discipline = 2 ;
parameterCategory = 3 ;
parameterNumber = 1 ;
}
#Upper layer soil moisture
'uplsm' = {
discipline = 2 ;
parameterCategory = 3 ;
pa... |
combined_dataset/train/non-malicious/Update Subnet Masks.ps1 | Update Subnet Masks.ps1 | #config
@@#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@#NOTE: Does not support IPv6. If used on a network with static IPv6 addresses,
@@#they may be lost.
@@#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@$network = "10.200.*"
@@$newSubnet = ... |
combined_dataset/train/non-malicious/sample_2_66.ps1 | sample_2_66.ps1 |
PARAM($Format="html")
Import-LocalizedData -BindingVariable AutoRunsString
Write-DiagProgress -Activity $AutoRunsString.ID_AutoRuns -Status $AutoRunsString.ID_AutoRunsObtaining
$OutputFile = $ComputerName + "_Autoruns.*"
$CommandLineToExecute = "cscript.exe Autoruns.VBS /format:$format"
RunCmD -commandToR... |
combined_dataset/train/non-malicious/sample_20_3.ps1 | sample_20_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Optimizer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Optimizer.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_15_9.ps1 | sample_15_9.ps1 | #************************************************
# TS_HyperVSCSIDiskEnum.ps1
# Version 1.0.1
# Date: 03-08-2011
# Author: Andre Teixeira - andret
# Description: This checks the number of subkeys under HKLM\System\CurrentControlSet\Enum\SCSI\Disk&Ven_Msft&Prod_Virtual_Disk
# If it is large (more th... |
combined_dataset/train/non-malicious/sample_30_75.ps1 | sample_30_75.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerinstances'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerinstances.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Suppo... |
combined_dataset/train/non-malicious/21.ps1 | 21.ps1 | . $PSScriptRoot\Shared.ps1
Describe 'Write-VcsStatus Tests' {
Mock -ModuleName posh-git -CommandName git {
$OFS = " "
if ($args -contains 'rev-parse') {
$res = Invoke-Expression "&$gitbin $args"
return $res
}
Convert-NativeLineEnding -SplitLines @'
A test/F... |
combined_dataset/train/non-malicious/sample_54_90.ps1 | sample_54_90.ps1 | #
# Module manifest for module 'OCI.PSModules.Limits'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Limits.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/Start-RDP.ps1 | Start-RDP.ps1 | ########################################################################################################################
# NAME
# Start-RDP
#
# SYNOPSIS
# Opens a remote desktop connection to another computer.
#
# SYNTAX
# Start-RDP [[-Server] <string>] [[-Width] <int>] [[-Height] <int>]
# Star... |
combined_dataset/train/non-malicious/sample_24_70.ps1 | sample_24_70.ps1 |
trap
{
# If we except, lets report it visually. Can help with debugging if there IS a problem
# in here.
Write-Host "EXCEPTION: $($PSItem.ToString())" -ForegroundColor Red
Write-Host "$($PSItem.ScriptStackTrace)"
Start-Sleep 10
}
# Get an environment variable with default value if not present
func... |
combined_dataset/train/non-malicious/2388.ps1 | 2388.ps1 | function Get-ChefConfigItem
{
[CmdletBinding()]
param
(
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]$Name
)
$line = Get-Content -Path $ConfigFilePath | where { $_ -match $Name }
if ($line)
{
foreach ($l in $line)
{
[pscustomobject]@{
'Name' = $l.Split(' ')[0].Trim()
'Value' = ($l.... |
combined_dataset/train/non-malicious/2085.ps1 | 2085.ps1 |
Describe 'Break statements with classes' -Tags "CI" {
function Get-Errors([string]$sourceCode) {
$tokens = $null
$errors = $null
$ast = [System.Management.Automation.Language.Parser]::ParseInput($sourceCode, [ref] $tokens, [ref] $errors)
return $errors
}
Context 'break is... |
combined_dataset/train/non-malicious/Function Run-Script_1.ps1 | Function Run-Script_1.ps1 | function Run-Script {
if ($psISE.CurrentFile.DisplayName.StartsWith("Untitled")) {
return
}
$script = $psISE.CurrentFile.DisplayName
$psISE.CurrentFile.Save()
$logfile = "$env:programfiles\\Sea Star Development\\" +
"Script Monitor Service\\ScriptMon.txt" #Change t... |
combined_dataset/train/non-malicious/sample_28_92.ps1 | sample_28_92.ps1 | #
# Module manifest for module 'OCI.PSModules.Jms'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jms.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/3784.ps1 | 3784.ps1 |
$aliaspage = Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json" -TimeoutSec 5
$parsedJson = $aliaspage.Content | ConvertFrom-Json
$win10Image = @"
{
"publisher": "MicrosoftVisualStudio",
"offer": "Windows",
"sku": "Win... |
combined_dataset/train/non-malicious/ce50f222-81f6-4509-90ad-8904f9331d7c.ps1 | ce50f222-81f6-4509-90ad-8904f9331d7c.ps1 | # Detect 32 or 64 bits Windows – regardless of WoW64 – with the PowerShell OSArchitecture function
# By Vincent Hoogendoorn
@@# See http://vincenth.net/blog/archive/2009/11/02/detect-32-or-64-bits-windows-regardless-of-wow64-with-the-powershell-osarchitecture-function.aspx for details.
@@# For the used InvokeCSharp ... |
combined_dataset/train/non-malicious/sample_18_16.ps1 | sample_18_16.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/sample_51_57.ps1 | sample_51_57.ps1 | param(
[string]$Root
)
function Get-RepoName
{
[CmdletBinding()]
param(
[Parameter()]
[switch]$Origin
)
process {
$clone = Get-GitUrl -Origin:$Origin
if ($clone -match "(?mi)^git@github.com:(?<owner>[^/]+)/(?<reponame>.+)\.git") {
return... |
combined_dataset/train/non-malicious/sample_47_9.ps1 | sample_47_9.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudmigrations'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudmigrations.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_28_32.ps1 | sample_28_32.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 = '74.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/hex2dec_3.ps1 | hex2dec_3.ps1 | @echo off
::interactive mode
if "%1" equ "" (
if not defined run goto:interactive
goto:error
)
::null results
for %%i in ("x0" "0x0") do if "%1" equ "%%~i" goto:null
::parsing arguments
setlocal enabledelayedexpansion
::only one argument should input
set "arg=0"
for %%i in ... |
combined_dataset/train/non-malicious/2791.ps1 | 2791.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
Distinct substr(ForeignAddress, 0, last_index_of(ForeignAddress, '.')) as Local/24
FROM
*netstat.csv
ORDER BY
Local/24
"@
& logparser -stats:off -i:csv -dtlines:0 -rtp:-1 $lpquery
} else {
$ScriptName = [System.IO... |
combined_dataset/train/non-malicious/sample_18_62.ps1 | sample_18_62.ps1 | #************************************************
# TS_2628581_HPUPDUpgrade.ps1
# Version 1.0.1
# TemplateVersion 1.2
# Date: 04/17/2012 08:02:35
# Author: jasonf
# Description: Checks the registry for an HP UPD upgrade from 5.2 to 5.3 which is known to cause issues
#********************************************... |
combined_dataset/train/non-malicious/1006.ps1 | 1006.ps1 |
$myEndpoint = "<your-endpoint-URL>"
$myResourceGroup = "<resource-group-name>"
$resourceGroupID = (New-AzResourceGroup -Name $myResourceGroup -Location westus2).ResourceId
New-AzEventGridSubscription `
-ResourceId $resourceGroupID `
-Endpoint $myEndpoint `
-EventSubscriptionName demoSubscriptionToResou... |
combined_dataset/train/non-malicious/sample_61_48.ps1 | sample_61_48.ps1 | param(
[Parameter(Mandatory = $true)] [string] $logPath,
[Parameter(Mandatory = $true)] [string] $tmpPath,
[Parameter(Mandatory = $true)] [boolean] $isUpdate
)
# set error action
$ErrorActionPreference = "SilentlyContinue"
# common functions
function Get-DateTime() {
Get-Date -Format "yyyy-... |
combined_dataset/train/non-malicious/sample_44_59.ps1 | sample_44_59.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=필요한 PowerShell 모듈(FailoverClusters)을 찾을 수 없습니다. 역할 및 기능 도구를 사용하여 원격 서버 관리 도구 | 기능 관리 도구 | 장애 조치(failover) 클러스터링 도구 | Windows PowerShell용 장애 조치(failover) 클러스터 모듈을 설치하세요.
'@
# SIG # Begin signature block
# MIInwQYJKoZIhvcNAQcCoIInsjCCJ64CAQExDzANBglghkgBZQMEA... |
combined_dataset/train/non-malicious/3991.ps1 | 3991.ps1 |
function WaitforStatetoBeSucceded {
param([string]$resourceGroupName, [string]$namespaceName, [string]$drConfigName)
$createdDRConfig = Get-AzServiceBusGeoDRConfiguration -ResourceGroup $resourceGroupName -Namespace $namespaceName -Name $drConfigName
while ($createdDRConfig.ProvisioningSta... |
combined_dataset/train/non-malicious/sample_1_15.ps1 | sample_1_15.ps1 | ConvertFrom-StringData @'
id_dberrcollecting=Collecting catalog registration log files
id_dberrcollectingdesc=Collecting DBErr.txt from \\Windows\\System32\\catroot2
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEA... |
combined_dataset/train/non-malicious/sample_25_72.ps1 | sample_25_72.ps1 | #
# Module manifest for module 'OCI.PSModules'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
# ID u... |
combined_dataset/train/non-malicious/3484.ps1 | 3484.ps1 |
function Test-ConfigurationPipelining{
$config = New-AzHDInsightClusterConfig -ClusterType Hadoop -ClusterTier Standard
Assert-NotNull $config.ClusterType
Assert-NotNull $config.ClusterTier
Assert-AreEqual $config.AdditionalStorageAccounts.Count 0
$config = $config | Add-AzH... |
combined_dataset/train/non-malicious/usr ActiveSync - Exch 07.ps1 | usr ActiveSync - Exch 07.ps1 | #Sacamos los dispositivos asociados a cada mailbox
#Verificamos su ultima conexión o si alguna vez no se han conectado
#Autor: Pedro Genil
#Fecha:23/11/2012
#Version: 1.0
If ((Get-PSSnapin | where {$_.Name -match "Exchange.Management"}) -eq $null)
{
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
}... |
combined_dataset/train/non-malicious/sample_49_48.ps1 | sample_49_48.ps1 | ##------------------------------------------------------------------
## <copyright file="ScenarioHelper.psm1" company="Microsoft">
## Copyright (C) Microsoft. All rights reserved.
## </copyright>
##------------------------------------------------------------------
#region Imports
Import-Module (Join-Path -... |
combined_dataset/train/non-malicious/sample_25_74.ps1 | sample_25_74.ps1 | #
# Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker'
#
# Generated by: Microsoft Corporation
#
# Generated on: 19/01/2022
#
@{
# Script module or binary module file associated with this manifest.
RootModule = ''
# Version number of this module.
ModuleVersion = '1.2100.25... |
combined_dataset/train/non-malicious/1636.ps1 | 1636.ps1 |
$a1 = New-Object System.Collections.ArrayList
$a2 = New-Object System.Collections.ArrayList
$a3 = New-Object System.Collections.ArrayList
$a4 = New-Object System.Collections.ArrayList
1..100 | % {
$null = $a1.Add($(Measure-Command {
$ArrayList = New-Object System.Collections.ArrayList
1..1000 | %... |
combined_dataset/train/non-malicious/sample_24_77.ps1 | sample_24_77.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/sample_60_24.ps1 | sample_60_24.ps1 | #########################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Localized PackageManagement.Resources.psd1
#
#########################################################################################
ConvertFrom-StringDa... |
combined_dataset/train/non-malicious/sample_38_71.ps1 | sample_38_71.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\jiti@1.21.0\node_modules\jiti\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\jiti@1.21.0\no... |
combined_dataset/train/non-malicious/4069.ps1 | 4069.ps1 |
$MasterLog = "\\NetworkLocation\LocalAdministrators.csv"
$Files = Get-ChildItem -Path \\NetworkLocation -Force
If ((Test-Path $MasterLog) -eq $true) {
Remove-Item -Path $MasterLog -Force
}
If ((Test-Path $MasterLog) -eq $false) {
$TitleBar = "ComputerName,UserName"+[char]13
New-Item -Path $MasterLog -ItemType File... |
combined_dataset/train/non-malicious/sample_18_52.ps1 | sample_18_52.ps1 | ConvertFrom-StringData @'
id_sccm_activity_cm07serverinfo=Gathering Site Server Information
id_sccm_cmserverinfo_boundary=Obtaining Boundaries
id_sccm_cmserverinfo_cloud=Obtaining Cloud Services information
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# Bg... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.