full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/1702.ps1 | 1702.ps1 | [CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[ValidateNotNullorEmpty()]
[PSCredential]$Credential
)
$ProjectRoot = Resolve-Path "$PSScriptRoot\.."
$ModuleRoot = Split-Path (Resolve-Path "$ProjectRoot\*\*.psd1")
$ModuleName = Split-Path $ModuleRoot -Leaf
$ModulePsd = (Resolve-Path "$ProjectRoot\*... |
combined_dataset/train/non-malicious/sample_2_60.ps1 | sample_2_60.ps1 | #This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER #EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABI... |
combined_dataset/train/non-malicious/sample_8_69.ps1 | sample_8_69.ps1 | ConvertFrom-StringData @'
id_dpm_dpmdb_activity=Gathering DPMDB
id_dpm_dpmdb_status=Running DC_CollectDPMDB.ps1
id_dpm_notinstalled=CollectDPMLogs did not run due to missing registry key pointing to the DPM installation folder
'@
# SIG # Begin signature block
# MIIoOAYJKoZIhvcNAQcCoIIoKTCCKCUCAQExDzANBglghkgBZQ... |
combined_dataset/train/non-malicious/2094.ps1 | 2094.ps1 |
Describe "Test try/catch" -Tags "CI" {
BeforeAll {
function AssertArraysEqual ($result, $expected)
{
$result.Count | Should -BeExactly $expected.Count
for ($i = 0; $i -lt $result.Count; $i++) {
$result[$i] | Should -BeExactly $expected[$i]
... |
combined_dataset/train/non-malicious/TabExpansion for V2CTP3.ps1 | TabExpansion for V2CTP3.ps1 | ## Tab-Completion
#################
## For V2CTP3.
## All or some features won't work on V1 and V2CTP and V2CTP2.
## Please dot souce this script file.
## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list.
## Some features(relate to '$_' expansion) require the latest... |
combined_dataset/train/non-malicious/sample_4_41.ps1 | sample_4_41.ps1 | ConvertFrom-StringData @'
id_vssbackuppkgfiles=Windows Server Backup Files
id_vssbackuppkgfilesobtaining=Obtaining Windows Server Backup log files
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNL... |
combined_dataset/train/non-malicious/sample_13_87.ps1 | sample_13_87.ps1 | #************************************************
# TS_B2693877_Sophos_BEFLTCheck.ps1
# Version 1.0.1
# TemplateVersion 1.2
# Date: 04/26/2012 11:29:18
# Author: jasonf
# Description: Check for the presence of Sophos BEFLT.SYS version 5.60.1.7
#************************************************
Import-Localize... |
combined_dataset/train/non-malicious/sample_27_96.ps1 | sample_27_96.ps1 | #
# Module manifest for module 'OCI.PSModules.Datasafe'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datasafe.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_46_43.ps1 | sample_46_43.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/456.ps1 | 456.ps1 | Register-PSFConfigValidation -Name "integerarray" -ScriptBlock {
param (
$var
)
$test = $true
try { [int[]]$res = $var }
catch { $test = $false }
[pscustomobject]@{
Success = $test
Value = $res
Message = "Casting $var as [int[]] failure. Input is being identified as $($var.GetType())"
}
} |
combined_dataset/train/non-malicious/sample_56_42.ps1 | sample_56_42.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias'... |
combined_dataset/train/non-malicious/sample_19_79.ps1 | sample_19_79.ps1 | ConvertFrom-StringData @'
id_repadmin=RepAdmin Log Files
id_repadminobtaining=Running RepAdmin tool and obtaining output
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBA... |
combined_dataset/train/non-malicious/63.ps1 | 63.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/Get-HostsFile_1.ps1 | Get-HostsFile_1.ps1 | Function Get-HostsFile {
<#
.SYNOPSIS
Retrieves the contents of a hosts file on a specified system
.DESCRIPTION
Retrieves the contents of a hosts file on a specified system
.PARAMETER Computer
Computer name to view host file from
.NOTES
Name: Get-HostsFile
Author: Boe Prox
DateCre... |
combined_dataset/train/non-malicious/2972.ps1 | 2972.ps1 |
[cmdletbinding()]
param(
[validateSet('Test', 'Analyze', 'Pester', 'Clean', 'Build', 'CreateMarkdownHelp', 'BuildNuget', 'PublishChocolatey', 'PublishPSGallery')]
[string]$Task = 'Test',
[switch]$Bootstrap
)
$sut = Join-Path -Path $PSScriptRoot -ChildPath 'src'
$manifestPath ... |
combined_dataset/train/non-malicious/sample_60_28.ps1 | sample_60_28.ps1 | <#
# .DESCRIPTION
# Download and install Microsoft Monitoring Agent for Windows.
#
# .PARAMETER workspaceId
# The log analytics workspace id a target node has to connect to.
#
# .PARAMETER workspacePrimaryKey
# The primary key of log analytics workspace
#
#>
$ErrorActionPreference = "Stop"
# i... |
combined_dataset/train/non-malicious/sample_41_3.ps1 | sample_41_3.ps1 | // Copyright (c) Microsoft Corporation. All rights reserved.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function exitIfHostProcessNotRunning(processName, pid) {
try {
process.kill(pid, 0);
}
catch (error) {
console.error('Unable to find parent process ' + processName + ':' + pi... |
combined_dataset/train/non-malicious/Get Stock Quotes.ps1 | Get Stock Quotes.ps1 | function Get-StockQuote {
param($symbols)
process {
$s = new-webserviceproxy -uri http://www.webservicex.net/stockquote.asmx
foreach ($symbol in $symbols) {
$result = [xml]$s.GetQuote($symbol)
$result.StockQuotes.Stock
}
}
}
# Example:
# Get-StockQuote VMW, EMC | select Symbol, Last
|
combined_dataset/train/non-malicious/2572.ps1 | 2572.ps1 | param (
[string]$filename = $(throw "need a filename, e.g. c:\temp\test.xls"),
[string]$worksheet
)
if (-not (Test-Path $filename)) {
throw "Path '$filename' does not exist."
exit
}
if (-not $worksheet) {
Write-Warning "Defaulting to Sheet1 in workbook."
$worksheet = "Sheet1"
}
$filename = R... |
combined_dataset/train/non-malicious/74.ps1 | 74.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aad... |
combined_dataset/train/non-malicious/sample_8_54.ps1 | sample_8_54.ps1 | ConvertFrom-StringData @'
id_wsftpsiexplorercrashcheck_st=Wsftpsi.dll version 12.3.0.1 was detected in this machine. This version is known to cause consistent Explorer crashes
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE... |
combined_dataset/train/non-malicious/2826.ps1 | 2826.ps1 | Function Import-XMLConfig
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory = $true)]
$ConfigPath
)
[hashtable]$Config = @{ }
$xmlfile = [xml]([System.IO.File]::ReadAllText($configPath))
$Config.CarbonServer = $xmlfile.Configuration.Graphite.CarbonServer... |
combined_dataset/train/non-malicious/2494.ps1 | 2494.ps1 |
$ServiceName = "SQL Server (SOX2)"
$TranManSec = "Mutual"
$GroupPath = "HKLM:\Cluster\Groups"
$GroupList = dir $GroupPath
foreach ($Group in $GroupList)
{
$GroupChildPath = $Group.PSPath
if ((Get-ItemProperty -path $GroupChildPath -name Name).Name -eq $ServiceName)
... |
combined_dataset/train/non-malicious/sample_10_26.ps1 | sample_10_26.ps1 | #************************************************
# DC_Setup_AppCompat.ps1
# Version 1.0
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects additional AppCompat information.
# Called from: TS_AutoAddCommands_Setup.ps1
#*******************************************************
... |
combined_dataset/train/non-malicious/1262.ps1 | 1262.ps1 |
function Test-CDscTargetResource
{
[CmdletBinding()]
[OutputType([bool])]
param(
[Parameter(Mandatory=$true)]
[hashtable]
$TargetResource,
[Parameter(Mandatory=$true)]
[hashtable]
$DesiredResource,
[Parameter(Mandatory=$true)]... |
combined_dataset/train/non-malicious/sharpsvn, btw PS sucks.ps1 | sharpsvn, btw PS sucks.ps1 | [string]$rootDir = "C:\\Build\\"
[string]$buildDir = "C:\\Build\\build_dir\\"
[string]$outputDir = "C:\\Build\\output_dir\\"
[string]$svnDir = "C:\\Build\\build_dir\\vacuum"
[string]$svnUrl = "http://vacuum-im.googlecode.com/svn/trunk/"
$currentScriptDirectory = Get-Location
[System.IO.Directory]::SetCurrentDir... |
combined_dataset/train/non-malicious/Get-Weather 2.1.ps1 | Get-Weather 2.1.ps1 | #require -version 2.0
#require -shellid PoshConsole
###################################################################################################
## Get-Weather
## Parse and display the current weather and forecast from yahoo RSS
## Note that you _could_ modify this a bit to return "current condition" and "... |
combined_dataset/train/non-malicious/2451.ps1 | 2451.ps1 |
[CmdletBinding()]
param (
[Parameter(Mandatory,
ValueFromPipeline,
ValueFromPipelineByPropertyName)]
[ValidateScript({Test-Path $_ -PathType 'Container'})]
[string]$FolderPath,
[Parameter(Mandatory,
ValueFromPipeline,
ValueFromPipelineByPropertyName)]
[string]$Vm,
[Parameter(ValueFromPipelineByPr... |
combined_dataset/train/non-malicious/Get-LocalGroupMember.ps1 | Get-LocalGroupMember.ps1 | function Get-LocalGroupMember {
param(
# The name of the local group to retrieve members of
[Parameter(Position=0,Mandatory=$true)]
[String]$GroupName = "administrators",
# A filter for the user name(s)
[Parameter(Position=1)]
[String]$UserName = "*",
# The computer to query (defaults ... |
combined_dataset/train/non-malicious/4433.ps1 | 4433.ps1 | function Uninstall-Script
{
[CmdletBinding(DefaultParameterSetName='NameParameterSet',
SupportsShouldProcess=$true,
HelpUri='https://go.microsoft.com/fwlink/?LinkId=619789')]
Param
(
[Parameter(ValueFromPipelineByPropertyName=$true,
Manda... |
combined_dataset/train/non-malicious/Get-GoogleSpreadsheets.ps1 | Get-GoogleSpreadsheets.ps1 | #requires -version 2
Function Get-GoogleSpreadSheets {
param(
$userName = $(throw 'Please specify a user name'),
$password = $(throw 'Please specify a password')
)
Add-Type -Path "C:\\Program Files\\Google\\Google Data API SDK\\Redist\\Google.GData.Client.dll"
Add-Type -Path "C:... |
combined_dataset/train/non-malicious/New-ODataServiceProxy_2.ps1 | New-ODataServiceProxy_2.ps1 | function New-ODataServiceProxy {
#.Synopsis
# Creates a proxy class for an odata web service
# YOU NEED TO BE VERY CAREFUL NOT TO OUTPUT THE PROXY OBJECT TO THE POWERSHELL HOST!
#.Description
# Uses the data service client utility (DataSvcUtil.exe) to generate a proxy class (and types for all objects) for an O... |
combined_dataset/train/non-malicious/sample_33_27.ps1 | sample_33_27.ps1 | #
# Module manifest for module 'Microsoft.SME.Insights'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.Insights.psm1'
# Version number of this module.
ModuleVersion = '2.25.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to uniq... |
combined_dataset/train/non-malicious/sample_53_22.ps1 | sample_53_22.ps1 | #
# Module manifest for module 'OCI.PSModules.Loadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loadbalancer.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/Convert-BounceToX_10.ps1 | Convert-BounceToX_10.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/295.ps1 | 295.ps1 | function Test-PSFPowerShell
{
[OutputType([System.Boolean])]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Test-PSFPowerShell')]
param (
[Version]
$PSMinVersion,
[Version]
$PSMaxVersion,
[PSFramework.FlowControl.PSEdition]
$Edition,
[PSFramework.FlowCont... |
combined_dataset/train/non-malicious/New-FileShare.ps1 | New-FileShare.ps1 | Function New-FileShare {
#this function returns $True is the share is successfully created
Param([string]$computername=$env:computername,
[string]$path=$(Throw "You must enter a complete path relative to the remote computer."),
[string]$share=$(Throw "You must enter the name of the new share... |
combined_dataset/train/non-malicious/sample_66_29.ps1 | sample_66_29.ps1 | $osInfo = Get-WmiObject -Class Win32_OperatingSystem
# check if running on Windows Server
if ($osInfo.ProductType -eq 3) {
Install-WindowsFeature Server-Media-Foundation
}
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwE... |
combined_dataset/train/non-malicious/sample_65_32.ps1 | sample_65_32.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/1469.ps1 | 1469.ps1 |
function Publish-PowerShellGalleryModule
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$ManifestPath,
[Parameter(Mandatory=$true)]
[string]
$ModulePath,
[Parameter(Mandatory=$true)]
[string... |
combined_dataset/train/non-malicious/sample_52_7.ps1 | sample_52_7.ps1 | #
# Module manifest for module 'OCI.PSModules.Streaming'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Streaming.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/Xml Module 4.5.ps1 | Xml Module 4.5.ps1 | #requires -version 2.0
# Improves over the built-in Select-XML by leveraging Remove-XmlNamespace http`://poshcode.org/1492
# to provide a -RemoveNamespace parameter -- if it's supplied, all of the namespace declarations
# and prefixes are removed from all XML nodes (by an XSL transform) before searching.
# IMP... |
combined_dataset/train/non-malicious/sample_59_99.ps1 | sample_59_99.ps1 | #
# Module manifest for module 'OCI.PSModules.Mediaservices'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Mediaservices.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_48_68.ps1 | sample_48_68.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\typescript@5.3.3\node_modules\typescript\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\typ... |
combined_dataset/train/non-malicious/sample_37_41.ps1 | sample_37_41.ps1 | # <copyright>
# INTEL CONFIDENTIAL
#
# Copyright 2021 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you ("License").
# Unless the License provides otherwise, you may not us... |
combined_dataset/train/non-malicious/sample_24_76.ps1 | sample_24_76.ps1 | #
# Module manifest for module 'OCI.PSModules.Datasafe'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datasafe.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/2318.ps1 | 2318.ps1 |
function Get-WeatherForecast
{
[OutputType([pscustomobject])]
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^\d{5}$')]
[int]$ZipCode,
[Parameter()]
[ValidateNotNullOrEmpty()]
[int]$DaysOut = 7
... |
combined_dataset/train/non-malicious/Set-EnvironmentVariable.ps1 | Set-EnvironmentVariable.ps1 | #requires -version 2
function Set-EnvironmentVariable {
param (
[String] [Parameter( Position = 0, Mandatory = $true )] $Name,
[String] [Parameter( Position = 1, Mandatory = $true )] $Value,
[EnvironmentVariableTarget]
[Parameter( Position = 2 )]
$Target = [EnvironmentVariableTarget]::Process,
... |
combined_dataset/train/non-malicious/3041.ps1 | 3041.ps1 | function Should-Match($ActualValue, $RegularExpression, [switch] $Negate, [string] $Because) {
[bool] $succeeded = $ActualValue -match $RegularExpression
if ($Negate) {
$succeeded = -not $succeeded
}
$failureMessage = ''
if (-not $succeeded) {
if ($Negate) {
$fail... |
combined_dataset/train/non-malicious/GPRS Online log_9.ps1 | GPRS Online log_9.ps1 | <#
.SYNOPSIS
Get-GprsTime (V4.0 Update for Windows 7 and allow time correction)
(V4.4 'Interval' now incorporate previous 'FormatSpan' function)
(V4.6 'Adjust' pattern will now reject times like '1:300:50')
Check the total connect time of any GPRS SIM devices from a specified date.
Use ... |
combined_dataset/train/non-malicious/sample_5_48.ps1 | sample_5_48.ps1 | // Copyright (c) 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
// ==================================================================
// DCIM_ProcessorAcceleratorView
// ==================================================================
[
Description ("DCIM_ProcessorAcceleratorView is a representati... |
combined_dataset/train/non-malicious/sample_50_32.ps1 | sample_50_32.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmsynthetics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmsynthetics.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/Get-Parameter_14.ps1 | Get-Parameter_14.ps1 | #Requires -version 2.0
##This is just script-file nesting stuff, so that you can call the SCRIPT, and after it defines the global function, it will call it.
param (
[Parameter(Position=1,ValueFromPipelineByPropertyName=$true,Mandatory=$true)]
[string[]]$Name
,
[Parameter(Position=2,ValueFromPipelineByPr... |
combined_dataset/train/non-malicious/sample_47_72.ps1 | sample_47_72.ps1 | #!/usr/bin/env pwsh
<#
.SYNOPSIS
Stub around Invoke-Pester command used by VSCode PowerShell extension.
.DESCRIPTION
The stub checks the version of Pester and if >= 4.6.0, invokes Pester
using the LineNumber parameter (if specified). Otherwise, it invokes
using the TestName parameter (if specif... |
combined_dataset/train/non-malicious/Update AD Security Group.ps1 | Update AD Security Group.ps1 | #Active Directory Group Name To Be Edited
#Load Active Directory Module
if(@(get-module | where-object {$_.Name -eq "ActiveDirectory"} ).count -eq 0) {import-module ActiveDirectory}
###Functions
function Get-FSMORoles
{
Param (
$Domain
)
$DomainDN = $Domain.defaultNamingContext
$FSMO = @{}
... |
combined_dataset/train/non-malicious/575.ps1 | 575.ps1 |
function Set-SPOMasterPage
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$masterFile
)
$masterUrl = Join-SPOParts -Separator '/' -Parts $clientContext.Site.ServerRelativeUrl, "/_catalogs/masterpage/$masterFile"
$web = $clientContext.Web
Write-Host "System master... |
combined_dataset/train/non-malicious/sample_55_74.ps1 | sample_55_74.ps1 | "use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { t... |
combined_dataset/train/non-malicious/Get Exchange2003 Servers.ps1 | Get Exchange2003 Servers.ps1 | [Array]$ExchSrvs = @("")
[String]$StrFilter = "(objectCategory=msExchExchangeServer)"
$objRootDSE = [ADSI]"LDAP://RootDSE"
[String]$strContainer = $objRootDSE.configurationNamingContext
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = New-object System.DirectoryService... |
combined_dataset/train/non-malicious/sample_39_48.ps1 | sample_39_48.ps1 | #
# Module manifest for module 'OCI.PSModules.Vulnerabilityscanning'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vulnerabilityscanning.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
#... |
combined_dataset/train/non-malicious/sample_0_83.ps1 | sample_0_83.ps1 | [dynamic, provider("dcismprovider")]
class DCIM_LocalRolePrivilege : CIM_Privilege
{
[
Description ("The user-friendly name for this instance. The ElementName property shall be \"DCIM Local Privilege <N>\"."),
Override ("ElementName"),
Required
]
string ElementName;
... |
combined_dataset/train/non-malicious/ConvertTo-GoogleChartNum.ps1 | ConvertTo-GoogleChartNum.ps1 | ## Google Chart API extended value encoding function
#########################################################################
#function ConvertTo-GoogleChartNum{
BEGIN {
## Google's odydecody is a 64 character array
$ody = "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","... |
combined_dataset/train/non-malicious/Run-Defrag_1.ps1 | Run-Defrag_1.ps1 | # Run-Defrag
# Defragments the targeted hard drives.
#
# Args:
# $server: A target Server 2003 or 2008 system
# $drive: An optional drive letter. If this is blank then all
# drives are defragmented
# $force: If this switch is set then a defrag will be forced
# even if the drive is lo... |
combined_dataset/train/non-malicious/sample_61_33.ps1 | sample_61_33.ps1 |
if(window.Type && window.Type.registerNamespace)
Type.registerNamespace("SP");
else
if(typeof window["SP"] == "undefined")
{
window["SP"] = {};
window["SP"].__namespace = true
}
SP.RuntimeRes = function()
{
};
SP.RuntimeRes.registerClass &&
SP.RuntimeRes.registerClass(... |
combined_dataset/train/non-malicious/PS+ImgBurn burn all ISOs.ps1 | PS+ImgBurn burn all ISOs.ps1 | function burn()
{
#get the files and ship them to burn-file
dir -recurse -include *.iso -path c:\\,d:\\,e:\\ | foreach { burn-file $_.FullName }
}
function burn-file($filename)
{
#call img burn with the nessessary arguments
. "c:\\Program Files\\ImgBurn\\ImgBurn.exe" /mode ISOWRITE /WAITFORMEDIA /start /close... |
combined_dataset/train/non-malicious/sample_3_83.ps1 | sample_3_83.ps1 | ConvertFrom-StringData @'
id_clusterlogsoutputdesc=Cluster logs
id_clusterlogsobtaining=Obtaining cluster logs
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0... |
combined_dataset/train/non-malicious/Boots & Background Jobs.ps1 | Boots & Background Jobs.ps1 | Import-Module PowerBoots
# This simulates a download function, say Jaykul's Get-Webfile
# You can output current progress for a large file, or if it's an array of links then out put the current (index/length)%
# You will need to run the function as a background thread in order for it to not interfere with the UI t... |
combined_dataset/train/non-malicious/sample_33_22.ps1 | sample_33_22.ps1 | #
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ... |
combined_dataset/train/non-malicious/sample_20_34.ps1 | sample_20_34.ps1 | # To check useKernelMode and useAppPoolCredentials For IIS 7
# support.microsoft.com/kb/2536453
# Kernel mode authentication within IIS is disabled for the Microsoft Dynamics CRM website in IIS 7.0 and 7.5
#
# Created: 3/23/2012
# Author: Jonathan Randall
#*********************************************************... |
combined_dataset/train/non-malicious/sample_0_72.ps1 | sample_0_72.ps1 | #
# Module manifest for module 'OCI.PSModules.Loganalytics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loganalytics.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_42_65.ps1 | sample_42_65.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=Nenašel se požadovaný modul PowerShell (FailoverClusters). Pomocí nástroje Role a funkce nainstalujte: Nástroje pro vzdálenou správu serveru | Nástroje pro správu funkcí | Nástroje Clustering s podporou převzetí služeb při selhání | Modul clusteru s podporou pře... |
combined_dataset/train/non-malicious/Write-Log_2.ps1 | Write-Log_2.ps1 | function Write-Log {
#region Parameters
[cmdletbinding()]
Param(
[Parameter(ValueFromPipeline=$true,Mandatory=$true)] [ValidateNotNullOrEmpty()]
[string] $Message,
[Parameter()] [ValidateSet(“Error”, “Warn”, “Info”)]
[string] $Level = “Info”,
[Parameter()]
[Switch] $NoConsole... |
combined_dataset/train/non-malicious/sample_10_88.ps1 | sample_10_88.ps1 | #************************************************
# TS_4KDriveInfo.ps1
# Version 1.0.2
# Date: 03-21-2011
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script detects 4KB/ 512e drive informaiton
#************************************************
# 2023-02-20 WalterE mod Trap #we#
trap [Exce... |
combined_dataset/train/non-malicious/3398.ps1 | 3398.ps1 |
function get_all_vm_locations
{
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
{
$namespace = "Microsoft.Compute"
$type = "virtualMachines"
$location = Get-AzureRmResourceProvider -ProviderNam... |
combined_dataset/train/non-malicious/1293.ps1 | 1293.ps1 |
function Assert-WindowsFeatureFunctionsSupported
{
[CmdletBinding()]
param(
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
if( $null -eq $windowsFeaturesNotSupported )
{
$script:useServerManager = $nul... |
combined_dataset/train/non-malicious/sample_39_24.ps1 | sample_39_24.ps1 | #
# Module manifest for module 'OCI.PSModules.Filestorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Filestorage.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_44_6.ps1 | sample_44_6.ps1 | #
# Module manifest for module 'OCI.PSModules.Loggingsearch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loggingsearch.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/playlist.com music cache.ps1 | playlist.com music cache.ps1 |
#put the playlist.com playlist number into $pl
$pl = 14870805259;
([xml](new-object system.net.webclient).downloadstring("http://pl.playlist.com/pl.php?playlist=$([int]($pl/256))")).playlist.tracklist.track | % {try { $a= $_.tracktitle;$a;(new-object system.net.webclient).downloadfile($_.originallocation,"c:\\mus... |
combined_dataset/train/non-malicious/sample_39_75.ps1 | sample_39_75.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.Synopsis
Group Policy tools use administrative template files (.admx, .adml) to populate policy settings in the user interface.
This allows administrators to manage registry-based policy settings.
This script installes Powe... |
combined_dataset/train/non-malicious/Get-Sysinternals.ps1 | Get-Sysinternals.ps1 |
function Get-SysInternals {
param ( $sysIntDir=(join-path $env:systemroot "\\Sysinternals\\") )
if(!(Test-Path -Path $sysIntDir -PathType Container))
{
$null = New-Item -Type Directory -Path $sysIntDir -Force
}
$log = join-path $sysIntDir "changes.log"
Add-Content ... |
combined_dataset/train/non-malicious/Out-SqlLdrCtlFile.ps1 | Out-SqlLdrCtlFile.ps1 | param($fileName)
Add-Type -Path "C:\\Oracle\\Oracle.ManagedDataAccess.dll"
#Change these values
$userID = "yourOracleUserID"
$password ="yourOraclePassword"
$dataSource ="yourOracleDB"
#Assumes Table name is same as file name without extension
#and ctl file will output to same directory with ctl extension
... |
combined_dataset/train/non-malicious/2758.ps1 | 2758.ps1 |
Update-TypeData -TypeName System.Diagnostics.Process -SerializationDepth 3 -Force
Get-Process |
combined_dataset/train/non-malicious/sample_12_96.ps1 | sample_12_96.ps1 | ConvertFrom-StringData @'
progressbar_id_crmassembliesdetectedingac=Searching Global Assembly Cache For Microsoft Dynamics CRM Assemblies
progressbar_id_crmassembliesdetectedingacdesc=Searching Global Assembly Cache For Microsoft Dynamics CRM Assemblies
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIo... |
combined_dataset/train/non-malicious/2122.ps1 | 2122.ps1 |
Describe "Tests Debugger GetCallStack() on runspaces when attached to a WinRM host process" -Tags "CI" {
It -skip "Disabled test because it is fragile and does not consistently succeed on test VMs" { }
return
try
{
$wc = [System.Management.Automation.Runspaces.WSManConnectionInfo]:... |
combined_dataset/train/non-malicious/4299.ps1 | 4299.ps1 |
$ProgressPreference = "SilentlyContinue"
$RepositoryName = 'INTGallery'
$SourceLocation = 'https://www.poshtestgallery.com'
$RegisteredINTRepo = $false
$ContosoServer = 'ContosoServer'
$FabrikamServerScript = 'Fabrikam-ServerScript'
$Initialized = $false
function IsInbox { $PSHOME.EndsWith('\WindowsPowerShell\v1.... |
combined_dataset/train/non-malicious/3277.ps1 | 3277.ps1 |
class SlackChannel : Room {
[datetime]$Created
[string]$Creator
[bool]$IsArchived
[bool]$IsGeneral
[int]$MemberCount
[string]$Purpose
}
|
combined_dataset/train/non-malicious/4313.ps1 | 4313.ps1 |
function SuiteSetup {
Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue
Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue
$script:PSGetLocalAppDataPath = Get-PSGetLocalAppDataPath
$script:TempPath = Get-TempPath
Install-NuGetBinarie... |
combined_dataset/train/non-malicious/2392.ps1 | 2392.ps1 |
$ThisModule = "$($MyInvocation.MyCommand.Path -replace "\.Tests\.ps1$", '').psm1"
$ThisModuleName = (($ThisModule | Split-Path -Leaf) -replace ".psm1")
Get-Module -Name $ThisModuleName -All | Remove-Module -Force
Import-Module -Name $ThisModule -Force -ErrorAction Stop
@(Get-Module -Name $ThisModuleName).where({ $... |
combined_dataset/train/non-malicious/PSTUtility.psm1.ps1 | PSTUtility.psm1.ps1 | #=============================================================================
#
# PST Utilities - For Discovery, Import, Removal
#
# Dan Thompson
# dethompson71 at live dot com
#
# This collection of tools for importing PSTs has been pieced together
# over many months of trial and error.
#
# Goal is to get ... |
combined_dataset/train/non-malicious/119.ps1 | 119.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/229.ps1 | 229.ps1 | $UserSam = "TestAccount"
$Search = New-Object -TypeName System.DirectoryServices.DirectorySearcher -ErrorAction 'Stop'
$Search.Filter = "(&((objectclass=user)(samaccountname=$UserSam)))"
$Search.FindAll() | ForEach-Object -Process {
$Account = $_
$AccountGetDirectory = $Account.GetDirec... |
combined_dataset/train/non-malicious/sample_63_60.ps1 | sample_63_60.ps1 | com.microsoft.azure.toolkit.lib.appservice
com.microsoft.azure.toolkit.lib.appservice.config
com.microsoft.azure.toolkit.lib.appservice.deploy
com.microsoft.azure.toolkit.lib.appservice.entity
com.microsoft.azure.toolkit.lib.appservice.file
com.microsoft.azure.toolkit.lib.appservice.function
com.microsoft.azure.t... |
combined_dataset/train/non-malicious/2728.ps1 | 2728.ps1 |
Get-WmiObject -namespace root\Microsoft\SecurityClient -Class AntimalwareHealthStatus |
combined_dataset/train/non-malicious/sample_67_88.ps1 | sample_67_88.ps1 | <#
.SYNOPSIS
NewSelfSignedCertificate.ps1 script file
This is a place-holder file only for agent patch build purposes
#>
Write-Host "This file functionality is deprecated and is place-holder only"
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# ... |
combined_dataset/train/non-malicious/sample_4_52.ps1 | sample_4_52.ps1 | #
# Module manifest for module 'OCI.PSModules.Events'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Events.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_40_48.ps1 | sample_40_48.ps1 | #
# Module manifest for module 'OCI.PSModules.Vnmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vnmonitoring.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_51_31.ps1 | sample_51_31.ps1 | #
# PowerConsole profile
#
<#
.SYNOPSIS
Clear the host content.
.DESCRIPTION
This function replaces the standard Clear-Host and is aliased by "cls".
#>
function Clear-Host
{
$host.PrivateData.ClearHost()
}
<#
.SYNOPSIS
Simple path completion function for PowerConsole.
#>
funct... |
combined_dataset/train/non-malicious/Audit NTFS on Shares_1.ps1 | Audit NTFS on Shares_1.ps1 | $Excel = New-Object -Com Excel.Application
$Excel.visible = $True
$Excel = $Excel.Workbooks.Add()
$wSheet = $Excel.Worksheets.Item(1)
$wSheet.Cells.item(1,1) = "Folder Path:"
$wSheet.Cells.Item(1,2) = "Users/Groups:"
$wSheet.Cells.Item(1,3) = "Permissions:"
$wSheet.Cells.Item(1,4) = "Permissions Inherited:"
... |
combined_dataset/train/non-malicious/sample_24_32.ps1 | sample_24_32.ps1 | #
# Module manifest for module 'OCI.PSModules.Threatintelligence'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Threatintelligence.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Suppo... |
combined_dataset/train/non-malicious/3802.ps1 | 3802.ps1 |
function Test-SetChefExtensionBasic
{
$rgname = Get-ComputeTestResourceName
$loc = Get-ComputeVMLocation
try
{
New-AzResourceGroup -Name $rgname -Location $loc -Force;
$vmsize = 'Standard_A2';
$vmname = 'vm' + $rgname;
$p =... |
combined_dataset/train/non-malicious/sample_25_28.ps1 | sample_25_28.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.