full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_3_81.ps1 | sample_3_81.ps1 | "use strict";(self.webpackChunkeasy_dpl=self.webpackChunkeasy_dpl||[]).push([[6475],{96475:(t,e,n)=>{n.r(e),n.d(e,{default:()=>m});var a=n(442),i=n(6679);const r=Object.freeze({displayName:"HTML",injections:{"R:text.html - (comment.block, text.html meta.embedded, meta.tag.*.*.html, meta.tag.*.*.*.html, meta.tag.*.*.*.*... |
combined_dataset/train/non-malicious/JSON.ps1 | JSON.ps1 | #requires -version 2.0
# No help (yet) because I'm still changing and renaming everything every time I mess with this code
Add-Type -Assembly System.ServiceModel.Web, System.Runtime.Serialization
$utf8 = [System.Text.Encoding]::UTF8
function Convert-JsonToXml
{
PARAM([Parameter(ValueFromPipeline=$true)][strin... |
combined_dataset/train/non-malicious/sample_39_64.ps1 | sample_39_64.ps1 | #
# Module manifest for module 'Az.ResourceMover'
#
# Generated by: Microsoft Corporation
#
# Generated on: 23/04/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.ResourceMover.psm1'
# Version number of this module.
ModuleVersion = '1.2.1'
# Supported P... |
combined_dataset/train/non-malicious/8bcc60bd-75ac-494b-9b5a-36860a627c35.ps1 | 8bcc60bd-75ac-494b-9b5a-36860a627c35.ps1 | #Generated Form Function
function GenerateForm {
########################################################################
# THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK
# OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.
#
# Code Generated By: Richard ... |
combined_dataset/train/non-malicious/Get Network Utilization_2.ps1 | Get Network Utilization_2.ps1 | $counters = @()
foreach ($inst in (new-object System.Diagnostics.PerformanceCounterCategory("network interface")).GetInstanceNames()){
$cur = New-Object system.Diagnostics.PerformanceCounter('Network Interface','Bytes Total/sec', $inst)
$max = New-Object system.Diagnostics.PerformanceCounter('Network Interface',... |
combined_dataset/train/non-malicious/sample_17_50.ps1 | sample_17_50.ps1 |
function New-AzDataProtectionResourceGuard
{
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IResourceGuardResource')]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates a resou... |
combined_dataset/train/non-malicious/Script permissions_2.ps1 | Script permissions_2.ps1 | <#
.SYNOPSIS
Applies permissions and roles to vSphere vApps
.DESCRIPTION
Applies permissions and roles to vSphere vApps
-VIServer (Optional, defaults to Development) {FQDN of VCentre Server}
-AppName (Required) {VApp Label}
-ADGroup (Optional) {Domain\\Group_Object}
-Role (Optional) {vSphere Role, ReadO... |
combined_dataset/train/non-malicious/4176.ps1 | 4176.ps1 |
[CmdletBinding()]
param ()
function Get-Architecture {
[CmdletBinding()][OutputType([string])]
param ()
$OSArchitecture = (Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture).OSArchitecture
Return $OSArchitecture
}
function Get-RelativePath {
[CmdletBinding()][OutputType([string... |
combined_dataset/train/non-malicious/sample_7_59.ps1 | sample_7_59.ps1 | #************************************************
# TS_PrintCSRBloatingCheck.ps1
# Version 1.0.1
# Date: 6/26/2012
# Author: v-maam
# Description: [Idea ID 2374] [Windows] Spooler service hangs since CSR exhausts the 512 threads in thread pool
# Rule number: 2374
# Rule URL: http://sharepoint/sites/rules/Rule... |
combined_dataset/train/non-malicious/Add-ExtendedFileProperti.ps1 | Add-ExtendedFileProperti.ps1 | ##############################################################################\n##\n## Add-ExtendedFileProperties\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_23_5.ps1 | sample_23_5.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/2208.ps1 | 2208.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, HelpMessag... |
combined_dataset/train/non-malicious/sample_48_34.ps1 | sample_48_34.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 = '75.1.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_46_21.ps1 | sample_46_21.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 = '80.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/Test-IPMask.ps1 | Test-IPMask.ps1 | <#
.SYNOPSIS
Tests for a valid IP mask.
.DESCRIPTION
The Test-IPMask script validates the input string against all CIDR subnet masks and returns a boolean value.
.PARAMETER IPMask
The IP mask to be evaluated.
.EXAMPLE
Test-IPMask 255.255.255.0
Description
-----------
Tests if the I... |
combined_dataset/train/non-malicious/sample_57_14.ps1 | sample_57_14.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubusage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubusage.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_19_64.ps1 | sample_19_64.ps1 | . ./utils_cts.ps1
SkipSecondExecution
Consume-GenericMessages
# SIG # Begin signature block
# MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB+fUgpeqFuKoCC
# lJNT5/xEcXoMq4... |
combined_dataset/train/non-malicious/4110.ps1 | 4110.ps1 |
Function RenameWindow ($Title) {
Set-Variable -Name a -Scope Local -Force
$a = (Get-Host).UI.RawUI
$a.WindowTitle = $Title
Remove-Variable -Name a -Scope Local -Force
}
Function UninstallName($Description) {
Set-Variable -Name AppName -Scope Local -Force
Set-Variable -Name Arguments -Scope Loc... |
combined_dataset/train/non-malicious/1841.ps1 | 1841.ps1 |
Describe "TestWSMan tests" -Tags 'Feature','RequireAdminOnWindows' {
BeforeAll {
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
if ( !$IsWindows ) {
$PSDefaultParameterValues["it:skip"] = $true
}
else {
$testWsman = [Microsoft.WSMan.Man... |
combined_dataset/train/non-malicious/sample_31_76.ps1 | sample_31_76.ps1 | ##------------------------------------------------------------------
## <copyright file="Disable-Extension.ps1" company="Microsoft">
## Copyright (C) Microsoft. All rights reserved.
## </copyright>
##------------------------------------------------------------------
$ErrorActionPreference = "Stop"
$functio... |
combined_dataset/train/non-malicious/sample_20_20.ps1 | sample_20_20.ps1 | ConvertFrom-StringData @'
id_dfsrupdateworkerthreadcountcheck_st=DFSR setting UpdateWorkerThreadCount value of 64 or higher may cause hang condition for DFSR inbound replication
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3A... |
combined_dataset/train/non-malicious/sample_53_24.ps1 | sample_53_24.ps1 | <#
.SYNOPSIS
Demonstrates how to write a command that works with paths that do
not allow wildards but must exist.
.DESCRIPTION
This command does not require a LiteralPath parameter because the
Path parameter can handle paths that use wildcard characters. That's
because this command does not ... |
combined_dataset/train/non-malicious/sample_9_81.ps1 | sample_9_81.ps1 | #************************************************
# TS_SBSL_DHCPRelayKB2459530.ps1
# Version 1.0.1
# Date: 5/14/2012
# Author: v-maam
# Description: [Idea ID 2749] [Windows] SBSL Windows firewall delays acquisition of DHCP address from DHCP relay on domain-joined W7 client
# Rule number: 2749
# Rule URL: //sh... |
combined_dataset/train/non-malicious/4349.ps1 | 4349.ps1 | function Get-ExternalModuleDependencies
{
Param (
[Parameter(Mandatory=$true)]
[PSModuleInfo]
$PSModuleInfo
)
if($PSModuleInfo.PrivateData -and
($PSModuleInfo.PrivateData.GetType().ToString() -eq "System.Collections.Hashtable") -and
$PSModuleInfo.PrivateData["PSData"] ... |
combined_dataset/train/non-malicious/2183.ps1 | 2183.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, ParameterSetName="Multiple", HelpMessage="Site server where the SMS Provider is installed")]
[parameter(ParameterSetName="Single")]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[ValidateNotNullOrEmpt... |
combined_dataset/train/non-malicious/SharePoint Large Lists_2.ps1 | SharePoint Large Lists_2.ps1 | [reflection.assembly]::loadwithpartialname("Microsoft.SharePoint")
$cs = [microsoft.sharepoint.administration.spwebservice]::ContentService
$global:largeListThreshhold = 2000
function Is-Admin([Microsoft.SharePoint.SPRoleAssignment]$roleAssignment)
{
return (($roleAssignment.roledefinitionbindings | where { ($_... |
combined_dataset/train/non-malicious/1428.ps1 | 1428.ps1 |
function Install-CMsmq
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Switch]
$HttpSupport,
[Switch]
$ActiveDirectoryIntegration,
[Switch]
$Dtc
)
Set-StrictMode -Version 'Latest'
Use-Calle... |
combined_dataset/train/non-malicious/sample_8_60.ps1 | sample_8_60.ps1 | #************************************************
# DC_ClusterEventLogs.ps1
# Version 2.0.2
# Date: 11-30-2009
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script calls TS_GetEvents.ps1 to export cluster-related event logs
#************************************************
if($debug -eq $... |
combined_dataset/train/non-malicious/sample_54_61.ps1 | sample_54_61.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(Mand... |
combined_dataset/train/non-malicious/WPFDbSpace.ps1 | WPFDbSpace.ps1 | #Usage: Get-SqlDatabase 'Z002\\Sql2k8' | where {$_.name -like "pubs*"} | ./WPFDbSpace.ps1
#Note: Requires .NET 3.5, Visifire Charts (tested on v2.1.0), Powerboots (tested on v0.1), and SQLPSX (tested on v1.5)
$libraryDir = Convert-Path (Resolve-Path "$ProfileDir\\Libraries")
[Void][Reflection.Assembly]::LoadFrom( ... |
combined_dataset/train/non-malicious/4138.ps1 | 4138.ps1 |
[CmdletBinding()]
param
(
[switch]$SCCM
)
function Enable-Reboot {
[CmdletBinding()]
param ()
If ($SCCM.IsPresent) {
$TaskSequence = New-Object -ComObject Microsoft.SMS.TSEnvironment
$TaskSequence.Value('SMSTSRetryRequested') = $true
$TaskSequence.Value('SMSTSRebootRequested') = $true
} else {
... |
combined_dataset/train/non-malicious/Get-Help.ps1 | Get-Help.ps1 | #function get-help() {\ncmdlet -DefaultParameterSet AllUsersView `\n\nparam(\n [Parameter(Position=0, ValueFromPipelineByPropertyName=$true)]\n [System.String]\n $Name,\n\n [ValidateSet("Alias","Cmdlet","Provider","General","FAQ","Glossary","HelpFile","All")]\n [System.String[]]\n $Category,\n\n [System.S... |
combined_dataset/train/non-malicious/sample_44_78.ps1 | sample_44_78.ps1 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# IMPORTANT: Do not invoke this file directly. Please instead run eng/common/TestResources/New-TestResources.ps1 from the repository root.
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')]
param (
... |
combined_dataset/train/non-malicious/159.ps1 | 159.ps1 | function New-RandomPassword
{
PARAM (
[Int32]$Length = 12,
[Int32]$NumberOfNonAlphanumericCharacters = 5,
[Int32]$Count = 1
)
BEGIN
{
Add-Type -AssemblyName System.web;
}
PROCESS
{
1..$Count | ForEach-Object {
[System.Web.Security.Memb... |
combined_dataset/train/non-malicious/DNS functions_1.ps1 | DNS functions_1.ps1 | Param (
[Parameter(Mandatory=$true, Position=1)][string] $SourceServer,
[Parameter(Mandatory=$true, Position=2)][string] $SourceZone,
[Parameter(Mandatory=$true, Position=3)][string] $DestinationServer,
[Parameter(Mandatory=$true, Position=4)][string] $DestinationZone,
[string[]] $RRtypes = @("MicrosoftDNS_AType")... |
combined_dataset/train/non-malicious/2362.ps1 | 2362.ps1 | $script:monitorServer = 'SRV1'
function New-AdGroupMembershipMonitor {
[OutputType('pscustomobject')]
[CmdletBinding(SupportsShouldProcess)]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$GroupName,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[scriptblock]$Action,
[Paramet... |
combined_dataset/train/non-malicious/3213.ps1 | 3213.ps1 |
[CmdletBinding()]
param(
[switch]
$Clean,
[switch]
$Bootstrap,
[switch]
$Test,
[ValidateSet("Debug", "Release")]
[string]
$Configuration = "Debug",
[ValidateSet("net461", "netcoreapp2.1")]
[string]
$Framework
)
if ($Clean) {
try {
Push-Location $PSScrip... |
combined_dataset/train/non-malicious/3297.ps1 | 3297.ps1 |
function Remove-PoshBotStatefulData {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '', Scope='Function', Target='*')]
[cmdletbinding(SupportsShouldProcess)]
param(
[parameter(Mandatory)]
[string[]]$Name,
[validateset('Global','Module')]
... |
combined_dataset/train/non-malicious/sample_52_42.ps1 | sample_52_42.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may c... |
combined_dataset/train/non-malicious/sample_65_81.ps1 | sample_65_81.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 = '84.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/1480.ps1 | 1480.ps1 |
function Convert-RelatedLinkToHtml
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
$CommandHelp,
[string]
$ModuleName,
[string[]]
$Script
)
begin
{
Set-StrictMode -Version 'Lat... |
combined_dataset/train/non-malicious/3397.ps1 | 3397.ps1 |
function New-WADConfigFromTemplate ($inputPath, $outputPath, $storageAccountName)
{
(Get-Content $inputPath).replace('[StorageAccountName]', $storageAccountName) | Set-Content $outputPath;
}
function Test-DiagnosticsExtensionBasic
{
$rgname = Get-ComputeTestResourceName
$loc = Get-ComputeVM... |
combined_dataset/train/non-malicious/sample_10_74.ps1 | sample_10_74.ps1 | ConvertFrom-StringData @'
id_clusterdependencyreport=Cluster resource dependency report
id_clusterdependencyreportdesc1=Obtaining cluster resource dependency report
id_clusterdependencyreportdesc=Obtaining cluster resource dependency report from group %GroupName%
'@
# SIG # Begin signature block
# MIIoUgYJKoZIh... |
combined_dataset/train/non-malicious/1476.ps1 | 1476.ps1 |
function Publish-BitbucketDownload
{
[CmdletBinding()]
param(
[pscredential]
$Credential,
[Parameter(Mandatory=$true)]
[string]
$Username,
[Parameter(Mandatory=$true)]
[string]
$ProjectName,
... |
combined_dataset/train/non-malicious/2168.ps1 | 2168.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")]
[ValidateNotNullOrEmpty()]
[string]$SiteServer,
[parameter(Mandatory=$false, HelpMessage="Enable disabled programs")]
[switch]$Enable
)
Begin {
tr... |
combined_dataset/train/non-malicious/sample_18_90.ps1 | sample_18_90.ps1 | #
# Module manifest for module 'OCI.PSModules.Bds'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bds.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_58_89.ps1 | sample_58_89.ps1 | Test-xDscResource..\DSCResources\DCPP_POSTBehavior
Test-xDscSchema..\DSCResources\DCPP_POSTBehavior\DCPP_POSTBehavior.schema.mof
# SIG # Begin signature block
# MIIutAYJKoZIhvcNAQcCoIIupTCCLqECAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBA... |
combined_dataset/train/non-malicious/Select-CLSCompliant.ps1 | Select-CLSCompliant.ps1 |
function Select-CLSCompliant {
#.Synopsis
# Outputs the same as "Select-Object *" with basic error handling for properties that are not CLS Compliant
[CmdletBinding()]
param([Parameter(ValueFromPipeline=$true)]$InputObject)
process {
foreach($in in $InputObject) {
$In | Select-Object *
tra... |
combined_dataset/train/non-malicious/sample_64_20.ps1 | sample_64_20.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Suppor... |
combined_dataset/train/non-malicious/sample_8_41.ps1 | sample_8_41.ps1 | ConvertFrom-StringData @'
id_ctsbitsclient=BITS Client Component
id_ctsbitsclientdescription=Collects information about the BITS client component.
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNL... |
combined_dataset/train/non-malicious/sample_66_56.ps1 | sample_66_56.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/The Old Dogs ExcelCookBo_1.ps1 | The Old Dogs ExcelCookBo_1.ps1 | #
# DATE : 6/21/2010
# COMMENT: This is an updated Version of my Cook Book from Augest of 2008
#
#
#===============================================================
# All errors and mistakes are my own. Thanks to all who have helped
# along the way.
#
# One thing I would add is that if you are using anything... |
combined_dataset/train/non-malicious/NTFS ACLs Folder Tree_1.ps1 | NTFS ACLs Folder Tree_1.ps1 | #######################################
# TITLE: listACL.ps1 #
# AUTHOR: Santiago Fernandez Mu±oz #
# #
# DESC: This script generate a HTML #
# report show all ACLs asociated with #
# a Folder tree structure starting in #
# root specified by the user ... |
combined_dataset/train/non-malicious/mstsc-Ac.ps1 | mstsc-Ac.ps1 | <#
.SYNOPSIS
mstsc-Ac.ps1 (Version 1.0, 7 Jan 2012)
The author may be contacted via zippy1981@gmail.com
The latest authoritative version of this script is always available at
http://bit.ly/mstsc-Ac
.DESCRIPTION
This script will see if a host is up and listening on a given port, and start a
remote desktop conn... |
combined_dataset/train/non-malicious/sample_30_60.ps1 | sample_30_60.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/powershell ise config_1.ps1 | powershell ise config_1.ps1 | <configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
<supportedRuntime version="v2.0" />
<process>
<rollForward enabled="false" />
</process>
</startup>
<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>
|
combined_dataset/train/non-malicious/sample_4_14.ps1 | sample_4_14.ps1 | #************************************************
# TS_Win7PrintUpdateRollupCheck.ps1
# Version 1.0.1
# Date: 6/8/2012
# Author: v-alyao
# Description: [Idea ID 4168] [Windows] Check for existence of 2647753 for printing issues
# Rule number: 4168
# Rule URL: http://sharepoint/sites/rules/Rule Submissions/Fo... |
combined_dataset/train/non-malicious/Write-ASCII-Letters.ps1 | Write-ASCII-Letters.ps1 | #
#.SYNOPSIS
# Svendsen Tech's PowerShell ASCII art script creates ASCII art characters
# from a subset of common letters, numbers and punctuation characters.
# You can add new characters by editing the XML and updating the
# $AcceptedChars regexp.
#
# Author: Joakim Svendsen, Svendsen Tech
#
#.DESCRIPTION
# ... |
combined_dataset/train/non-malicious/CSV Validator Framework_1.ps1 | CSV Validator Framework_1.ps1 | # --- begin test-csv.ps1 ---
param(
[string]$Path = $(throw "require CSV path!"),
[string]$RulesetPath = $(throw "require Ruleset path!")
)
$csvFiles = Resolve-Path -Path $Path
# load rules
if ((Test-Path (Resolve-Path $RulesetPath))) {
# ruleset is found, execute and assign result to vari... |
combined_dataset/train/non-malicious/2689.ps1 | 2689.ps1 | function Get-NtSystemInformation
{
[CmdletBinding()] Param (
[Parameter( ParameterSetName = 'PoolTagInformation' )]
[Switch]
$PoolTagInformation,
[Parameter( ParameterSetName = 'ModuleInformation' )]
[Switch]
$ModuleInformation,
[Parameter( ParameterSetNam... |
combined_dataset/train/non-malicious/sample_16_93.ps1 | sample_16_93.ps1 | <#
.SYNOPSIS
Enables or disables the AllowInsecureGuestAuth Registry Key on the local machine.
If the Registry Key does not already exist, it is created with the provided value.
.PARAMETER NewValue
Represents the new value for the AllowInsecureGuestAuth Registry Key.
.EXAMPLE
.\Local-Enable-AllowInse... |
combined_dataset/train/non-malicious/sample_20_47.ps1 | sample_20_47.ps1 | ConvertFrom-StringData @'
id_dpm_eventlog_activity=Gathering Eventlogs
id_dpm_status_eventlogs=Running DC_DPMEventLogs.ps1
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAI... |
combined_dataset/train/non-malicious/3532.ps1 | 3532.ps1 |
function Get-ResourceGroupLocation
{
$namespace = "Microsoft.RecoveryServices"
$type = "vaults"
$resourceProvider = Get-AzResourceProvider -ProviderNamespace $namespace | where {$_.ResourceTypes[0].ResourceTypeName -eq $type}
if ($resourceProvider -eq $null)
{
return "west... |
combined_dataset/train/non-malicious/sample_28_98.ps1 | sample_28_98.ps1 | class AzStackHciConnectivityTarget
{
# Attributes for Azure Monitor schema
[string]$Name #Name of the individual test/rule/alert that was executed. Unique, not exposed to the customer.
[string]$Title #User-facing name; one or more sentences indicating the direct issue.
[string]$Severity #Severity o... |
combined_dataset/train/non-malicious/Fridays thirteenth.ps1 | Fridays thirteenth.ps1 | function Get-FridaysThirteenth {
param (
[datetime]$end = "12/31/2010"
)
[DateTime]$begin = "02/13/2009"
for ($i = $begin; $i -lt $end; $i = $i.AddMonths(1)) {
if ($i.DayOfWeek -eq 'Friday') {
"{0:d}" -f $i
} #if
} #for
} #function
|
combined_dataset/train/non-malicious/1788.ps1 | 1788.ps1 |
Describe "Add-Content cmdlet tests" -Tags "CI" {
BeforeAll {
$file1 = "file1.txt"
Setup -File "$file1"
}
Context "Add-Content should actually add content" {
It "should Add-Content to TestDrive:\$file1" {
$result = Add-Content -Path TestDrive:\$file1 -Value "ExpectedContent" -PassThru
$... |
combined_dataset/train/non-malicious/3179.ps1 | 3179.ps1 | function Get-UserSession {
[cmdletbinding()]
Param(
[Parameter(
Position = 0,
ValueFromPipeline = $True)]
[string[]]$computername = "localhost",
[switch]$parseIdleTime,
[validaterange(0,120)]$timeout = 15
)
ForEach($computer in $c... |
combined_dataset/train/non-malicious/sample_32_74.ps1 | sample_32_74.ps1 | #
# Module manifest for module 'OCI.PSModules.Vbsinst'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vbsinst.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_51_23.ps1 | sample_51_23.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module -Name "$PSScriptRoot\..\..\Common\... |
combined_dataset/train/non-malicious/sample_44_61.ps1 | sample_44_61.ps1 | #
# Module manifest for module 'OCI.PSModules.Opsi'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Opsi.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_42_45.ps1 | sample_42_45.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Invoke-AMTPowerManagement {
<#
.Synopsis
Invokes an Intel Active Management Technology power control command
.Description
This CmdLet invokes an Intel Active Management Technology (AMT) power control operations (Power On, ... |
combined_dataset/train/non-malicious/sample_17_79.ps1 | sample_17_79.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module $PSScriptRoot\Tracer.psm1
<#
... |
combined_dataset/train/non-malicious/Findup_24.ps1 | Findup_24.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_9_98.ps1 | sample_9_98.ps1 | ConvertFrom-StringData @'
id_hpz12servicecheck=Checking the presence of HPZ12
id_hpz12servicecheckdesc=Checking if Net Driver HPZ12 or Pml Driver HPZ12 services are installed
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE... |
combined_dataset/train/non-malicious/Create SP2010 Farm V_4.ps1 | Create SP2010 Farm V_4.ps1 | ############################################################################
## Create-SPFarm
## V 0.3
## Jos.Verlinde
############################################################################
Param ( [String] $Farm = "SP2010",
[String] $SQLServer = $env:COMPUTERNAME,
[String] $Passphrase = "pass@word1"... |
combined_dataset/train/non-malicious/3760.ps1 | 3760.ps1 |
$SESSION_RG = "flowrg"
$SESSION_IA = "PS-Tests-Sessions"
$AGREEMENT_X12_Name = "PS-X12-Agreement"
$AGREEMENT_Edifact_Name = "PS-Edifact-Agreement"
function Test-GetReceivedIcn()
{
$resultNoType = Get-AzIntegrationAccountReceivedIcn -ResourceGroupName $SESSION_RG -Name $SESSION_IA -AgreementNam... |
combined_dataset/train/non-malicious/sample_50_81.ps1 | sample_50_81.ps1 | #
# Module manifest for module 'OCI.PSModules.Osuborganizationsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll'
# Version number of this module.
ModuleVersion... |
combined_dataset/train/non-malicious/sample_60_61.ps1 | sample_60_61.ps1 | #
# Module manifest for module 'OCI.PSModules.Dns'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dns.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/2628.ps1 | 2628.ps1 | Import-module SQLPS -DisableNameChecking -Force
$backupfile = 'C:\TEMP\OPA2.0\OPA2.0\OPA2.0Analysis\SQL\OPAmanager.bak'
$restoreserver = 'localhost'
$restoredatabase = 'OPA'
$restorefiles = @()
$files = Invoke-Sqlcmd -ServerInstance $restoreserver -Database tempdb -Query "RESTORE FILELISTONLY FROM DISK='$backupfile'"
... |
combined_dataset/train/non-malicious/WSUS Admin Module.ps1 | WSUS Admin Module.ps1 | Write-Host "`n"
Write-Host "`t`tWSUS Administrator Module 1.0"
Write-Host "`n"
Write-Host -nonewline "Make initial connection to WSUS Server:`t"
Write-Host -fore Yellow "Connect-WSUSServer"
Write-Host -nonewline "Disconnect from WSUS Server:`t`t"
Write-Host -fore Yellow "Disconnect-WSUSServer"
Write-Host -nonewl... |
combined_dataset/train/non-malicious/Empty working set.ps1 | Empty working set.ps1 | # use it as follows:
# PS C:\\> ps explorer | trim
add-type -Namespace Win32 -Name Psapi -MemberDefinition @"
[DllImport("psapi", SetLastError=true)]
public static extern bool EmptyWorkingSet(IntPtr hProcess);
"@
filter Reset-WorkingSet {
[Win32.Psapi]::EmptyWorkingSet($_.Handle)
}
sal trim Res... |
combined_dataset/train/non-malicious/sample_36_79.ps1 | sample_36_79.ps1 | #!powershell
# -*- coding: utf-8 -*-
# (c) 2022, John McCall (@lowlydba)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#AnsibleRequires -CSharpUtil Ansible.Basic
#AnsibleRequires -PowerShell ansible_collections.lowlydba.sqlserver.plugins.module_utils._SqlServerUtils
#Req... |
combined_dataset/train/non-malicious/3530.ps1 | 3530.ps1 |
function Get-RandomContainerGroupName
{
return getAssetName
}
function Get-RandomResourceGroupName
{
return getAssetName
}
function Get-ProviderLocation($provider)
{
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Play... |
combined_dataset/train/non-malicious/2924.ps1 | 2924.ps1 | task default -depends FrameworkFunction
task FrameworkFunction {
if ( $IsMacOS -OR $IsLinux ) {}
else {
AssertFramework -Framework '2.0' -AcceptableRegEx '2\.0'
AssertFramework -Framework '3.5' -AcceptableRegEx '3\.5'
AssertFramework -Framework '4.0' -AcceptableRegEx '4\.[0-9]\.'
}
}
function Asser... |
combined_dataset/train/non-malicious/sample_35_37.ps1 | sample_35_37.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
PowerShell Diagnostics Module
This module contains a set of wrapper scripts that
enable a user to use ETW tracing in Windows
PowerShell.
#>
$script:Logman="$env:windir\system32\logman.exe"
$script:wsmanlogfile = "$env:wind... |
combined_dataset/train/non-malicious/sample_51_36.ps1 | sample_51_36.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=找不到必要的 PowerShell 模組 (FailoverClusters)。請使用角色與功能工具來安裝: 遠端伺服器管理工具 | 功能管理工具 | 容錯移轉叢集工具 | Windows PowerShell 的容錯移轉叢集模組。
HyperVModuleRequired=找不到必要的 PowerShell 模組 (Hyper-V)。請使用角色與功能工具來安裝: 遠端伺服器管理工具 | 角色管理工具 | Hyper-V 管理工具 | Windows PowerShell 的 Hyper-V 模組。
CimCmdl... |
combined_dataset/train/non-malicious/Coloring text in RichTex.ps1 | Coloring text in RichTex.ps1 | #code showing in RichTextBox
$code = @'
using System;
using System.Linq;
using System.Reflection;
using System.Diagnostics;
[assembly: AssemblyVersion("3.5.0.0")]
namespace ProcessesSortedWithStartTime {
internal sealed class Program {
static DateTime Started(Process p) {
try {
return... |
combined_dataset/train/non-malicious/2c605667-d02a-4251-bacb-0dae618c9f87.ps1 | 2c605667-d02a-4251-bacb-0dae618c9f87.ps1 | function Update-Scopes($siteUrl)
{
[void][reflection.assembly]::Loadwithpartialname("Microsoft.SharePoint") | out-null
[void][reflection.assembly]::Loadwithpartialname("Microsoft.office.server.search") | out-null
$s = [microsoft.sharepoint.spsite]$siteUrl
$sc = [microsoft.office.server.servercontext]::GetCo... |
combined_dataset/train/non-malicious/sample_36_30.ps1 | sample_36_30.ps1 | let resizeObserver;
let observerAddRemove;
export function FluentOverflowInitialize(dotNetHelper, id, isHorizontal, querySelector) {
var localSelector = querySelector;
if (!localSelector) {
// cannot use :scope for node.matches() further down
localSelector = ".fluent-overflow-item";
... |
combined_dataset/train/non-malicious/3643.ps1 | 3643.ps1 |
function Test-CreateJobStep
{
$a1 = Create-ElasticJobAgentTestEnvironment
try
{
Test-CreateJobStepWithDefaultParam $a1
Test-CreateJobStepWithParentObject $a1
Test-CreateJobStepWithParentResourceId $a1
Test-CreateJobStepWithPiping $a1
}
finally
{
Remove-ResourceGroupForTest $a1
}
}
... |
combined_dataset/train/non-malicious/804.ps1 | 804.ps1 | $Global:GlobalVar = 0
$UnqualifiedScriptVar = 1
$Script:ScriptVar2 = 2
"`$Script:ScriptVar2 is $Script:ScriptVar2"
function AFunction {}
filter AFilter {$_}
function AnAdvancedFunction {
begin {
$LocalVar = 'LocalVar'
function ANestedFunction() {
$nestedVar = 42
"`$nested... |
combined_dataset/train/non-malicious/sample_19_38.ps1 | sample_19_38.ps1 | #***************************************************
# modified version of tss_ChkSym.ps1 for usage in TSS
# Version 1.0.1cmd.exe /c
# Date: 7/15/2019
# Author: +waltere 2019.07.15, sabieler 2024.01.29 (TSS version)
# Description: This file will use Checksym.exe to list all file versions on the local machine
#**... |
combined_dataset/train/non-malicious/sample_22_15.ps1 | sample_22_15.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/3386.ps1 | 3386.ps1 |
$excludedExtensions = @(".dll", ".zip", ".msi", ".exe")
function Get-Transcript
{
param([string] $path)
return Get-Content $path |
Select-String -InputObject {$_} -Pattern "^Start Time\s*:.*" -NotMatch |
Select-String -InputObject {$_} -Pattern "^End Time\s*:.*" -NotMatch |
Select-St... |
combined_dataset/train/non-malicious/sample_30_15.ps1 | sample_30_15.ps1 | @{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
'PSUseConsistentWhitespace',
'PSUseConsistentIndentation',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'
)
Rules = @{
PSPlaceOpenBrace = @{
Enable ... |
combined_dataset/train/non-malicious/sample_0_37.ps1 | sample_0_37.ps1 | # TS_AnonymousAuthentication_Enabled.ps1
# Description: Determine whether anonymous authentication is enabled on the CRM web site.
# Created: 1/10/2012
# Author: Jonathan Randall
#*************************************************************************************************
# Date: 11-12-2012
# Description:... |
combined_dataset/train/non-malicious/sample_14_21.ps1 | sample_14_21.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/format-custom_1.ps1 | format-custom_1.ps1 | ## UI Automation v 1.8 -- REQUIRES the Reflection module (current version: http://poshcode.org/3174 )
##
# WASP 2.0 is getting closer, but this is still just a preview:
# -- a lot of the commands have weird names still because they're being generated ignorantly
# -- eg: Invoke-Toggle.Toggle and Invoke-Invoke.Invo... |
combined_dataset/train/non-malicious/3095.ps1 | 3095.ps1 | function Verify-Type {
param (
[Parameter(ValueFromPipeline = $true)]
$Actual,
[Parameter(Mandatory = $true, Position = 0)]
[Type]$Expected
)
if ($Actual -isnot $Expected) {
$message = "Expected value to be of type $($Expected.FullName)"
$Actual = "but got " ... |
combined_dataset/train/non-malicious/Get-ChildItemRecurse_2.ps1 | Get-ChildItemRecurse_2.ps1 | function Get-ChildItemRecurse {
<#
.Synopsis
Does a recursive search through a PSDrive up to n levels.
.Description
Does a recursive directory search, allowing the user to specify the number of
levels to search.
.Parameter path
The starting path.
.Parameter fileglob
(optional) the search string for ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.