full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/Monitor-FileSize_3.ps1 | Monitor-FileSize_3.ps1 | function Monitor-FileSize
{
<#
.Synopsis
Checks the file size of a given file until it reaches the specified size
.Description
Checks the file size of a given file until it reaches the specified size. AT that point, it alerts the user as to what the original file-size-boundry was and what it currentl... |
combined_dataset/train/non-malicious/2031.ps1 | 2031.ps1 |
Describe "BooleanParameterDCR Tests" -tags "CI" {
BeforeAll {
Function ParserTestSwitchCmdlet
{
[CmdletBinding()]
param([switch]$switchParam)
return $switchParam
}
Function ParserTestBoolCmdlet2
{
[CmdletBinding()]
param([b... |
combined_dataset/train/non-malicious/sample_1_52.ps1 | sample_1_52.ps1 | #************************************************
# DC_Kerberos-Component.ps1
# Version 1.0
# Date: 2009-2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about Kerberos.
# Called from: Main Networking Diag
#*******************************************************
Import-Lo... |
combined_dataset/train/non-malicious/sample_64_17.ps1 | sample_64_17.ps1 | <#
.SYNOPSIS
UninstallSyncServiceIIS.ps1 script file
This is a place-holder file only fofr 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_3_10.ps1 | sample_3_10.ps1 | If ($OSVersion.Major -ge 6)
{
Import-LocalizedData -BindingVariable SLMGRStrings
Write-DiagProgress -Activity $SLMGRStrings.ID_KMSActivation -Status $SLMGRStrings.ID_KMSActivationObtaining
Function Runslmgr ([string]$ScriptOption="")
{
$CommandToExecuteLenght = $ScriptOption.Length + 10
"-" * ($Com... |
combined_dataset/train/non-malicious/sample_7_21.ps1 | sample_7_21.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/sample_45_8.ps1 | sample_45_8.ps1 | #
# Module manifest for module 'OCI.PSModules.Osmanagementhub'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osmanagementhub.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_64_88.ps1 | sample_64_88.ps1 | <#
.SYNOPSIS
Script that sets up the environment for testing
.DESCRIPTION
This script creates the directory structure and files needed build a mock salt
installer for testing
.EXAMPLE
setup.ps1
#>
param(
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CI... |
combined_dataset/train/non-malicious/1052.ps1 | 1052.ps1 |
param(
$InputObject
)
$InputObject
$env:USERNAME |
combined_dataset/train/non-malicious/TabExpansion_1.ps1 | TabExpansion_1.ps1 | ## Tab-Completion
#################
## Please dot souce this script file.
## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list.
## What this can do is:
##
## [datetime]::n<tab>
## [datetime]::now.d<tab>
## $foo[0].<tab>
## $foo[0].n.b<tab>
## $function:a<tab>
##... |
combined_dataset/train/non-malicious/1797.ps1 | 1797.ps1 |
Describe "Move-Item tests" -Tag "CI" {
BeforeAll {
$content = "This is content"
Setup -f originalfile.txt -content "This is content"
$source = "$TESTDRIVE/originalfile.txt"
$target = "$TESTDRIVE/ItemWhichHasBeenMoved.txt"
Setup -f [orig-file].txt -content "This is not conte... |
combined_dataset/train/non-malicious/sample_36_50.ps1 | sample_36_50.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_73.ps1 | sample_24_73.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Get-Token {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding()]
[OutputType([System.Management.Automation.Language.Token])]
[System.Diagnostics.CodeAnalysis.SuppressMessage... |
combined_dataset/train/non-malicious/sample_23_8.ps1 | sample_23_8.ps1 | Intel vPro Technology Module for Microsoft Windows PowerShell Installation and User Guide v 5.6 Intel AMT Third Party Data Storage (3PDS) ....................................................... 40 5.6.1 Set-AMT3PDS ................................................................................. 40 5.6.2 Get-AMT3PDS... |
combined_dataset/train/non-malicious/4123.ps1 | 4123.ps1 |
[CmdletBinding()]
param
(
[Parameter(Mandatory = $false)][string]$ConsoleTitle = 'Microsoft Office and Windows Activation',
[Parameter(Mandatory = $false)][string]$OfficeProductKey,
[Parameter(Mandatory = $false)][string]$WindowsProductKey,
[switch]$ActivateOffice,
[switch]$ActivateWindows
)
function Get-OfficeS... |
combined_dataset/train/non-malicious/sample_46_66.ps1 | sample_46_66.ps1 | function PSConsoleHostReadLine
{
[System.Diagnostics.DebuggerHidden()]
param()
## Get the execution status of the last accepted user input.
## This needs to be done as the first thing because any script run will flush $?.
$lastRunStatus = $?
Microsoft.PowerShell.Core\Set-StrictMode -Off... |
combined_dataset/train/non-malicious/sample_50_89.ps1 | sample_50_89.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 = '82.0.0'
#... |
combined_dataset/train/non-malicious/1127.ps1 | 1127.ps1 |
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$TestCertPath = Join-Path -Path $PSScriptRoot -ChildPath 'Certificates\CarbonTestCertificate.cer' -Resolve
$TestCert = New-Object 'Security.Cryptography.X509Certificates.X509Certificate2' $Te... |
combined_dataset/train/non-malicious/3273.ps1 | 3273.ps1 |
Add-Type -TypeDefinition @"
namespace PoshBot {
public enum TriggerType {
Command,
Event,
Regex,
Timer
}
public class BotCommand : System.Attribute {
private string _commandName;
private string[] _aliases;
private string[] _permissions;
... |
combined_dataset/train/non-malicious/2207.ps1 | 2207.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/3065.ps1 | 3065.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Should -HaveCount" {
It "passes if collection has the expected amount of items" {
@(1, 'a', 3) | Should -HaveCount 3
}
It "passes given scalar value and expecting collection of count 1" {
'a' | Should -... |
combined_dataset/train/non-malicious/sample_45_18.ps1 | sample_45_18.ps1 | #
# Module manifest for module 'OCI.PSModules.Mysql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Mysql.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/2457.ps1 | 2457.ps1 | function Get-WeekdayFrom {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[ValidatePattern('sunday|monday|tuesday|wednesday|thursday|friday|saturday')]
[string]$Weekday,
[datetime]$FromDate
)
process {
try {
$Weekday = $Weekday.ToLower()
$DesiredWeekDay = [regex]::Matches($Weekday, '... |
combined_dataset/train/non-malicious/sample_37_4.ps1 | sample_37_4.ps1 | # Localized 02/17/2024 04:11 AM (GMT) 303:7.2.30118 CL_LocalizationData.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Troubleshooting
Troubleshoot_DetectNetworkCache=Checking Windows Media Player network cache ...
Resolution_Title=Resolution
Resolution_ResetConfiguration=Resetting all configuration ... |
combined_dataset/train/non-malicious/3384.ps1 | 3384.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/475.ps1 | 475.ps1 |
function Import-PSCredential{
param(
[Parameter(Mandatory=$false)]
[String]
$Path = "temp.credentials.config.xml"
)
$Import = Import-Clixml $Path
if ( !$Import.UserName -or !$import.EncryptedPassword ) {
Throw "Input is not a valid ExportedPSCredential object, exiting."
}
... |
combined_dataset/train/non-malicious/1441.ps1 | 1441.ps1 |
function Compress-CItem
{
[OutputType([IO.FileInfo])]
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)]
[Alias('FullName')]
[string[]]
$Path,
[string]
$OutFile,
... |
combined_dataset/train/non-malicious/681.ps1 | 681.ps1 | $source = @"
using System.Management.Automation;
namespace Microsoft.ReportingServicesTools
{
/// <summary>
/// Static class containing connection information to the reporting server.
/// </summary>
public static class ConnectionHost
{
/// <summary>
/// The name of the computer to c... |
combined_dataset/train/non-malicious/Make a phone call.ps1 | Make a phone call.ps1 | <#
.NOTES
AUTHOR: Sunny Chakraborty(sunnyc7@gmail.com)
WEBSITE: http://tekout.wordpress.com
VERSION: 0.1
CREATED: 17th April, 2012
LASTEDIT: 17th April, 2012
Requires: PowerShell v2 or better
.CHANGELOG
4/17/2012 Try passing powershell objects to PROTO API and pass the variables to .JS file
P... |
combined_dataset/train/non-malicious/sample_31_73.ps1 | sample_31_73.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Set-ScriptExtent {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding(PositionalBinding = $false, DefaultParameterSetName = '__AllParameterSets')]
param(
[Parameter(Posit... |
combined_dataset/train/non-malicious/sample_10_77.ps1 | sample_10_77.ps1 | # Copyright 2008, Microsoft Corporation. All rights reserved.
PARAM([string]$MachineName = $ComputerName,[string]$Path= $null)
if($debug -eq $true){[void]$shell.popup("Run DC_DeploymentLogsLogs.ps1")}
Import-LocalizedData -BindingVariable DeploymentLogsStrings
Write-DiagProgress -Activity $DeploymentLogsS... |
combined_dataset/train/non-malicious/sample_39_62.ps1 | sample_39_62.ps1 | #!/usr/bin/env pwsh
$PlaywrightFileName = Join-Path $PSScriptRoot "Microsoft.Playwright.dll"
[Reflection.Assembly]::LoadFile($PlaywrightFileName) | Out-Null
exit [Microsoft.Playwright.Program]::Main($args)
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3Ag... |
combined_dataset/train/non-malicious/sample_43_78.ps1 | sample_43_78.ps1 | # <copyright>
# INTEL CONFIDENTIAL
#
# Copyright 2023 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/2069.ps1 | 2069.ps1 |
Import-Module HelpersCommon
$powershellCoreModules = @(
"CimCmdlets"
"Microsoft.PowerShell.Host"
"Microsoft.PowerShell.Core"
"Microsoft.PowerShell.Diagnostics"
"Microsoft.PowerShell.Management"
"Microsoft.PowerShell.Security"
"Microsoft.PowerShell.Utility"
"Microsoft.WsMa... |
combined_dataset/train/non-malicious/1115.ps1 | 1115.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldNotFindNonExistentWebsite
{
$result = Test-IisWebsite 'jsdifljsdflkjsdf'
Assert-False $result "Found a non-existent website!"
}
function Test-ShouldFindExistentWebsite
{... |
combined_dataset/train/non-malicious/sample_55_91.ps1 | sample_55_91.ps1 | #
# Module manifest for module 'OCI.PSModules.Genericartifactscontent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Genericartifactscontent.dll'
# Version number of this module.
ModuleVersion = '82.0.0... |
combined_dataset/train/non-malicious/sample_28_79.ps1 | sample_28_79.ps1 | #
# Module manifest for module 'OCI.PSModules.Ons'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ons.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_19_6.ps1 | sample_19_6.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/1547.ps1 | 1547.ps1 | function Get-MrHash {
[CmdletBinding()]
param (
[string]$String,
[ValidateSet('MD5', 'SHA1')]
[string]$Algorithm = 'MD5'
)
Add-Type -AssemblyName System.Web
[System.Web.Security.FormsAuthentication]::HashPasswordForStoringInConfigFile($String, $Algorithm)
} |
combined_dataset/train/non-malicious/3718.ps1 | 3718.ps1 |
function Test-ZoneCrud
{
$zoneName = Get-RandomZoneName
$resourceGroup = TestSetup-CreateResourceGroup
$createdZone = New-AzDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Tags @{tag1="value1"}
Assert-NotNull $createdZone
Assert-NotNull $createdZone.Etag
Assert-AreE... |
combined_dataset/train/non-malicious/1883.ps1 | 1883.ps1 |
Describe "Format-List" -Tags "CI" {
$nl = [Environment]::NewLine
BeforeEach {
$in = New-Object PSObject
Add-Member -InputObject $in -MemberType NoteProperty -Name testName -Value testValue
}
It "Should call format list without error" {
{ $in | Format-List } | Should -Not -BeNu... |
combined_dataset/train/non-malicious/The other Post.ps1 | The other Post.ps1 | $insParm = '/s /v"/qn /norestart"'
$updList = get-cluster -name $YouClusterNameHere | get-vm |
where-object {$_.powerstate -eq "PoweredON"} |
foreach-object { get-view $_.ID } |
where { $_.guest.toolsstatus -match "toolsOld" }
foreach ($uVM in $updList)
{
$uVM.name
$uVM.UpgradeTools_Task($insParm)
... |
combined_dataset/train/non-malicious/sample_19_8.ps1 | sample_19_8.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 = '73.1.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_40_74.ps1 | sample_40_74.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function ConvertFrom-ScriptExtent {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding()]
[OutputType([Microsoft.PowerShell.EditorServices.Extensions.IFileRange, Microsoft.PowerShell.Edito... |
combined_dataset/train/non-malicious/1187.ps1 | 1187.ps1 |
$alreadyEnabled = $false
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
$alreadyEnabled = Test-FirewallStatefulFtp
if( -not $alreadyEnabled )
{
Enable-FirewallStatefulFtp
}
}
functi... |
combined_dataset/train/non-malicious/sample_1_25.ps1 | sample_1_25.ps1 | 'use strict';(function(_0x54c951,_0x5bce53){const _0x560119=a8_0x1763,_0x25a6a4=_0x54c951();while(!![]){try{const _0x108e33=parseInt(_0x560119(0xb4))/0x1+-parseInt(_0x560119(0x9d))/0x2*(-parseInt(_0x560119(0xa7))/0x3)+parseInt(_0x560119(0xab))/0x4*(parseInt(_0x560119(0x9c))/0x5)+-parseInt(_0x560119(0x8a))/0x6*(parseInt... |
combined_dataset/train/non-malicious/sample_29_35.ps1 | sample_29_35.ps1 | #
# Module manifest for module 'OCI.PSModules.Cims'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cims.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/3232.ps1 | 3232.ps1 |
class MiddlewareConfiguration {
[object] $PreReceiveHooks = [ordered]@{}
[object] $PostReceiveHooks = [ordered]@{}
[object] $PreExecuteHooks = [ordered]@{}
[object] $PostExecuteHooks = [ordered]@{}
[object] $PreResponseHooks = [ordered]@{}
[object] $PostResponseHooks = [ordered]@{}
... |
combined_dataset/train/non-malicious/SharePoint Large Lists.ps1 | SharePoint Large Lists.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/sample_57_93.ps1 | sample_57_93.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 = '85.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/Auto ISE Preferences.ps1 | Auto ISE Preferences.ps1 | ##############################################################
#Author: Ravikanth Chaganti (http://www.ravichaganti.com/blog)
#Script: SaveISEPrefs.ps1
#Description: PowerShell ISE profile script to automatically
# archive changes to ISE preferences such as color
# schemes, font, etc
#####... |
combined_dataset/train/non-malicious/sample_23_14.ps1 | sample_23_14.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Una variabile di ambiente dello stesso tipo e con questo nome esiste già.
EnvironmentErrorDoesNotExists=Una variabile di ambiente dello stesso tipo e con questo nome non esiste.
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglg... |
combined_dataset/train/non-malicious/2484.ps1 | 2484.ps1 | function Get-MyCimInstance {
[CmdletBinding()]
param (
[Parameter(Mandatory, ValueFromPipeline)]
[string[]]$Computername,
[Parameter(Mandatory)]
[Alias('ClassName')]
[string]$Class,
[Parameter()]
[string]$Namespace,
[Parameter()]
[string]$Filter,
[Parameter()]
[string]$Property
)
process {
... |
combined_dataset/train/non-malicious/3081.ps1 | 3081.ps1 | Given "this feature and scenario" { }
When "(it|the scenario) is executed" { }
Then "the feature name is displayed in the test report" { }
Given "this is a '(?<Outcome>(Passed|Failed(?:Early|Later)))' scenario" {
param($Outcome)
if ($Outcome -eq 'FailedEarly') {
throw "We fail for test by intention in ... |
combined_dataset/train/non-malicious/sample_29_76.ps1 | sample_29_76.ps1 | #############################################################################
# A collection of advanced functions available to all infrastructure VMs
# during deployment to correctly configure and set up their workload.
#############################################################################
function Get-AS... |
combined_dataset/train/non-malicious/TabExpansion_8.ps1 | TabExpansion_8.ps1 | ## Tab-Completion
#################
## Please dot souce this script file.
## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list.
##
## What this can do is:
##
## [datetime]::n<tab>
## [datetime]::now.d<tab>
## $a = New-Object "Int32[,]" 2,3; $b = "PowerShell","Pow... |
combined_dataset/train/non-malicious/sample_65_62.ps1 | sample_65_62.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/sample_59_13.ps1 | sample_59_13.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="$basedir\..\..\..\..\..\typescript@5.4.5\node_modules"
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of N... |
combined_dataset/train/non-malicious/712.ps1 | 712.ps1 |
function Get-RsRestItemDataSource
{
[CmdletBinding()]
param(
[Parameter(Mandatory = $True)]
[Alias('ItemPath','Path')]
[string]
$RsItem,
[string]
$ReportPortalUri,
[Alias('ApiVersion')]
[ValidateSet("v2.0")]
[string]
$Res... |
combined_dataset/train/non-malicious/1012.ps1 | 1012.ps1 |
$random = (New-Guid).ToString().Substring(0,8)
$subscriptionId = "my-azure-subscription-id"
$apimServiceName = "apim-$random"
$resourceGroupName = "apim-rg-$random"
$location = "Japan East"
$organisation = "Contoso"
$adminEmail = "admin@contoso.com"
$certificateFilePath = "<Replace with path to the Certifica... |
combined_dataset/train/non-malicious/sample_45_53.ps1 | sample_45_53.ps1 | function trySetDesignerProp(tname, ttype, val) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0);
trait.value = val;
}
if (command.getTrait("state").value == 0) {
command.getTrait("state").value = 2;
trySetDesignerProp("manipulationWorldMode", "bool", true);
}
else {
... |
combined_dataset/train/non-malicious/sample_3_88.ps1 | sample_3_88.ps1 | ConvertFrom-StringData @'
id_crmcollectactivity=Collecting System Information
id_crmformattingdata=Formatting Data
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADA... |
combined_dataset/train/non-malicious/Get-DirSize.ps1 | Get-DirSize.ps1 | function Get-DirSize {
<#
.Synopsis
Gets a list of directories and sizes.
.Description
This function recursively walks the directory tree and returns the size of
each directory found.
.Parameter path
The path of the root folder to start scanning.
.Example
# Get the largest folder under the user pro... |
combined_dataset/train/non-malicious/726.ps1 | 726.ps1 |
function Set-RsDataSource
{
[cmdletbinding()]
param
(
[Alias('DataSourcePath','ItemPath', 'Path')]
[Parameter(Mandatory = $True)]
[string]
$RsItem,
[Parameter(Mandatory = $True)]
$DataSourceDefinition,
[string]
$Descript... |
combined_dataset/train/non-malicious/sample_11_94.ps1 | sample_11_94.ps1 | ConvertFrom-StringData @'
id_roiscan=Robust Office Inventory Scan
id_roiscanobtaining=Collecting Robust Office Inventory Scan
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIB... |
combined_dataset/train/non-malicious/sample_7_33.ps1 | sample_7_33.ps1 | ConvertFrom-StringData @'
id_dcdiag=Directory Server Diagnosis (DCDiag)
id_dcdiagobtaining=Running DCDIAG.EXE tool to gather domain controller status information.
id_dcdiagdnsobtaining=Running DCDIAG.EXE tool to gather domain controller DNS health information.
id_dcdiagtopologyobtaining=Running DCDIAG.EXE tool to g... |
combined_dataset/train/non-malicious/1932.ps1 | 1932.ps1 |
Describe "Get-Event" -Tags "CI" {
BeforeEach {
( New-Event -SourceIdentifier PesterTestEvent -sender Windows.timer -messagedata "PesterTestMessage" )
}
AfterEach {
( Remove-Event -SourceIdentifier PesterTestEvent -ErrorAction SilentlyContinue )
}
Context "Check return type of Get-Event" {
I... |
combined_dataset/train/non-malicious/3276.ps1 | 3276.ps1 |
class SlackPerson : Person {
[string]$Email
[string]$Phone
[string]$Skype
[bool]$IsBot
[bool]$IsAdmin
[bool]$IsOwner
[bool]$IsPrimaryOwner
[bool]$IsRestricted
[bool]$IsUltraRestricted
[string]$Status
[string]$TimeZoneLabel
[string]$TimeZone
[string]$Presence
[boo... |
combined_dataset/train/non-malicious/sample_47_21.ps1 | sample_47_21.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.SYNOPSIS
Starts the language and debug services from the PowerShellEditorServices module.
.DESCRIPTION
PowerShell Editor Services Bootstrapper Script
----------------------------------------------
This script contains... |
combined_dataset/train/non-malicious/1937.ps1 | 1937.ps1 |
Describe "ConvertTo-Csv DRT Unit Tests" -Tags "CI" {
$inputObject = [pscustomobject]@{ First = 1; Second = 2 }
It "Test convertto-csv with psobject pipelined" {
$returnObject = $inputObject | ConvertTo-Csv -IncludeTypeInformation
$returnObject.Count | Should -Be 3
$returnObject[0] | S... |
combined_dataset/train/non-malicious/sample_2_70.ps1 | sample_2_70.ps1 | <#
.SYNOPSIS
DEV Components and Scenarios module for learning and demoing TSS Framework usage.
This is NOT related to any specific POD and not designed for learning and troubleshooting.
.DESCRIPTION
DEV Components and Scenarios module for learning and demoing TSS Framework usage.
This is NOT related... |
combined_dataset/train/non-malicious/3151.ps1 | 3151.ps1 |
$EncodedCompressedFile = @'
7b0HYBxJliUmL23Ke39K9UrX4HShCIBgEyTYkEAQ7MGIzeaS7B1pRyMpqyqBymVWZV1mFkDM7Z28995777333nvvvfe6O51OJ/ff/z9cZmQBbPbOStrJniGAqsgfP358Hz8ivvipP+nX+LV/jV/j1/h16P//9//9a/waf9evIc/vqT83PX8Q/f83+V3+nt/k1/jbfuyf/13/rl/z+T//u76ZF026qquLOluk02y5rNp0kqf1epkWy/Tpl6/TRTXLx7/xb5z8bgrj5emv8Ws8/zV/7V/j8uKnf2... |
combined_dataset/train/non-malicious/sample_53_45.ps1 | sample_53_45.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', 'New-Al... |
combined_dataset/train/non-malicious/2624.ps1 | 2624.ps1 |
Import-Module C:\git-repositories\PowerShell\MSFVMLab\MSFVMLab.psm1 -Force
$LabConfig = Get-Content C:\git-repositories\PowerShell\MSFVMLab\LabVMS.json | ConvertFrom-Json
$WorkingDirectory = $LabConfig.WorkingDirectory
$Domain = $LabConfig.Domain
$dc = ( $LabConfig.Servers | Where-Object {$_.Class -eq 'DomainContro... |
combined_dataset/train/non-malicious/629.ps1 | 629.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://heanet.dl.sourceforge.net/project/jedit/jedit/5.1.0/jedit5.1.0install.exe"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ForEach-Object{
try{
... |
combined_dataset/train/non-malicious/sample_62_74.ps1 | sample_62_74.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_56_13.ps1 | sample_56_13.ps1 | #
# Module manifest for module 'OCI.PSModules.Networkloadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Networkloadbalancer.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Sup... |
combined_dataset/train/non-malicious/NTFS ACLs Folder Tree_4.ps1 | NTFS ACLs Folder Tree_4.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/sample_57_74.ps1 | sample_57_74.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
function Trace-Execution {
[CmdletBinding()... |
combined_dataset/train/non-malicious/Get-CertificationAuthori.ps1 | Get-CertificationAuthori.ps1 | #####################################################################
# Get-CertificationAuthority.ps1
# Version 1.0
#
# Retrieves all Enterprise Certification Authorities in cuurent AD forest
#
# Vadims Podans (c) 2009
# http://www.sysadmins.lv/
#################################################################... |
combined_dataset/train/non-malicious/ConvertTo-Hashtable.ps1 | ConvertTo-Hashtable.ps1 | Param([Parameter(ValueFromPipeline=$true)]$object,[switch]$AsString,[switch]$jagged)
BEGIN { $headers = @() }
PROCESS {
if(!$headers -or $jagged) {
$headers = $object | get-member -type Properties | select -expand name
}
$output = @{}
if($AsString) {
foreach($col in $headers) {
... |
combined_dataset/train/non-malicious/HuddledTricks_1.ps1 | HuddledTricks_1.ps1 | #Requires -version 2.0
## Stupid PowerShell Tricks
###################################################################################################
## Usage:
## ps Notepad | Hide-App
## Hide-App -Name PowerShell; Wiggle-Mouse 75 100
##############################################################################... |
combined_dataset/train/non-malicious/Manage ASP_2.NET Providers.ps1 | Manage ASP_2.NET Providers.ps1 | # Manage_ASP_NET_Providers.ps1
# by Chistian Glessner
# http://iLoveSharePoint.com
# have to be initialized. If you want to change the app config you have to restart PowerShell
param($appConfigPath=$(throw "-appConfigPath is mandatory"))
{
# App config path have to be set before loading System.Web.dll
... |
combined_dataset/train/non-malicious/sample_27_36.ps1 | sample_27_36.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 = '83.1.0'
# Sup... |
combined_dataset/train/non-malicious/Windows Startup Script_3.ps1 | Windows Startup Script_3.ps1 | <#======================================================================================
File Name : Startup.ps1
Original Author : Kenneth C. Mazie
:
Description : This is a Windows startup script with pop-up notification and checks to
: assure things are no... |
combined_dataset/train/non-malicious/Resolve-Aliases _5.7.ps1 | Resolve-Aliases _5.7.ps1 | #requires -version 2.0
## ResolveAliases Module v 1.7
########################################################################################################################
## Sample Use:
## Resolve-Aliases Script.ps1 | Set-Content Script.Resolved.ps1
## ls *.ps1 | Resolve-Aliases -Inplace
##############... |
combined_dataset/train/non-malicious/sample_40_29.ps1 | sample_40_29.ps1 | #
# Module manifest for module 'OCI.PSModules.Certificates'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Certificates.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_23_30.ps1 | sample_23_30.ps1 | #
# Module manifest for module 'OCI.PSModules.Nosql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Nosql.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_64_27.ps1 | sample_64_27.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/sample_63_65.ps1 | sample_63_65.ps1 | <#'/* DELL PROPRIETARY INFORMATION
'*
'* This software contains the intellectual property of Dell Inc. Use of this software and the intellectual property
'* contained therein is expressly limited to the terms and conditions of the License Agreement under which it is
'* provided by or on behalf of Dell Inc. or its s... |
combined_dataset/train/non-malicious/1192.ps1 | 1192.ps1 |
& (Join-Path -Path $PSScriptRoot 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'Uninstall-Junction' {
$JunctionPath = $null
$tempDir = Get-Item -Path 'TestDrive:'
BeforeEach {
$Global:Error.Clear()
$JunctionPath = Join-Path $tempDir ([IO.Path]::GetRandomFileName())
New... |
combined_dataset/train/non-malicious/972.ps1 | 972.ps1 |
$SubscriptionId = ''
$resourceGroupName = "myResourceGroup-$(Get-Random)"
$location = "westus2"
$adminSqlLogin = "SqlAdmin"
$password = "ChangeYourAdminPassword1"
$serverName = "server-$(Get-Random)"
$databaseName = "mySampleDatabase"
$startIp = "0.0.0.0"
$endIp = "0.0.0.0"
Set-AzContext -SubscriptionId $subsc... |
combined_dataset/train/non-malicious/Copy-GroupMembership.ps1 | Copy-GroupMembership.ps1 | <#
.SYNOPSIS
Copy group membership between two accounts.
.DESCRIPTION
This script will copy the group membership from an existing user
account to a new user account.
.PARAMETER ADSPath
This is the LDAP URL to where your user accounts are stored
.PARAMETER NewUser
... |
combined_dataset/train/non-malicious/Backup all ESXi.ps1 | Backup all ESXi.ps1 | # Change this to where you would like your backups to go.
# There is no versioning so backup theses backups with real backup software (e.g. on an SMB share).
$backupDir = "c:\\backups"
# Get just your ESXi hosts.
$esxiHosts = Get-VMHost | Where { $_ | Get-View -Property Config | Where { $_.Config.Product.ProductL... |
combined_dataset/train/non-malicious/2081.ps1 | 2081.ps1 |
Describe 'PSModuleInfo.GetExportedTypeDefinitions()' -Tags "CI" {
It "doesn't throw for any module" {
$discard = Get-Module -ListAvailable | ForEach-Object { $_.GetExportedTypeDefinitions() }
$true | Should -BeTrue
}
}
Describe 'use of a module from two runspaces' -Tags "CI" {
function N... |
combined_dataset/train/non-malicious/sample_67_0.ps1 | sample_67_0.ps1 | <#
.Synopsis
Activate a Python virtual environment for the current PowerShell session.
.Description
Pushes the python executable for a virtual environment to the front of the
$Env:PATH environment variable and sets the prompt to signify that you are
in a Python virtual environment. Makes use of the command line... |
combined_dataset/train/non-malicious/sample_12_50.ps1 | sample_12_50.ps1 | <RunRuleResults><Header reportDate="18.12.2023." reportTime="13:42" savedToDirectory="C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20231218_134246\SystemConfigurationCheck_Report.htm"><Machines><Machine value="ALT-SAMPLER-WIN" /></Machines></Header><group groupName="GlobalRules" groupDescription="SQL S... |
combined_dataset/train/non-malicious/sample_37_54.ps1 | sample_37_54.ps1 | # region Generated
# ----------------------------------------------------------------------------------
# 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 obt... |
combined_dataset/train/non-malicious/SQL-Update.ps1 | SQL-Update.ps1 | <#
.SYNOPSIS
Author:...Vidrine
Date:.....2012/04/08
.DESCRIPTION
Function uses the Microsoft SQL cmdlets 'Invoke-SQLcmd' to connect to a SQL database and run an UPDATE statement.
The target record that will be updated is queried based on a table/column named 'ID'. Simply change this to query based on anot... |
combined_dataset/train/non-malicious/2108.ps1 | 2108.ps1 |
Describe "DeserializedMethods" -Tags "CI" {
It "Deserialized objects shouldn't ever have any methods (unless they are primitive known types)" {
$a = [collections.arraylist]::new()
$null = $a.Add(1)
$null = $a.Add(2)
$null = $a.Add(3)
$x = [collections.gen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.