full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_63_96.ps1 | sample_63_96.ps1 | #
# Module manifest for module 'OCI.PSModules.Analytics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Analytics.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/2103.ps1 | 2103.ps1 |
Describe "Native Command Arguments" -tags "CI" {
It "Should handle quoted spaces correctly" {
$a = 'a"b c"d'
$lines = testexe -echoargs $a 'a"b c"d' a"b c"d
$lines.Count | Should -Be 3
$lines[0] | Should -BeExactly 'Arg 0 is <ab cd>'
$lines[1] ... |
combined_dataset/train/non-malicious/1465.ps1 | 1465.ps1 |
filter Get-Function
{
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
$Path
)
Write-Verbose "Loading script '$Path'."
$scriptContent = Get-Content "$Path"
if( -not $scriptContent )
{
return @()
}
$errors = [Management.Automation.PS... |
combined_dataset/train/non-malicious/Add-Namespace_1.ps1 | Add-Namespace_1.ps1 | trap [System.Management.Automation.RuntimeException]
{
$entryException = $_
if ($_.CategoryInfo.Category -eq [System.Management.Automation.ErrorCategory]::InvalidOperation)
{
if ($_.FullyQualifiedErrorId -eq "TypeNotFound")
{
$targetName = $_.CategoryInfo.TargetName
... |
combined_dataset/train/non-malicious/522.ps1 | 522.ps1 | function Connect-SPOContext{
param(
[string]$Url
)
[Reflection.Assembly]::LoadFile((Get-ChildItem -Path $PSlib.Path -Filter "ClaimsAuth.dll" -Recurse).Fullname)
$Global:SPOContext = New-Object SPOContext((Get-SPUrl $Url).Url)
$Global:SPOContext
}
function Get-SPOWeb{
$SPOWe... |
combined_dataset/train/non-malicious/sample_3_55.ps1 | sample_3_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Stackmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Stackmonitoring.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_64_48.ps1 | sample_64_48.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
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# ... |
combined_dataset/train/non-malicious/Enable-BreakOnError.ps1 | Enable-BreakOnError.ps1 | #############################################################################\n##\n## Enable-BreakOnError\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nCreat... |
combined_dataset/train/non-malicious/sample_23_29.ps1 | sample_23_29.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/2703.ps1 | 2703.ps1 | function Get-HostsFile {
Param (
[ValidateScript({Test-Path $_})]
[String]
$Path = (Join-Path $Env:SystemRoot 'System32\drivers\etc\hosts'),
[Switch]
$Show
)
$Hosts = Get-Content $Path -ErrorAction Stop
$CommentLine = '^\s*
$HostLine = '^\s*(?<IPAddress>\... |
combined_dataset/train/non-malicious/sample_15_60.ps1 | sample_15_60.ps1 | @{
GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Start-Transcript", "Stop-Transcript"
AliasesTo... |
combined_dataset/train/non-malicious/Deleted-ObjectsAD.ps1 | Deleted-ObjectsAD.ps1 | param(
$Domen
)
function Ping ($Name){
$ping = new-object System.Net.NetworkInformation.Ping
if ($ping.send($Name).Status -eq "Success") {$True}
else {$False}
trap {Write-Verbose "Error Ping"; $False; continue}
}
[string[]]$ObjectPath
[string[]]$Disks
[string[]]$Info
[string[]]$Computers
... |
combined_dataset/train/non-malicious/Get-Netstat 1,2.ps1 | Get-Netstat 1,2.ps1 | $null, $null, $null, $null, $netstat = netstat -a -n -o
$ps = Get-Process
[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,... |
combined_dataset/train/non-malicious/sample_25_89.ps1 | sample_25_89.ps1 | #
# Module manifest for module 'Microsoft.SME.GPU'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.GPU.psm1'
# Version number of this module.
ModuleVersion = '2.24.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to uniquely ident... |
combined_dataset/train/non-malicious/3853.ps1 | 3853.ps1 |
function Test-StorageBlobContainer
{
$rgname = Get-StorageManagementTestResourceName;
try
{
$stoname = 'sto' + $rgname;
$stotype = 'Standard_GRS';
$loc = Get-ProviderLocation ResourceManagement;
$kind = 'StorageV2'
$containerName = "container"+... |
combined_dataset/train/non-malicious/Findup_1.ps1 | Findup_1.ps1 | using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.IO;
namespace Findup
{
public class FileInfoExt
{
public FileInfo... |
combined_dataset/train/non-malicious/sample_66_53.ps1 | sample_66_53.ps1 | #
# Module manifest for module 'OCI.PSModules.Onesubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported P... |
combined_dataset/train/non-malicious/chkhash_25.ps1 | chkhash_25.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... |
combined_dataset/train/non-malicious/875.ps1 | 875.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests', ''
. "$here\$sut"
$clusterName = $ENV:ClusterName
$httpUserPassword = $ENV:HttpPassword
$securePassword = ConvertTo-SecureString $httpUserPassword -AsPlainText -Force
$creds = New-Object -... |
combined_dataset/train/non-malicious/ISE-CopyOutPutToEditor.ps1 | ISE-CopyOutPutToEditor.ps1 | function ISE-CopyOutPutToEditor () {
$count = $psise.CurrentOpenedRunspace.OpenedFiles.count
$psIse.CurrentOpenedRunspace.OpenedFiles.Add()
$Newfile = $psIse.CurrentOpenedRunspace.OpenedFiles[$count]
$Newfile.Editor.Text = $psIse.CurrentOpenedRunspace.output.Text
$Newfile.Editor.Focus()
# ... |
combined_dataset/train/non-malicious/3504.ps1 | 3504.ps1 |
function Test-GetApplicationInsights
{
$rgname = Get-ApplicationInsightsTestResourceName;
try
{
$appName = "app" + $rgname;
$loc = Get-ProviderLocation ResourceManagement;
$kind = "web";
New-AzResourceGroup -Name $rgname -Location $loc;
$app = New-A... |
combined_dataset/train/non-malicious/sample_31_47.ps1 | sample_31_47.ps1 | #
# Module manifest for module 'OCI.PSModules.Datalabelingservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datalabelingservice.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Sup... |
combined_dataset/train/non-malicious/sample_36_90.ps1 | sample_36_90.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudbridge'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudbridge.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_31_33.ps1 | sample_31_33.ps1 | #
# Module manifest for module 'OCI.PSModules.Monitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Monitoring.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/4257.ps1 | 4257.ps1 |
function New-IPv4Range
{
param(
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
Position=0)]
$StartIP,
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
Position=2)]
... |
combined_dataset/train/non-malicious/1838.ps1 | 1838.ps1 |
Describe "Test-Push-Location" -Tags "CI" {
New-Variable -Name startDirectory -Value $(Get-Location).Path -Scope Global -Force
BeforeEach { Set-Location $startDirectory }
It "Should be called without error" {
{ Push-Location } | Should -Not -Throw
}
It "Should be able to push to the root direct... |
combined_dataset/train/non-malicious/Invoke-SqlCmd_8.ps1 | Invoke-SqlCmd_8.ps1 | #######################
<#
.SYNOPSIS
Runs a T-SQL script.
.DESCRIPTION
Runs a T-SQL script. Invoke-Sqlcmd2 only returns message output, such as the output of PRINT statements when -verbose parameter is specified.
Paramaterized queries are supported.
.INPUTS
None
You cannot pipe objects to Invoke-Sq... |
combined_dataset/train/non-malicious/sample_5_71.ps1 | sample_5_71.ps1 | #************************************************
# TS_DCOMEnabledk.ps1
# Version 1.0.0
# Date: 03-23-2012
# Author: Jeremy LaBorde - jlaborde
# Description: Checks to see if DCOM is enabled
#************************************************
. .\DistSvcs_Utils.ps1
Import-LocalizedData -BindingVariable Scrip... |
combined_dataset/train/non-malicious/sample_59_95.ps1 | sample_59_95.ps1 | #
# Module manifest for module 'OCI.PSModules.Apigateway'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apigateway.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/3219.ps1 | 3219.ps1 |
InModuleScope PoshBot {
describe 'Remove-PoshBotStatefulData' {
BeforeAll {
$PSDefaultParameterValues = @{
'Remove-PoshBotStatefulData:Verbose' = $false
}
$global:PoshBotContext = [pscustomobject]@{
Plugin = '... |
combined_dataset/train/non-malicious/sample_54_72.ps1 | sample_54_72.ps1 | # diag_api.psm1
# by tdimli
# March 2020
# API/helper functions
# errors reported by these diagnostics won't be shown on screen to user
# only saved to xray_ISSUES-FOUND_*.txt report file
$Global:BETA_DIAGS = "
net_802dot1x_KB4556307,
net_firewall_KB4561854,
net_wlan_KB4557342,
net_dnscli_KB4562541,
net_da... |
combined_dataset/train/non-malicious/sample_60_41.ps1 | sample_60_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Datalabelingservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datalabelingservice.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Sup... |
combined_dataset/train/non-malicious/sample_8_48.ps1 | sample_8_48.ps1 | #************************************************
# TS_PrintHpzui4wmCheck.ps1
# Version 1.0.1
# Date: 2/29/12
# Author: jasonf
# Description: KB947477 Detect the OEM HP driver hpzui4wm.DLL. This driver is known to cause the print spooler to crash or hang.
#************************************************
#str... |
combined_dataset/train/non-malicious/sample_16_76.ps1 | sample_16_76.ps1 | @{
GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Get-Credential", "Get-ExecutionPolicy", "Set-E... |
combined_dataset/train/non-malicious/sample_13_32.ps1 | sample_13_32.ps1 | ConvertFrom-StringData @'
id_netframeworkngenfiles_title=.Net Framework nGen files
id_netframeworkngenfiles_status=Collecting .Net Framework nGen files
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE... |
combined_dataset/train/non-malicious/996.ps1 | 996.ps1 | class CsvProcessor
{
[psobject]$Logger
[psobject]$ProcessItemFunction
CsvProcessor($logger, $processItemFunction)
{
$this.Logger = $logger
$this.ProcessItemFunction = $processItemFunction
}
[psobject] LoadCsv($CsvFilePath)
{
$resolvedCsvPath = Resolve-Path -LiteralP... |
combined_dataset/train/non-malicious/sample_9_31.ps1 | sample_9_31.ps1 | #************************************************
# DC_AppxCollect.ps1
# Version 1.1
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects AppX additional information.
# Called from: TS_AutoAddCommands_Apps.ps1
#*******************************************************
Trap [Ex... |
combined_dataset/train/non-malicious/2151.ps1 | 2151.ps1 |
using namespace System.Threading
using namespace System.Timers
using namespace System.Diagnostics
using namespace System.Diagnostics; using namespace System.Runtime.CompilerServices
using namespace System.Collections.Generic
[Flags()]
enum E1
{
E1 = 0x01
E2 = 0x02
E4 = 0x04
}
[CompilerGenerated... |
combined_dataset/train/non-malicious/sample_4_93.ps1 | sample_4_93.ps1 | # *********************************************************************************************************************
# Version 1.0
# Date: 02-29-2012
# Author: Vinay Pamnani - vinpa@microsoft.com
# Description:
# Collects SQL Error Logs from the SQL Server hosting the ConfigMgr database. It creates a UNC Pat... |
combined_dataset/train/non-malicious/3982.ps1 | 3982.ps1 |
function Test-AzureRmKubernetes
{
$resourceGroupName = Get-RandomResourceGroupName
$kubeClusterName = Get-RandomClusterName
$location = Get-ProviderLocation "Microsoft.ContainerService/managedClusters"
try
{
New-AzResourceGroup -Name $resourceGroupName -Location $location
if (isLiv... |
combined_dataset/train/non-malicious/sample_63_89.ps1 | sample_63_89.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_41_40.ps1 | sample_41_40.ps1 |
//
// show all meshes in the scene by setting Hidden=false
//
var c = document.elements.elementCount;
for (var i = 0; i < c; i++) {
var element = document.elements.getElement(i);
if (element.typeId == "Microsoft.VisualStudio.3D.Mesh") {
element.getTrait("Hidden").value = false;
}
}
/... |
combined_dataset/train/non-malicious/3602.ps1 | 3602.ps1 |
function Get-AzureRmJitNetworkAccessPolicy-SubscriptionScope
{
Set-AzureRmJitNetworkAccessPolicy-ResourceGroupLevelResource
$jitNetworkAccessPolicies = Get-AzJitNetworkAccessPolicy
Validate-JitNetworkAccessPolicies $jitNetworkAccessPolicies
}
function Get-AzureRmJitNetworkAccessPolicy-ResourceGr... |
combined_dataset/train/non-malicious/sample_22_85.ps1 | sample_22_85.ps1 | //
// Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
/... |
combined_dataset/train/non-malicious/3526.ps1 | 3526.ps1 |
function Remediation-SubscriptionScope-Crud
{
$assignmentId = Get-TestRemediationSubscriptionPolicyAssignmentId
$remediationName = "PSTestRemediation"
$remediation = Start-AzPolicyRemediation -PolicyAssignmentId $assignmentId -Name $remediationName -LocationFilter "westus2","west central us... |
combined_dataset/train/non-malicious/919.ps1 | 919.ps1 |
$resourceGroup = "myResourceGroup"
$location = "westeurope"
$vmName = "myVM"
$securePassword = ConvertTo-SecureString ' ' -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ("azureuser", $securePassword)
New-AzResourceGroup -Name $resourceGroup -Location $location
$subnetConfig = Ne... |
combined_dataset/train/non-malicious/SVMotion-VM.ps1 | SVMotion-VM.ps1 | # author: Hal Rottenberg
# Website/OpenID: http://halr9000.com
# purpose: does "real" SVMotion of a VM
# usage: get-vm | SVMotion-VM -destination (get-datastore foo)
function SVMotion-VM {
param(
[VMware.VimAutomation.Client20.DatastoreImpl]
$destination
)
Begin {
$datastoreView = get-view $destina... |
combined_dataset/train/non-malicious/Get-ADGroupModifications_1.ps1 | Get-ADGroupModifications_1.ps1 | ###########################################################################"
#
# NAME: Get-ADGroupModificationsReport.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jan.egil.ring@powershell.no
#
# COMMENT: Generates a HTML-report of Active Directory group membership modifications (addings and deletions).
# Sp... |
combined_dataset/train/non-malicious/2503.ps1 | 2503.ps1 | function Send-Recycle{
param([string]$Server,
[string]$Apppool,
$Pools,
[string]$Message,
$PoolHash )
$email = ""
if (($Apppool -eq $null) -or ($Apppool -eq "")){
$Server
foreach ($Pool in $Pools){
... |
combined_dataset/train/non-malicious/sample_10_84.ps1 | sample_10_84.ps1 | #************************************************
# TS_NetworkDTCEnabled.ps1
# Version 1.0.0
# Date: 03-23-2012
# Author: Jeremy LaBorde - jlaborde
# Description: Checks to see if Network DTC
# is enabled
#
#************************************************
. .\DistSvcs_Utils.ps1
Import-LocalizedData -B... |
combined_dataset/train/non-malicious/Invoke-LocalizedScript.p.ps1 | Invoke-LocalizedScript.p.ps1 | Set-StrictMode -Version Latest\n\n## Create some default messages for English cultures, and\n## when culture-specific messages are not available.\n$messages = DATA {\n @{\n Greeting = "Hello, {0}"\n Goodbye = "So long."\n }\n}\n\n## Import localized messages for the current culture.\nImport-Localize... |
combined_dataset/train/non-malicious/2664.ps1 | 2664.ps1 |
[CmdletBinding()]
Param (
[switch]$ShowInstallationPrompt = $false,
[switch]$ShowInstallationRestartPrompt = $false,
[switch]$CleanupBlockedApps = $false,
[switch]$ShowBlockedAppDialog = $false,
[switch]$DisableLogging = $false,
[string]$ReferredInstallName = '',
[string]$ReferredInstallTitle = '',
[string]$... |
combined_dataset/train/non-malicious/sample_58_35.ps1 | sample_58_35.ps1 | Describe "Test-EngineLibrary" {
It "Calls Get-Date" {
{Get-Date} | Should Not Throw
}
}
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFl... |
combined_dataset/train/non-malicious/1683.ps1 | 1683.ps1 |
$ShellApp = new-Object -ComObject shell.application
Add-Type -AssemblyName PresentationFramework
[xml]$xaml = @"
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="AlliedVOA | Mini Desktop Tool - Folder ... |
combined_dataset/train/non-malicious/Convert-BounceToX_3.ps1 | Convert-BounceToX_3.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/1941.ps1 | 1941.ps1 |
Describe 'ConvertTo-Json' -tags "CI" {
BeforeAll {
$newline = [System.Environment]::NewLine
}
It 'Newtonsoft.Json.Linq.Jproperty should be converted to Json properly' {
$EgJObject = New-Object -TypeName Newtonsoft.Json.Linq.JObject
$EgJObject.Add("TestValue1", "123456")
$E... |
combined_dataset/train/non-malicious/sample_0_63.ps1 | sample_0_63.ps1 | ConvertFrom-StringData @'
id_symantecipscheck=Symantec Intrusion Prevention System (IPS)
id_symantecipscheckdesc=Checking if Symantec Intrusion Prevention System (IPS) is installed
'@
# SIG # Begin signature block
# MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEA... |
combined_dataset/train/non-malicious/9efa67c2-1147-4c7c-92f8-98b63b15cebd.ps1 | 9efa67c2-1147-4c7c-92f8-98b63b15cebd.ps1 | Function Get-VMHostNetworks
{
<#
.SYNOPSIS
Return a list of networks from a given host
.DESCRIPTION
After connecting to your VI server, we get a list of virtual switches on the datacenter and from
that we pull out the VHostID that matches the server we pass... |
combined_dataset/train/non-malicious/764.ps1 | 764.ps1 |
function Stop-Process2 {
[CmdletBinding(SupportsShouldProcess = $true)]
[Alias()]
[OutputType([int])]
param(
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
Position=0)]
$Name
)
process {
if ($PSCmdlet.ShouldProcess("")) {
$processes = Get-Process -Name $Name
fore... |
combined_dataset/train/non-malicious/sample_54_63.ps1 | sample_54_63.ps1 | #
# Module manifest for module 'Az.Support'
#
# Generated by: Microsoft Corporation
#
# Generated on: 5/16/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.Support.psm1'
# Version number of this module.
ModuleVersion = '2.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_66_58.ps1 | sample_66_58.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param (
[Parameter(Manda... |
combined_dataset/train/non-malicious/sample_5_98.ps1 | sample_5_98.ps1 | ConvertFrom-StringData @'
id_hypervregcheck=Checking SCSI Subkeys for Hyper-V
id_hypervregcheckdesc=Checking for Hyper-V SCSI Registry Subkeys
'@
# SIG # Begin signature block
# MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
#... |
combined_dataset/train/non-malicious/480.ps1 | 480.ps1 |
function Export-PSCredential{
param(
[Parameter(Mandatory=$true)]
$Credential = (Get-Credential),
[Parameter(Mandatory=$false)]
[String]
$Path
)
switch ($Credential.GetType().Name) {
PSCredential{
continue
}
String{
$Credential = Get-Credential -credential $Cr... |
combined_dataset/train/non-malicious/sample_36_24.ps1 | sample_36_24.ps1 | #
# Module manifest for module 'Az.DevCenter'
#
# Generated by: Microsoft Corporation
#
# Generated on: 23/04/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.DevCenter.psm1'
# Version number of this module.
ModuleVersion = '1.1.1'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_67_7.ps1 | sample_67_7.ps1 | param(
[Parameter(Mandatory = $true)] [string] $logPath,
[Parameter(Mandatory = $true)] [string] $tmpPath,
[Parameter(Mandatory = $true)] [boolean] $isUpdate
)
function timestamp() {
Get-Date -Format "yyyy-MM-dd HH:mm:ss"
}
try {
# set error action
$ErrorActionPreference = "SilentlyContinue"... |
combined_dataset/train/non-malicious/4062.ps1 | 4062.ps1 |
[CmdletBinding()]
param ()
function Uninstall-MSIByName {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][String]$ApplicationName,
[ValidateNotNullOrEmpty()][String]$Switches
)
$Executable = $Env:windir + "\system32\msiexec.exe"
$Uninstall = Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\Curr... |
combined_dataset/train/non-malicious/Xml Module 4.6.ps1 | Xml Module 4.6.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_8_97.ps1 | sample_8_97.ps1 | #************************************************
# utils_Exchange_all_exchange_versions_withoutpowershellaccess.ps1
# Version 2.0.1
# Date: 04-12-2013
# Author: Brian Prince - brianpr@microsoft.com
# Description: Utility functions for use by Exchange SDP 3.0+ manifests
#****************************************... |
combined_dataset/train/non-malicious/4391.ps1 | 4391.ps1 | function Save-PSGetSettings
{
if($script:PSGetSettings)
{
if(-not (Microsoft.PowerShell.Management\Test-Path -Path $script:PSGetAppLocalPath))
{
$null = Microsoft.PowerShell.Management\New-Item -Path $script:PSGetAppLocalPath `
... |
combined_dataset/train/non-malicious/sample_24_60.ps1 | sample_24_60.ps1 | #
# Script module for module 'PackageManagement'
#
Set-StrictMode -Version Latest
Microsoft.PowerShell.Utility\Import-LocalizedData LocalizedData -filename PackageManagement.Resources.psd1
# Summary: PackageManagement is supported on Windows PowerShell 3.0 or later, Nano Server and PowerShellCore
$isCore = ($P... |
combined_dataset/train/non-malicious/2443.ps1 | 2443.ps1 | function Checkpoint-OnlineVM
{
[CmdletBinding(SupportsShouldProcess,ConfirmImpact = 'High')]
param
(
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[Microsoft.HyperV.PowerShell.VirtualMachine[]]$VM
)
process
{
foreach ($v in $VM)
{
if ($PSCmdlet.ShouldProcess($v.Name,'VM shu... |
combined_dataset/train/non-malicious/sample_0_3.ps1 | sample_0_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Queue'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Queue.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/Test-IPMask_1.ps1 | Test-IPMask_1.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_13_54.ps1 | sample_13_54.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/2228.ps1 | 2228.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed.")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMess... |
combined_dataset/train/non-malicious/2011.ps1 | 2011.ps1 |
. "$psscriptroot/TestRunner.ps1"
$assemblyName = "Microsoft.PowerShell.Security"
$excludeList = @("SecurityMshSnapinResources.resx")
import-module Microsoft.PowerShell.Security
Test-ResourceStrings -AssemblyName $AssemblyName -ExcludeList $excludeList
|
combined_dataset/train/non-malicious/sample_62_29.ps1 | sample_62_29.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_13_67.ps1 | sample_13_67.ps1 | # @(#) MQMBID sn=p934-001-231123 su=__1xN5on7Ee6laNoNozjQLg pn=cmd/install/pc/winnt/web/UnpackFeature.ps1
########################################################################
# #
# Program name: UnpackFeature.ps1 ... |
combined_dataset/train/non-malicious/524.ps1 | 524.ps1 |
function Get-SPObjectPermissions{
param(
[Parameter(Mandatory=$false)]
[string]$Identity,
[switch]$IncludeChildItems,
[switch]$Recursive,
[switch]$OnlyLists,
[switch]$OnlyWebsites,
[switch]$ByUsers
)
if(-not (Get-PSSnapin "Mic... |
combined_dataset/train/non-malicious/4266.ps1 | 4266.ps1 | Function Invoke-InveighRelay
{
param
(
[parameter(Mandatory=$false)][ValidateSet("Y","N")][string]$HTTP="Y",
[parameter(Mandatory=$false)][ValidateSet("Y","N")][string]$HTTPS="N",
[parameter(Mandatory=$false)][ValidateSet("Y","N")][string]$ConsoleOutput="N",
[parameter(Mandatory=$false)][ValidateSet... |
combined_dataset/train/non-malicious/New-ObjectRecursive.ps1 | New-ObjectRecursive.ps1 | <#
.Synopsis
Creates new object based on hashtable definition
.Description
Function is wrapper for New-Object that allows user to create nested objects using nested hashtable as definition.
If you want to take advantage of type use 'Type' key within hashtable that defines object.
... |
combined_dataset/train/non-malicious/sample_50_18.ps1 | sample_50_18.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=Modul PowerShell yang diperlukan (FailoverClusters) tidak ditemukan. Gunakan Alat Peran & Fitur untuk menginstal: Alat Administrasi Server Jarak Jauh | | Alat Administrasi Fitur | Alat Pengklusteran Failover Modul Kluster Failover untuk Windows PowerShell.
'@
... |
combined_dataset/train/non-malicious/Get-Credential 2.4.ps1 | Get-Credential 2.4.ps1 | ## Get-Credential
## An improvement over the default cmdlet which has no options ...
###################################################################################################
## History
## v 2.4 Fix a bug in -Store when the UserName isn't passed in as a parameter
## v 2.3 Add -Store switch and support p... |
combined_dataset/train/non-malicious/1029.ps1 | 1029.ps1 | Login-AzAccount
Get-AzSubscription
Set-AzContext -SubscriptionId "yourSubscriptionID"
$RGname="sfclustertutorialgroup"
$port=8081
$rulename="allowAppPort$port"
$nsgname="sf-vnet-security"
$nsg = Get-AzNetworkSecurityGroup -Name $nsgname -ResourceGroupName $RGname
$nsg | Add-AzNetworkSecurityRuleConfig -Name $rulen... |
combined_dataset/train/non-malicious/2037.ps1 | 2037.ps1 |
Describe 'Validate Attributes Tests' -Tags 'CI' {
Context "ValidateCount" {
BeforeAll {
$testCases = @(
@{
ScriptBlock = { function foo { param([ValidateCount(-1,2)] [string[]] $bar) }; foo }
FullyQualifiedErrorId = "Excep... |
combined_dataset/train/non-malicious/sample_55_88.ps1 | sample_55_88.ps1 | function Invoke-ALTestRunner {
Param(
[Parameter(Mandatory=$false)]
[ValidateSet('All','Codeunit','Test')]
[string]$Tests = 'All',
[Parameter(Mandatory=$false)]
[string]$FileName = '',
[Parameter(Mandatory=$false)]
[int]$SelectionStart = 0,
[Parameter(... |
combined_dataset/train/non-malicious/Get-VMStorageAdapters.ps1 | Get-VMStorageAdapters.ps1 | <#
.SYNOPSIS
Reports on Fibre Channel Adapters in the ESX hosts for a vCenter environment.
.DESCRIPTION
This script iterates through each Datacenter,Cluster, and Host in a vCenter environment and then lists the Fibre Channel HBAs that are present.
.LINK
.EXAMPLE
PS> Get-VMStorageAdapters.ps1 -FileName hba.tx... |
combined_dataset/train/non-malicious/1130.ps1 | 1130.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldGetPerformanceCounters
{
$categories = [Diagnostics.PerformanceCounterCategory]::GetCategories()
foreach( $category in $categories )
{
$countersEx... |
combined_dataset/train/non-malicious/ProcessSnapshot.ps1 | ProcessSnapshot.ps1 | function Get-ProcessList {
#snapshot time
$now = Get-Date -f 'HH:mm:ss'
#building list
[int]$hndl = 0
$script:ret = @()
ps | % -b {$arr = @()} -p {
$str = "" | select Name, StartTime, PID, PM, WS, Desc, Publ
$str.Name = $_.ProcessName
$str.StartTime = $(try { $_.StartTime} catch { ret... |
combined_dataset/train/non-malicious/2383.ps1 | 2383.ps1 | function Install-SqlServerCumulativeUpdate
{
[CmdletBinding(SupportsShouldProcess)]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$ComputerName,
[Parameter(Mandatory, ParameterSetName = 'Number')]
[ValidateNotNullOrEmpty()]
[int]$Number,
[Parameter(Mandatory, ParameterSetName ... |
combined_dataset/train/non-malicious/sample_56_31.ps1 | sample_56_31.ps1 | @{
GUID="c61d6278-02a3-4618-ae37-a524d40a7f44 "
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
ModuleToProcess="PSDiagnostics.psm1"
Func... |
combined_dataset/train/non-malicious/Invoke-VMCommand.ps1 | Invoke-VMCommand.ps1 | # Invoke-VMCommand.ps1
# Purpose : Run a remote command and return the results
# Requirements: plink.exe from the Putty project must be in $env:path
# Use -help parameter for instructions
Param (
$VMHost,
$username,
$Command,
[switch]$Help,
[switch]$Verbose
)
# Obtains list of... |
combined_dataset/train/non-malicious/sample_49_69.ps1 | sample_49_69.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... |
combined_dataset/train/non-malicious/Windows Startup Script.ps1 | Windows Startup Script.ps1 | <#======================================================================================
File Name : Startup.ps1
Original Author : Kenneth C. Mazie
:
Description : This is a personal startup script with pop-up notification and
: checks to assure things are not already r... |
combined_dataset/train/non-malicious/sample_5_41.ps1 | sample_5_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Monitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Monitoring.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_26_99.ps1 | sample_26_99.ps1 | # WARNING: this need to be set by the getExtVersion
$env:TEST_EXTENSION_VERSION = "2.3.1"
# get the local path
$myPath = Split-Path -parent $MyInvocation.MyCommand.Path
$env:TEST_LOCAL_PATH="$myPath"
if (-not [Environment]::GetEnvironmentVariable('TEST_EXTENSIONS_PATH')) {
$env:TEST_EXTENSIONS_PATH = $(Join-Path ... |
combined_dataset/train/non-malicious/652.ps1 | 652.ps1 |
$reportPortalUri = if ($env:PesterPortalUrl -eq $null) { 'http://localhost/reports' } else { $env:PesterPortalUrl }
$reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl }
function VerifyCatalogItemExists()
{
param(
[Parameter(Mandatory = ... |
combined_dataset/train/non-malicious/sample_2_13.ps1 | sample_2_13.ps1 |
// Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved.
// ==================================================================
// DCIM_SwitchConnectionView
// ==================================================================
[dynamic, provider("dcismprovider"),
Description(
"The ... |
combined_dataset/train/non-malicious/Invoke-RemoteExpression_1..ps1 | Invoke-RemoteExpression_1..ps1 | ##############################################################################
##
## Invoke-RemoteExpression
##
## From Windows PowerShell Cookbook (O'Reilly)
## by Lee Holmes (http://www.leeholmes.com/guide)
##
##############################################################################
<#
.SYNOPSIS
... |
combined_dataset/train/non-malicious/1363.ps1 | 1363.ps1 |
function Test-CPowerShellIs64Bit
{
[CmdletBinding()]
param(
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
return ([Environment]::Is64BitProcess)
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.