full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_52_84.ps1 | sample_52_84.ps1 | Add-AppxPackage
exit
cd C:\Users\sampler-win_10_x64\Desktop\
Get-AppxPackage >apps.tx
cd C:\Users\sampler-win_10_x64\Desktop\
Get-AppxPackage -allusers | Select Name, PackageFullName > apps_v2.txt
Get-AppxPackage | Select Name, PackageFullName > apps_v2.txt
Get-AppxPackage
Get-AppxPackage -Online
Get-AppxPacka... |
combined_dataset/train/non-malicious/sample_37_35.ps1 | sample_37_35.ps1 | #
# Module manifest for module 'OCI.PSModules.Integration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Integration.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_44_18.ps1 | sample_44_18.ps1 | #
# Module manifest for module 'OCI.PSModules.Email'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Email.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/2767.ps1 | 2767.ps1 |
$data = & $env:windir\system32\sc query | ForEach-Object {
$svc = $_
if ($svc -match "SERVICE_NAME:\s(.*)") {
& $env:windir\system32\sc qfailure $($matches[1])
}
}
$ServiceName = $RstPeriod = $RebootMsg = $CmdLine = $FailAction1 = $FailAction2 = $FailAction3 = $False
$data | ForEach-Object {
... |
combined_dataset/train/non-malicious/3448.ps1 | 3448.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Get-DataFactoryName
{
return getAssetName
}
function Get-ProviderLocation($provider)
{
"Brazil South"
}
function Clean-DataFactory($rgname, $dfname)
{
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -n... |
combined_dataset/train/non-malicious/sample_2_67.ps1 | sample_2_67.ps1 | #************************************************
# TS_HPPrinterDriverVersionCheck.ps1
# Version 1.0.1
# Date: 07/23/2013
# Author: v-alyao
# Description: [KSE Rule] [ Windows V3] HKCU\Software\Hewlett-Packard registry hive increases in size on Citrix servers
# Rule number: ca320e17-1fa3-4740-9f81-c97f299741b0
... |
combined_dataset/train/non-malicious/sample_39_86.ps1 | sample_39_86.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... |
combined_dataset/train/non-malicious/sample_23_0.ps1 | sample_23_0.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 = '80.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_1_81.ps1 | sample_1_81.ps1 | #************************************************
# DC_CollectSqlErrorlogs.ps1
# Version 1.0.0
# Date: 8-19-2011
# Author: Shon Hauck - Shonh@Microsoft.com
# Description: Collects OS Performance Related Information
# Processor Information
# Operating System Performance Information
#
# NOTE:
#
#***... |
combined_dataset/train/non-malicious/4007.ps1 | 4007.ps1 |
$accountName='fbs-aa-01'
$location = "East US"
$resourceGroupName = "to-delete-01"
function AssertContains
{
param([string] $str, [string] $substr, [string] $message)
if (!$message)
{
$message = "Assertion failed because '$str' does not contain '$substr'"
}
if (!$str.Con... |
combined_dataset/train/non-malicious/sample_29_87.ps1 | sample_29_87.ps1 | let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl();
let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/webCore.eventHandlers.js"];
let currentScriptElement = document.querySelector("script[src='Scripts/webCore.plugin.js']");
if (currentScriptElement !== null) {
scr... |
combined_dataset/train/non-malicious/sample_10_41.ps1 | sample_10_41.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/sample_31_79.ps1 | sample_31_79.ps1 | #
# Module manifest for module 'OCI.PSModules.Dataflow'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dataflow.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_7_15.ps1 | sample_7_15.ps1 | # diag_sha.psm1
# Created by tdimli
# March 2020
#
# Diagnostic functions for SHA area
# version
$SHA_version = "1.0.200425.0"
# Area and Area/Component arrays
# Example: $AREA = @("Component1", "Component2")
$SHA = @()
#Component/Diagnostic Function arrays
# Example: $Component1 = @("Diag_Func1", "Dia... |
combined_dataset/train/non-malicious/sample_44_25.ps1 | sample_44_25.ps1 | // RootNameSpace=BlazorWasmApp;
// StartupProjectName=Server/BlazorWasmApp.Server.csproj;
// DbContextProjectDir=Server;
// DataModelProjectDir=Shared;
// SlnName=BlazorWasmApp.sln
// 终端命令
// 初始化一个包含解决方案的Blazor Server项目
0.key: "cmd: dotnet - blazor - Initial a Blazor Server app solution"
0.parameters: [{par... |
combined_dataset/train/non-malicious/sample_0_78.ps1 | sample_0_78.ps1 | #
# Module manifest for module 'OCI.PSModules.Disasterrecovery'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Disasterrecovery.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported... |
combined_dataset/train/non-malicious/4339.ps1 | 4339.ps1 | function Get-EntityName
{
param
(
[Parameter(Mandatory=$true)]
$SoftwareIdentity,
[Parameter(Mandatory=$true)]
$Role
)
foreach( $entity in $SoftwareIdentity.Entities )
{
if( $entity.Role -eq $Role)
{
$entity.Name
}
}
}
|
combined_dataset/train/non-malicious/3195.ps1 | 3195.ps1 | function Invoke-Sqlcmd2
{
[CmdletBinding( DefaultParameterSetName='Ins-Que' )]
[OutputType([System.Management.Automation.PSCustomObject],[System.Data.DataRow],[System.Data.DataTable],[System.Data.DataTableCollection],[System.Data.DataSet])]
param(
[Parameter( ParameterSetName='Ins-Que',
... |
combined_dataset/train/non-malicious/sample_45_26.ps1 | sample_45_26.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 = '74.1.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/ConvertFrom-FahrenheitWi.ps1 | ConvertFrom-FahrenheitWi.ps1 | ## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n\nparam([double] $Fahrenheit)\n\nSet-StrictMode -Version Latest\n\n## Convert Fahrenheit to Celsius\nfunction ConvertFahrenheitToCelsius([double] $fahrenheit)\n{\n $celsius = $fahrenheit - 32\n $celsius = $celsius /... |
combined_dataset/train/non-malicious/Get-PDC09Videos_2.ps1 | Get-PDC09Videos_2.ps1 | #requires -version 2.0
PARAM (
[Parameter(Position=1, Mandatory=$true)]
[ValidateSet("wmv","wmvhigh","ppt")] # the "mp4" files aren't there yet
[String]$MediaType,
[string]$Destination = $PWD
)
if( ([System.Environment]::OSVersion.Version.Major -gt 5) -and -not ( # Vista and ...
new-object Secur... |
combined_dataset/train/non-malicious/1175.ps1 | 1175.ps1 |
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$rootDir = $null
$childDir = $null
$grandchildFile = $null
$childFile = $null
function Assert-EverythingCompressed
{
Assert-Compressed -Path $rootDir
Assert-Compressed -Path $childDi... |
combined_dataset/train/non-malicious/4295.ps1 | 4295.ps1 |
function SuiteSetup {
Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue
Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue
$script:IsWindowsOS = (-not (Get-Variable -Name IsWindows -ErrorAction Ignore)) -or $IsWindows
$script:ProgramFilesScrip... |
combined_dataset/train/non-malicious/sample_23_21.ps1 | sample_23_21.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/Read-Choice_3.ps1 | Read-Choice_3.ps1 | # function Read-Choice {
#.Synopsis
# Prompt the user for a choice, and return the (0-based) index of the selected item
#.Parameter Message
# This is the prompt that will be presented to the user. Basically, the question you're asking.
#.Parameter Choices
# An array of strings representing the choices (or me... |
combined_dataset/train/non-malicious/3407.ps1 | 3407.ps1 |
function Test-VirtualMachineBootDiagnostics
{
$rgname = Get-ComputeTestResourceName
try
{
$loc = Get-ComputeVMLocation;
New-AzureRmResourceGroup -Name $rgname -Location $loc -Force;
$vmsize = 'Standard_A4';
$vmname = 'vm' + $rgname;
... |
combined_dataset/train/non-malicious/sample_2_71.ps1 | sample_2_71.ps1 | ConvertFrom-StringData @'
id_printerkb2457866check=Checking for KB 2457866
id_printerkb2457866checkdesc=Checking for Event 602 on Microsoft-Windows-PrintService/Admin Event Log
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3A... |
combined_dataset/train/non-malicious/sample_16_3.ps1 | sample_16_3.ps1 | /*
Language: PowerShell
Description: PowerShell is a task-based command-line shell and scripting language built on .NET.
Author: David Mohundro <david@mohundro.com>
Contributors: Nicholas Blumhardt <nblumhardt@nblumhardt.com>, Victor Zhou <OiCMudkips@users.noreply.github.com>, Nicolas Le Gall <contact@nlegall.fr>
Websi... |
combined_dataset/train/non-malicious/sample_26_65.ps1 | sample_26_65.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Get-AMTAccessMonitor {
<#
.Synopsis
Returns Intel Active Management Technology access events
.Description
This Cmdlet returns the Intel Active Management Technology (AMT) access events from clients that have Intel Active Ma... |
combined_dataset/train/non-malicious/Hardware Inventory.ps1 | Hardware Inventory.ps1 | # Synopsis:
# Windows Script to collect Hardware information on a local system
# And Convert it to a JSON String and Upload that to a CouchDB
# Database
# Requirements:
# -Local Admin Access in Powershell v2
# -SSL(443/TCP) allowed to CouchDB Host
# -Proxy verified and communication to it
Write-Host "
... |
combined_dataset/train/non-malicious/ConvertTo-CliXml_1.ps1 | ConvertTo-CliXml_1.ps1 | function ConvertTo-CliXml {
param(
[parameter(position=0,mandatory=$true,valuefrompipeline=$true)]
[validatenotnull()]
[psobject]$object
)
begin {
$type = [type]::gettype("System.Management.Automation.Serializer")
$ctor = $type.getconstructor("instance,nonpubl... |
combined_dataset/train/non-malicious/2559.ps1 | 2559.ps1 | param(
[String[]] $DatabaseList
)
"The number of parameters passed in DatabaseList is $($DatabaseList.Count)"
$i = 0
foreach ($arg in $DatabaseList) { echo "The $i parameter in DatabaseList is $arg"; $i++ }
|
combined_dataset/train/non-malicious/sample_0_12.ps1 | sample_0_12.ps1 | #
#
# Rule to look for organizations that are newer than the deployment
#
# Created: 5/24/2012
# Author: Jonathan Randall
#******************************************************************************************************************
#region Functions
function GetOrganizationData([string] $conn_string)
... |
combined_dataset/train/non-malicious/sample_18_47.ps1 | sample_18_47.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/3317.ps1 | 3317.ps1 |
function New-Group {
[PoshBot.BotCommand(
Aliases = ('ng', 'newgroup'),
Permissions = 'manage-groups'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string[]]$Name,
[parameter(Position = 1)]
... |
combined_dataset/train/non-malicious/sample_28_66.ps1 | sample_28_66.ps1 | [CmdletBinding(PositionalBinding=$false)]
Param(
[switch][Alias('h')]$help,
[switch][Alias('t')]$test,
[ValidateSet("Debug","Release")][string[]][Alias('c')]$configuration = @("Debug"),
[string][Alias('v')]$verbosity = "minimal",
[switch]$vs,
[ValidateSet("windows","linux","osx")][string]$os,
[switch]$tes... |
combined_dataset/train/non-malicious/sample_13_5.ps1 | sample_13_5.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_46_26.ps1 | sample_46_26.ps1 | #See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may n... |
combined_dataset/train/non-malicious/1741.ps1 | 1741.ps1 |
param(
[Parameter(HelpMessage="Artifact folder to find compliance files in.")]
[string[]]
$ArtifactFolder,
[Parameter(HelpMessage="VSTS Variable to set path to complinance Files.")]
[string]
$VSTSVariableName
)
$compliancePath = $null
foreach($folder in $ArtifactFolder)
{
Write-Host ... |
combined_dataset/train/non-malicious/67.ps1 | 67.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aa... |
combined_dataset/train/non-malicious/3710.ps1 | 3710.ps1 |
function Test-NewAzureRmCognitiveServicesAccount
{
$rgname = Get-CognitiveServicesManagementTestResourceName;
try
{
$accountname = 'csa' + $rgname;
$skuname = 'S2';
$accounttype = 'TextAnalytics';
$loc = Get-Location -providerNamespace "Microsoft... |
combined_dataset/train/non-malicious/sample_19_59.ps1 | sample_19_59.ps1 | ConvertFrom-StringData @'
id_sccm_activity_cm07serverinfo=Gathering Site Server Information
id_sccm_cmserverinfo_boundary=Obtaining Boundaries
id_sccm_cmserverinfo_cloud=Obtaining Cloud Services information
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# Bg... |
combined_dataset/train/non-malicious/250.ps1 | 250.ps1 | function New-DjoinFile
{
[Cmdletbinding()]
PARAM (
[Parameter(Mandatory = $true)]
[System.String]$Blob,
[Parameter(Mandatory = $true)]
[System.IO.FileInfo]$DestinationFile = "c:\temp\djoin.tmp"
)
PROCESS
{
TRY
{
$bytechai... |
combined_dataset/train/non-malicious/1694.ps1 | 1694.ps1 |
function Expand-OU ($searchroot) {
$searchrootarray = $searchroot.split('/') | ? {$_ -and $_ -notmatch '^(?:\s+)?$'}
$dn = ([adsi]"LDAP://$($searchrootarray[0])").distinguishedname.ToString()
$searchrootarray = $searchrootarray | select -Skip 1
foreach ($obj in $searchrootarray) {
$quer... |
combined_dataset/train/non-malicious/sample_54_19.ps1 | sample_54_19.ps1 | param (
[string]$Workspace,
# [bool]$ModifyAllCaptions = $true
[string]$strModifyAllCaptions = "false"
)
if ($strModifyAllCaptions -eq "true") {
$ModifyAllCaptions = $true
}
else {
$ModifyAllCaptions = $false
}
$CreateJson = $PSScriptRoot + "\Create-Json.ps1"
$ProjectDir = Spl... |
combined_dataset/train/non-malicious/sample_22_55.ps1 | sample_22_55.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 = '83.2.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_38_29.ps1 | sample_38_29.ps1 | const lang = Object.freeze({ "displayName": "CUE", "fileTypes": ["cue"], "name": "cue", "patterns": [{ "include": "#whitespace" }, { "include": "#comment" }, { "captures": { "1": { "name": "keyword.other.package" }, "2": { "name": "entity.name.namespace" } }, "match": "(?<![\\p{L}\\p{Nd}_\\$\\#])(package)[ \\t]+([\\p{L... |
combined_dataset/train/non-malicious/sample_58_97.ps1 | sample_58_97.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/sample_16_44.ps1 | sample_16_44.ps1 | #
# Module manifest for module 'OCI.PSModules.Aidocument'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aidocument.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_37_99.ps1 | sample_37_99.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeaiinference'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeaiinference.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
#... |
combined_dataset/train/non-malicious/150.ps1 | 150.ps1 | function Remove-PSObjectProperty
{
PARAM (
$PSObject,
[String[]]$Property)
PROCESS
{
Foreach ($item in $Property)
{
$PSObject.psobject.Properties.Remove("$item")
}
}
} |
combined_dataset/train/non-malicious/Add new smtp_set prmary.ps1 | Add new smtp_set prmary.ps1 | #alias,addnewemailaddress
import-csv .\\source.csv | foreach {
$user = Get-Mailbox $_.alias
$user.emailAddresses+= $_.addnewemailaddress
$user.primarysmtpaddress = $_.addnewemailaddress
Set-Mailbox $user -emailAddresses $user.emailAddresses
set-Mailbox $user -PrimarySmtpAddress $user.primarysmtpaddress
}
|
combined_dataset/train/non-malicious/Hack ESXi_2.ps1 | Hack ESXi_2.ps1 | $screen = " You see here a virtual switch. ------------ ------
#...........| |....|
--------------- ###------------ |...(|
|..%...........|########## ###-@...|
... |
combined_dataset/train/non-malicious/2124.ps1 | 2124.ps1 |
Describe "Scripting.Followup.Tests" -Tags "CI" {
It "'[void](New-Item) | <Cmdlet>' should work and behave like passing AutomationNull to the pipe" {
try {
$testFile = Join-Path $TestDrive (New-Guid)
[void](New-Item $testFile -ItemType File) | ForEach-Object { "YES" } | Should -BeNu... |
combined_dataset/train/non-malicious/sample_29_61.ps1 | sample_29_61.ps1 | #
# Module manifest for module 'OCI.PSModules.Governancerulescontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Governancerulescontrolplane.dll'
# Version number of this module.
ModuleVersion =... |
combined_dataset/train/non-malicious/sample_12_81.ps1 | sample_12_81.ps1 | # Rule ID 4628
# ---------
# http://sharepoint/sites/rules/Rule%20Submissions/Dynamics-CRM_ehagen_2012-06-11-03-02-42.xml
#
# Description: This checks to see if the data types on each CRM registry key is correct.
#
# Related KB
#-----------
# Script Author: jrandall
#
PARAM($RegistryPath=$null)
#r... |
combined_dataset/train/non-malicious/Get-RemoteRegistry.ps1 | Get-RemoteRegistry.ps1 | # Get-RemoteRegistry
# NOTE: you have to have access, and the remote registry service has to be running
param(
[string]$computer = $(Read-Host "Remote Computer Name")
,[string]$Path = $(Read-Host "Remote Registry Path (must start with HKLM,HKCU,etc)")
,[switch]$Verbose
)
if ($Verbose) { $VerbosePrefere... |
combined_dataset/train/non-malicious/Highlight syntax_1.ps1 | Highlight syntax_1.ps1 | #code which need highlight
$code = @'
#just example
Get-Process | % {
try {
"{0, 7} {1}" -f $_.Id, $_.MainModule.ModuleName
}
catch [System.ComponentModel.Win32Exception] {}
}
'@
function frmMain_Show {
Add-Type -AssemblyName System.Windows.Forms
#keywords
$type = New-Object "Collection... |
combined_dataset/train/non-malicious/vibackup-lx_1.ps1 | vibackup-lx_1.ps1 | Param (
$viServer,
$bakVM,
$lxDest
)
#region check
if (!$viServer) { $viServer = Read-Host -Prompt "VI Server " }
if (!$bakVM) { $bakVM = Read-Host -Prompt "VM to Backup " }
if (!$lxDest) { $lxDest = Read-Host -Prompt "Backup Path (ex. /srv/backup) " }
#endregion
#region globalvars
$encoding = "OEM"
... |
combined_dataset/train/non-malicious/3729.ps1 | 3729.ps1 |
function Test-GetActionRulesFilteredByParameters
{
$severityFilter = "Sev3"
$monitorService = "Platform"
$actionRules = Get-AzActionRule -Severity $severityFilter -MonitorService $monitorService
Assert-NotNull $actionRules.Count
}
function Test-CreateUpdateAndDeleteSuppressionRule
{
try
{
$reso... |
combined_dataset/train/non-malicious/sample_19_52.ps1 | sample_19_52.ps1 | parameters:
- name: PAT
type: string
- name: isPreRelease
type: string
- name: ghCreateRelease
type: boolean
- name: ghReleaseAddChangeLog
type: boolean
steps:
- pwsh: |
$vsixFileName = (Get-ChildItem -File | Select-Object -First 1).Name
Write-Host "##vso[task.setvariable variable... |
combined_dataset/train/non-malicious/sample_52_92.ps1 | sample_52_92.ps1 | #
# Module manifest for module 'OCI.PSModules.Fusionapps'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fusionapps.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/3759.ps1 | 3759.ps1 |
function Test-CreateIntegrationAccountCertificate
{
$resourceGroup = TestSetup-CreateResourceGroup
$integrationAccountName = "IA-" + (getAssetname)
$integrationAccountCertificateName = getAssetname
$integrationAccount = TestSetup-CreateIntegrationAccount $resourceGroup.ResourceGroupName $integrat... |
combined_dataset/train/non-malicious/Compare-AD.ps1 | Compare-AD.ps1 | ###############################################################################
# Compare-AD - a set of functions (and sample code using them) to create
# snapshots of user accounts in the current Active Directory domain
# save them in an xml file, and then compare live AD environment
# against that XML
#
# (C) ... |
combined_dataset/train/non-malicious/3139.ps1 | 3139.ps1 | $Title = "Continue"
$Info = "Would you like to continue?"
$Options = [System.Management.Automation.Host.ChoiceDescription[]] @("&Yes", "&No")
[int]$DefaultChoice = 0
$Opt = $host.UI.PromptForChoice($Title , $Info, $Options, $DefaultChoice)
switch($Opt)
{
0 {
Write-Verbose -Message "Yes"
}
1 {
Write-Verbo... |
combined_dataset/train/non-malicious/sample_57_32.ps1 | sample_57_32.ps1 | <#
.SYNOPSIS
Script to run the tests
.DESCRIPTION
This script activates the venv and launches pytest
.EXAMPLE
test.ps1
#>
param(
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD=$false,
[Parameter(Mandatory=$false, ValueFromRemainingArguments=$t... |
combined_dataset/train/non-malicious/564.ps1 | 564.ps1 |
function Add-SPOCalculatedFieldtoList
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string] $listTitle,
[Parameter(Mandatory=$true, Position=2)]
[string] $fieldName,
[Parameter(Mandatory=$true, Position=3)]
[string] $value
)
$refField = $value.Split(";")[1]
$for... |
combined_dataset/train/non-malicious/453.ps1 | 453.ps1 | Register-PSFConfigValidation -Name "long" -ScriptBlock {
Param (
$Value
)
$Result = New-Object PSOBject -Property @{
Success = $True
Value = $null
Message = ""
}
try { [long]$number = $Value }
catch
{
$Result.Message = "Not a long: $Value"
$Result.Success = $False
return $Result
}
$Result... |
combined_dataset/train/non-malicious/SuperMario PowerShell.ps1 | SuperMario PowerShell.ps1 | [System.Console]::Beep(659, 125)
[System.Console]::Beep(659, 125)
Start-Sleep -Milliseconds 125
[System.Console]::Beep(659, 125)
Start-Sleep -Milliseconds 167
[System.Console]::Beep(523, 125)
[System.Console]::Beep(659, 125)
Start-Sleep -Milliseconds 125
[System.Console]::Beep(784, 125)
Start-Sleep -Millisecon... |
combined_dataset/train/non-malicious/sample_2_18.ps1 | sample_2_18.ps1 | # make sure we stop on exceptions
$ErrorActionPreference = "Stop"
# This object reprents the result value for tab expansion functions when no result is returned.
# This is so that we can distinguish it from $null, which has different semantics
$NoResultValue = New-Object PSObject -Property @{ NoResult = $true }
... |
combined_dataset/train/non-malicious/sample_63_18.ps1 | sample_63_18.ps1 | #
# Module manifest for module 'OCI.PSModules.Dataintegration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dataintegration.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported P... |
combined_dataset/train/non-malicious/Send-MailMessage_1.ps1 | Send-MailMessage_1.ps1 | ##############################################################################
##
## Send-MailMessage
##
## From Windows PowerShell Cookbook (O'Reilly)
## by Lee Holmes (http://www.leeholmes.com/guide)
##
## Illustrate the techniques used to send an email in PowerShell.
## In version two, use the Send-MailMessa... |
combined_dataset/train/non-malicious/sample_16_74.ps1 | sample_16_74.ps1 | #
# Module manifest for module 'PowerShellEditorServices.VSCode'
#
# Generated by: daviwil
#
# Generated on: 6/16/2017
#
@{
# Script module or binary module file associated with this manifest.
RootModule = "$PSScriptRoot/bin/Microsoft.PowerShell.EditorServices.VSCode.dll"
# Version number of this module... |
combined_dataset/train/non-malicious/sample_37_1.ps1 | sample_37_1.ps1 | Function Test-Empty
{
[CmdletBinding()]
[OutputType([boolean])]
param
(
[Parameter(Mandatory=$true)]
[AllowNull()]
[AllowEmptyString()]
[string]$content
)
return [string]::IsNullOrEmpty($content) -or [string]::IsNullOrWhiteSpace($content)
}
functi... |
combined_dataset/train/non-malicious/937.ps1 | 937.ps1 |
$apiVersion = "2015-04-08"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "database1"
$databaseThroughputResourceName = $accountName + "/gremlin/" + $databaseName + "/throughput"
$databaseThroughputResourceType = "Microsoft.DocumentDb/databaseAccounts/apis/databases/settings"
$... |
combined_dataset/train/non-malicious/590.ps1 | 590.ps1 |
function Get-TrueCryptContainer{
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[String]
$Name,
[Switch]
$Mounted
)
$MountedContainers = Get-PPConfiguration $PSconfigs.TrueCryptContainer.DataFile | %{$_.Content.MountedContainer}
Ge... |
combined_dataset/train/non-malicious/2631.ps1 | 2631.ps1 | Function
Convert-WindowsImage
{
[CmdletBinding(DefaultParameterSetName="SRC",
HelpURI="http://gallery.technet.microsoft.com/scriptcenter/Convert-WindowsImageps1-0fe23a8f")]
param(
[Parameter(ParameterSetName="SRC", Mandatory=$true, ValueFromPipeline=$true)]
[Alias("WIM")]
[string]
[ValidateNotNul... |
combined_dataset/train/non-malicious/4242.ps1 | 4242.ps1 | $Source = @"
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Reflection;
public class sRDI
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct IMAGE_DATA_DIRECTORY
{
public uint VirtualAddress;
public uint Size;
}
//[StructLay... |
combined_dataset/train/non-malicious/sample_42_27.ps1 | sample_42_27.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/ISE-Lines_3.ps1 | ISE-Lines_3.ps1 | #requires -version 2.0
## ISE-Lines module v 1.1
## DEVELOPED FOR CTP3
## See comments for each function for changes ...
##############################################################################################################
## Provides Line cmdlets for working with ISE
## Duplicate-Line - Duplicates curr... |
combined_dataset/train/non-malicious/ShowUI Clock 6.ps1 | ShowUI Clock 6.ps1 | New-UIWidget -AsJob -Content {
$shadow = DropShadowEffect -Color Black -Shadow 0 -Blur 8
$now = Get-Date;
StackPanel {
TextBlock -Name "Time" ('{0:h:mm tt}' -f $now) -FontSize 108 -LineHeight 100 -LineStackingStrategy BlockLineHeight -Margin 0 -Padding 0 -Foreground White -Effect $shadow -FontFa... |
combined_dataset/train/non-malicious/GPRS Online log_5.ps1 | GPRS Online log_5.ps1 | <#
.SYNOPSIS
Get-GprsTime (V3.3 Update for Windows 7) Check the total connect time of any
GPRS devices from a specified date.
Use Get-Help .\\Get-GprsTime -full to view Help for this file.
.DESCRIPTION
Display all the GPRS modem Event Log entries. While applications issued by the
mobile phone manufacturers wi... |
combined_dataset/train/non-malicious/sample_30_39.ps1 | sample_30_39.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_4_42.ps1 | sample_4_42.ps1 | ConvertFrom-StringData @'
id_vssbackuppkgfiles=Windows Server Backup Files
id_vssbackuppkgfilesobtaining=Obtaining Windows Server Backup log files
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNL... |
combined_dataset/train/non-malicious/1993.ps1 | 1993.ps1 |
using namespace System.Diagnostics
Describe 'minishell for native executables' -Tag 'CI' {
BeforeAll {
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
}
Context 'Streams from minishell' {
It 'gets a hashtable object from minishell' {
$output = & $powershell -n... |
combined_dataset/train/non-malicious/2073.ps1 | 2073.ps1 |
Describe "Json.NET LINQ Parsing" -tags "CI" {
BeforeEach {
$jsonFile = Join-Path -Path (Join-Path $PSScriptRoot -ChildPath assets) -ChildPath TestJson.json
$jsonData = (Get-Content $jsonFile | Out-String)
$json = [Newtonsoft.Json.Linq.JObject]::Parse($jsonData)
}
It "Should return data via Item()" ... |
combined_dataset/train/non-malicious/sample_66_22.ps1 | sample_66_22.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_28_75.ps1 | sample_28_75.ps1 | param(
[Parameter(HelpMessage="Creates a tunnel")]
[switch]$Tunnel = $False,
[Parameter(Mandatory=$True,HelpMessage="Last 4 digits of the GCRAZGDL host you wish to connect to")]
[string]$Num,
[Parameter(Mandatory=$True,HelpMessage="Your Alias in type DOMAIN.alias")]
[string]$Alias,
[Pa... |
combined_dataset/train/non-malicious/sample_4_38.ps1 | sample_4_38.ps1 | # Copyright ?008, Microsoft Corporation. All rights reserved.
if($debug -eq $true){[void]$shell.popup("Run TS_Virtualization.ps1")}
Import-LocalizedData -BindingVariable VirtualizationStrings
Write-DiagProgress -Activity $VirtualizationStrings.ID_Virtualization -Status $VirtualizationStrings.ID_Virtualizatio... |
combined_dataset/train/non-malicious/sample_7_97.ps1 | sample_7_97.ps1 | ConvertFrom-StringData @'
id_descriptors=Collecting Windows Update service descriptors
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC0vOKl... |
combined_dataset/train/non-malicious/sample_18_23.ps1 | sample_18_23.ps1 | ##------------------------------------------------------------------
## <copyright file="GMATenantJson.psm1" company="Microsoft">
## Copyright (C) Microsoft. All rights reserved.
## </copyright>
##------------------------------------------------------------------
$azureStackNugetPath = Get-ASArtifactPath -N... |
combined_dataset/train/non-malicious/LetterDiamondOneliner v_3.ps1 | LetterDiamondOneliner v_3.ps1 | &{param([char]$c)[int]$s=65;$p=$c-$s;$r=,(' '*$p+[char]$s);$r+=@(do{"{0,$p} {1}{0}"-f([char]++$s),(' '*$f++)}until(!--$p));$r;$r[-2..-99]}Z
# trimmed 130 chars w/o arg
&{param([char]$c)$p=$c-($s=65);$r=,(' '*$p+[char]$s);do{$r+="{0,$p} {1}{0}"-f([char]++$s),(' '*$f++)}until(!--$p);$r;$r[-2..-99]}J
# trimmed to... |
combined_dataset/train/non-malicious/217.ps1 | 217.ps1 | function Test-RemoteDesktopIsEnabled
{
PARAM(
[String[]]$ComputerName = $env:COMPUTERNAME
)
FOREACH ($Computer in $ComputerName)
{
TRY{
IF (Test-Connection -Computer $Computer -count 1 -quiet)
{
$Splatting = @{
ComputerName = $Computer
NameSpace = "root\cimv2\Termi... |
combined_dataset/train/non-malicious/1094.ps1 | 1094.ps1 |
if( (Get-WmiObject -Class 'Win32_ComputerSystem').Domain -eq 'WORKGROUP' )
{
Write-Warning -Message ('Find-ADUser tests can''t run because this computer is not part of a domain.')
}
else
{
$domainUrl = ''
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\I... |
combined_dataset/train/non-malicious/ConvertFrom-Property_2.ps1 | ConvertFrom-Property_2.ps1 | <#
.SYNOPSIS
Converts data from flat or single-level property files into PSObjects
.DESCRIPTION
Converts delimited string data into objects
.PARAMETER InputObject
The text to be parsed
.PARAMETER FilePath
A file containing text to be parsed (so you can pipeline files to be processed)
.PARAMETER Val... |
combined_dataset/train/non-malicious/adv2.ps1 | adv2.ps1 |
#--------------------------------------------------------
# Script : Advanced2_2011.ps1
# Author : marc carter (marcadamcarter)
# Date : 4/5/2011
# Keywords: PowerShell, Scripting Games
# Comments:
# Expected Arguments: ADquery, Excel, textfile, <device_name_or_ip>
# Examples: .\\Advanced2_2011.ps1... |
combined_dataset/train/non-malicious/sample_33_2.ps1 | sample_33_2.ps1 | #
# Module manifest for module 'OCI.PSModules.Datalabelingservicedataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datalabelingservicedataplane.dll'
# Version number of this module.
ModuleVersion... |
combined_dataset/train/non-malicious/sample_33_73.ps1 | sample_33_73.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmcontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmcontrolplane.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_65_5.ps1 | sample_65_5.ps1 | $ErrorActionPreference = 'Stop'
<#
.Synopsis
Returns payload information from glcm. This info is required to send a heart beat request to AA
#>
function Get-HeartbeatInfo
{
[CmdletBinding()]
param()
$glcm = Get-DscLocalConfigurationManager
$configurationName = ""
$aaServerU... |
combined_dataset/train/non-malicious/Find Permissions.ps1 | Find Permissions.ps1 | function findPermission ([string]$a, [string]$b)
{
$string = $a
$user = $b
$initialArray = @{}
$lowerArray = @{}
do{
$initialArray = get-acl $string | %{$_.access} | %{$_.IdentityReference}
$lowerArray = $initialArray | %{$_.value.toLower()} | %{$_.SubString(12)}
foreach($item in $lowerArray)
{
if($item.Cont... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.