full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/988.ps1 | 988.ps1 | Param(
[parameter(Mandatory=$true)]
$CsvFilePath
)
$ErrorActionPreference = "Stop"
$scriptsPath = $PSScriptRoot
if ($PSScriptRoot -eq "") {
$scriptsPath = "."
}
. "$scriptsPath\asr_logger.ps1"
. "$scriptsPath\asr_common.ps1"
. "$scriptsPath\asr_csv_processor.ps1"
Function ProcessItemImpl($processor, $cs... |
combined_dataset/train/non-malicious/get-ipinformation.ps1 | get-ipinformation.ps1 | function get-ipinformation
{
process {
(Get-WmiObject Win32_NetworkAdapterConfiguration -computer $_ ) | ? { $_.IPenabled } |
select (AS Server , __server,
DNSHostName , DNSHostName ,
Mac , Macaddress,
Description, Description,
DNSDomain , DNSDomain,
... |
combined_dataset/train/non-malicious/sample_36_67.ps1 | sample_36_67.ps1 | #!/usr/bin/env pwsh
<#
.SYNOPSIS
Stub around Invoke-Pester command used by VSCode PowerShell extension.
.DESCRIPTION
The stub checks the version of Pester and if >= 4.6.0, invokes Pester
using the LineNumber parameter (if specified). Otherwise, it invokes
using the TestName parameter (if specif... |
combined_dataset/train/non-malicious/sample_17_70.ps1 | sample_17_70.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/sample_13_46.ps1 | sample_13_46.ps1 | function New-AzDataProtectionBackupVault
{
[OutputType('PSObject')]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates or updates a BackupVault resource belonging to a resource group.')]
param(
[Parameter(... |
combined_dataset/train/non-malicious/Set-Writable.ps1 | Set-Writable.ps1 | # ---------------------------------------------------------------------------
### <Script>
### <Author>Keith Hill</Author>
### <Description>
### This filter can be used to change a file's read only status.
### </Description>
### <Usage>
### Set-Writable foo.txt
### Set-Writable [a-h]*.txt -passthru
### Get-Chi... |
combined_dataset/train/non-malicious/sample_50_73.ps1 | sample_50_73.ps1 | # Localized 06/28/2023 07:56 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Solución de problemas
Troubleshoot_DetectNetworkCache=Comprobando caché de red del Reproductor de Windows Media...
Resolution_Title=Resolución
Resolution_ResetConfiguration=Restablec... |
combined_dataset/train/non-malicious/1391.ps1 | 1391.ps1 |
function Disable-CNtfsCompression
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
[Alias('FullName')]
[string[]]$Path,
[Switch]$Recurse,
[sw... |
combined_dataset/train/non-malicious/sample_20_2.ps1 | sample_20_2.ps1 | ConvertFrom-StringData @'
id_offerkbarticlenamedefault=Diagnostic Package Information
id_offerkbarticledescdefault=For more information about this diagnostic package, please click on the link below, otherwise click 'Next'.
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgE... |
combined_dataset/train/non-malicious/Enable-MailboxJunkEmail_1..ps1 | Enable-MailboxJunkEmail_1..ps1 | # Author: Jon Webster
# Name: Enable-MailboxJunkEmail
# Created: 1/27/2009
#
# Version: 1.0
# History: 1.0 01/27/2009 Initial version
param(
$Identity,
[string]$CasURL,
[string]$User,
[string]$Password,
$DomainController,
[switch]$help
)
BEGIN
{
Function Usage
{
Write-Host @'
Enable Se... |
combined_dataset/train/non-malicious/1794.ps1 | 1794.ps1 |
Describe "Set-Content cmdlet tests" -Tags "CI" {
BeforeAll {
$file1 = "file1.txt"
$filePath1 = Join-Path $testdrive $file1
$skipRegistry = ! (Test-Path hklm:/)
}
It "A warning should be emitted if both -AsByteStream and -Encoding are used together" {
$testfile = "... |
combined_dataset/train/non-malicious/ConvertFrom-CliXml.ps1 | ConvertFrom-CliXml.ps1 | function ConvertFrom-CliXml {
param(
[parameter(position=0,mandatory=$true,valuefrompipeline=$true)]
[validatenotnull()]
[string]$string
)
begin
{
$inputstring = ""
}
process
{
$inputstring += $string
}
end
{
$type =... |
combined_dataset/train/non-malicious/3156.ps1 | 3156.ps1 | $global:ThemeSettings = New-Object -TypeName PSObject -Property @{
GitSymbols = @{
BranchSymbol = 'branch'
OriginSymbols = @{
Enabled = $false
Github = [char]::ConvertFromUtf3... |
combined_dataset/train/non-malicious/Set-WinSchedule_1.ps1 | Set-WinSchedule_1.ps1 | # Set-WinSchedule
# Written by Tome Tanasovski
# http://powertoe.wordpress.com
# version 1.0
# Created March 2010
#
# Please read through the synopsis->Description to see the list of features that I hope to get
# in a final release. If you choose to work on any of the issues by all means, but please contact
#... |
combined_dataset/train/non-malicious/sample_13_17.ps1 | sample_13_17.ps1 | #************************************************
# TS_UnableToAddNetworkPrintersErrorCheck.ps1
# Version 1.0.1
# Date: 7/19/2013
# Author: v-kaw
# Description: [KSE Rule] [ Windows V3] Presence of lots of folders inside \spool\prtprocs\ causes failure to install print queues
# Rule number: d4047602-196c-443f-9... |
combined_dataset/train/non-malicious/sample_2_72.ps1 | sample_2_72.ps1 | // ==================================================================
// DCIM_CSElementCapabilities
// ==================================================================
[ dynamic, provider("dcismprovider"),
Association,
Description ("LogicalDevices can be aggregated by a System. "
"This relationship is... |
combined_dataset/train/non-malicious/Get-PasswordExpiredUser_1.ps1 | Get-PasswordExpiredUser_1.ps1 | Param($ou)
if($ou){$root = [ADSI]"LDAP://$ou"}else{$root=[adsi]""}
$filter = "(&(objectCategory=user)(userAccountControl:1.2.840.113556.1.4.803:=65536))"
$ds = new-object directoryservices.directorysearcher($root,$filter)
$users = $ds.findall()
$users | format-table @{l="User";e={$_.properties.item('cn')}},
... |
combined_dataset/train/non-malicious/sample_13_69.ps1 | sample_13_69.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/3322.ps1 | 3322.ps1 |
function Find-Plugin {
[PoshBot.BotCommand(Permissions = 'manage-plugins')]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Position = 0)]
[string]$Name,
[parameter(Position = 1)]
[string]$Repository = 'PSGallery'
)
$params = ... |
combined_dataset/train/non-malicious/sample_33_75.ps1 | sample_33_75.ps1 | #
# Module manifest for module 'OCI.PSModules.Opa'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Opa.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/938222df-0908-4ad3-86aa-24bb9510af6f.ps1 | 938222df-0908-4ad3-86aa-24bb9510af6f.ps1 |
## Update all fast running (1 minute) timerjobs to run onece every 30+ minutes instead
## Jos Verlinde
## Version 1 - Sharepoint 2010 B2
$Jobs = @(Get-SPTimerJob | Where-Object { $_.Schedule.Interval -le 5 -and $_.Schedule.Description -eq "Minutes" })
if ( $Jobs.count -GT 0 ) {
## Add 30 mintues to al... |
combined_dataset/train/non-malicious/sample_40_73.ps1 | sample_40_73.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmconfig'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmconfig.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_59_21.ps1 | sample_59_21.ps1 | #
# Module manifest for module 'OCI.PSModules.Workrequests'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Workrequests.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_1_63.ps1 | sample_1_63.ps1 | ConvertFrom-StringData @'
progressbar_id_crm_missingauthtypes_check=Checking CRM 4.0 web.config for missing authorizedTypes elements
progressbar_id_crm_missingauthtypes_checkdesc=Checking CRM 4.0 web.config for missing authorizedTypes elements
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQ... |
combined_dataset/train/non-malicious/sample_56_56.ps1 | sample_56_56.ps1 | <#
.SYNOPSIS
MSRD-Collect tracing module
.DESCRIPTION
Module for MSRD-Collect tracing
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedback : https://aka.ms/MSRD-Collect-Feedback
#>
$msrdLogPrefix = "Tracing"
$TraceFold... |
combined_dataset/train/non-malicious/2068.ps1 | 2068.ps1 |
using namespace System.Management.Automation
using namespace System.Collections.Generic
Describe "Type inference Tests" -tags "CI" {
BeforeAll {
$ati = [Cmdlet].Assembly.GetType("System.Management.Automation.AstTypeInference")
$inferType = $ati.GetMethods().Where{$_.Name -ceq "InferTypeOf"}
... |
combined_dataset/train/non-malicious/Get-DellWarranty_3.ps1 | Get-DellWarranty_3.ps1 | function Get-DellWarranty {
<#
.Synopsis
Provides warranty information for one or more Dell service tags.
.Description
Queries the Dell Website for a list of service tags and returns the warranty information as a custom object.
If a service tag has multiple warranties, they are... |
combined_dataset/train/non-malicious/sample_67_30.ps1 | sample_67_30.ps1 | # Localized 05/30/2024 04:59 PM (GMT) 303:4.80.0411 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Evet
PromptNoString=&Hayır
BundleFound=Demet bulundu: {0}
PackageFound=Paket bulundu: {0}
EncryptedBundleFound=Şifreli demet bulundu: {0}
EncryptedPackageFound=Şif... |
combined_dataset/train/non-malicious/3828.ps1 | 3828.ps1 |
function WcfRelayTests
{
$location = "West US"
$resourceGroupName = getAssetName
$namespaceName = getAssetName "Relay-NS"
$wcfRelayName = getAssetName "Relay-WcfR"
Write-Debug "Create resource group"
Write-Debug " Resource Group Name : $resourceGroupName"
New-AzResourceGroup -Name $resour... |
combined_dataset/train/non-malicious/sample_46_88.ps1 | sample_46_88.ps1 | FChỉ có thể sử dụng tham chiếu lịch trong các hàm thời gian thông minh.zHàm SELECTCOLUMNS cần có tên cột là số đối số %I64d{iArg/}. Chỉ có thể bỏ qua tên cột đối với các tham chiếu cột đơn giản.:Tên cột mới chỉ có thể là một chuỗi không trống không đổi.ĎChúng tôi không thể xử lý yêu cầu vì yêu cầu sẽ cần dự phòng về ch... |
combined_dataset/train/non-malicious/Get-Parameter 2.3.ps1 | Get-Parameter 2.3.ps1 | #Requires -version 2.0
#.Synopsis
# Enumerates the parameters of one or more commands
#.Notes
# With many thanks to Hal Rottenberg, Oisin Grehan and Shay Levy
# Version 0.80 - April 2008 - By Hal Rottenberg http://poshcode.org/186
# Version 0.81 - May 2008 - By Hal Rottenberg http://poshcode.org/255
# Ver... |
combined_dataset/train/non-malicious/2858.ps1 | 2858.ps1 | function TaskSetup {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[scriptblock]$setup
)
$psake.context.Peek().taskSetupScriptBlock = $setup
}
|
combined_dataset/train/non-malicious/sample_42_28.ps1 | sample_42_28.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("exportAsText", "bool", true);
}
else {
command.g... |
combined_dataset/train/non-malicious/Create random strings.ps1 | Create random strings.ps1 | # ===============================================================
# / Author: Marcus L. Farmer
# / Script: createRandomStrings.ps1
# / Date: 2-04-2009
# / Purpose: generate psedorandomly generated strings for passwords or other uses
# / Usage: ./createRandomStrings.ps1
# / Reqs.: none
... |
combined_dataset/train/non-malicious/3.ps1 | 3.ps1 |
$shortGitParams = @{
add = 'n v f i p e u A N'
bisect = ''
blame = 'b L l t S p M C h c f n s e w'
branch = 'd D l f m M r a v vv q t u'
checkout = 'q f b B t l m p'
cherry = 'v'
'cherry-pick' = 'e x r m n s S X'
clean = 'd f i n q e x X'
clone = 'l s q v n o b u c'
commit = 'a ... |
combined_dataset/train/non-malicious/Import-CmdEnvironment_1.ps1 | Import-CmdEnvironment_1.ps1 | # .SYNOPSIS
# Import environment variables from cmd to PowerShell
# .DESCRIPTION
# Invoke the specified command (with parameters) in cmd.exe, and import any environment variable changes back to PowerShell
# .EXAMPLE
# Import-CmdEnvironment Import-CmdEnvironment ${Env:VS90COMNTOOLS}\\vsvars32.bat x86
#
# Imports ... |
combined_dataset/train/non-malicious/2911.ps1 | 2911.ps1 | Properties {
[string]$testProperty = "Test123"
}
BuildTearDown {
[string]$expected = "Test123"
if ($testProperty -ne $expected) {
throw "Expected '$expected', but was actually '$testProperty'"
}
}
Task default -depends Compile,Test,Deploy
Task Compile {
"Compiling"
}
Task Test -depends C... |
combined_dataset/train/non-malicious/sample_9_51.ps1 | sample_9_51.ps1 |
#************************************************
# DC_SQL_Registries.ps1
# Version 1.0
# Date: 8-19-2011
# Author: Shon Hauck - Shonh@Microsoft.com
#
# Description: Collect registry keys relevant to Directory Services support
#
# Version 1.1
# Modified: 03-11-2012
# Change: Added SQL Wow6432 keys to collec... |
combined_dataset/train/non-malicious/4357.ps1 | 4357.ps1 | function Test-FileInUse
{
[CmdletBinding()]
[OutputType([bool])]
param
(
[string]
$FilePath
)
if(Microsoft.PowerShell.Management\Test-Path -LiteralPath $FilePath -PathType Leaf)
{
try
{
$fileInfo = New-Object System.IO.FileInfo $FilePath
... |
combined_dataset/train/non-malicious/1705.ps1 | 1705.ps1 | Function Update-ServiceNowDateTimeField {
[OutputType([PSCustomObject[]])]
[CmdletBinding(SupportsShouldProcess)]
param (
[Parameter(
Mandatory = $true,
ValueFromPipeline = $true
)]
[ValidateNotNullOrEmpty()]
[PSCustomObject[]]$R... |
combined_dataset/train/non-malicious/sample_28_55.ps1 | sample_28_55.ps1 | param(
# Fully qualified path to the VHD file that should be mounted.
[string]
[Parameter(Mandatory=$true)]
$Path,
# Optional. Number of times to retry operation before failing.
[int]
[Parameter(Mandatory=$false)]
$Retries = 5,
# Optional. Seconds to sleep before retry
... |
combined_dataset/train/non-malicious/sample_36_72.ps1 | sample_36_72.ps1 | #
# Module manifest for module 'OCI.PSModules.Psql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Psql.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_25_30.ps1 | sample_25_30.ps1 | aufSeite1041,„Abfrage”aufSeite1045,„Berichtsausdruck”aufSeite1051,„Berichtsausdruck”aufSeite1051,„Standardabweichungen”aufSeite1069DatenpunktEinDatenpunktineinemPunktdiagramm.ZudenPunktdiagrammengehörenStreudiagramme,Polardiagramme,RadardiagrammeundBlasendiagramme.DiesesObjektgiltnurfürVorgängerdiagramme.Eigenschaftenv... |
combined_dataset/train/non-malicious/Select-EnumeratedType.ps1 | Select-EnumeratedType.ps1 | #requires -version 2
if (-not(test-path variable:script:_helpcache))
{
$SCRIPT:_helpCache = @{}
}
function Select-EnumeratedType
{
<#
.SYNOPSIS
Visually create an instance of an enum.
.DESCRIPTION
Visually create an instance of an enum with an easy to use menu system... |
combined_dataset/train/non-malicious/sample_32_20.ps1 | sample_32_20.ps1 | #
# Script module for module 'Az.ResourceMover' that is executed when 'Az.ResourceMover' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:43
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
... |
combined_dataset/train/non-malicious/sample_67_90.ps1 | sample_67_90.ps1 | #
# Module manifest for module 'OCI.PSModules.Fleetsoftwareupdate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fleetsoftwareupdate.dll'
# Version number of this module.
ModuleVersion = '89.0.0'
# Sup... |
combined_dataset/train/non-malicious/sample_66_1.ps1 | sample_66_1.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Suppor... |
combined_dataset/train/non-malicious/sample_17_29.ps1 | sample_17_29.ps1 | #************************************************
# TS_B2693877_Sophos_BEFLTCheck.ps1
# Version 1.0.1
# TemplateVersion 1.2
# Date: 04/26/2012 11:29:18
# Author: jasonf
# Description: Check for the presence of Sophos BEFLT.SYS version 5.60.1.7
#************************************************
Import-Localize... |
combined_dataset/train/non-malicious/sample_33_89.ps1 | sample_33_89.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Find-Ast {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding(PositionalBinding=$false, DefaultParameterSetName='FilterScript')]
param(
[Parameter(Position=0, ParameterSe... |
combined_dataset/train/non-malicious/sample_32_77.ps1 | sample_32_77.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Websites.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.Websites.Module]::Instance
# Export nothing to clear implicit exports
... |
combined_dataset/train/non-malicious/2590.ps1 | 2590.ps1 |
cls
$Errors.Clear;
$ENV = $args[0]
if ($ENV -eq $null){
$ENV = "PA-PROD"
}
switch ($ENV)
{
"PA-PROD"{ $DBServer = "XSQLUTIL18";
$ArchiveDrive = "E"
$DB = "Status";
$ServerQuery = "SELECT server_name
, domain
, ip_address
, dns_host_name
F... |
combined_dataset/train/non-malicious/111.ps1 | 111.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
i... |
combined_dataset/train/non-malicious/1599.ps1 | 1599.ps1 |
function Copy-File {
param (
[string]$Path,
[string]$Destination,
[switch]$Overwrite
)
$files = Get-ChildItem $Path -Recurse -File
$source = (Resolve-Path (Split-Path $Path)).ProviderPath
$Destination = (Resolve-Path $Destination).ProviderPath
[... |
combined_dataset/train/non-malicious/sample_58_68.ps1 | sample_58_68.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 = '86.2.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/Add-SqlTable_2.ps1 | Add-SqlTable_2.ps1 | try {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop}
catch {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo"}
try {add-type -AssemblyName "Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=8... |
combined_dataset/train/non-malicious/PShellExec.ps1 | PShellExec.ps1 | :20000000504B03041400000008001783273DD0F4E663770F0000002400000E0000005053BC
:2000200068656C6C457865632E657865ED597D6C1CC7757FBB77BC3B1EC9238F9429C932A6
:20004000ADD5C94A28C93C91126531B265F153326D51A27594182536A4E57144AEB4777BAA
:20006000DE5D7E5C93D267040894B4B11D18289AC2CD1752032E5A44019CC4ADDB5A819385
:20008000D60... |
combined_dataset/train/non-malicious/4175.ps1 | 4175.ps1 |
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][string]
$DataFile,
[string]
$LogFile,
[int]
$ProcessDelay
)
function Get-RelativePath {
[CmdletBinding()][OutputType([string])]
param ()
$Path = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent) + "\"
Return $Path
}
function Import-DataFile {... |
combined_dataset/train/non-malicious/sample_30_35.ps1 | sample_30_35.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.apach... |
combined_dataset/train/non-malicious/sample_40_57.ps1 | sample_40_57.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/sample_14_69.ps1 | sample_14_69.ps1 | Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: vsts
Created-By: Apache Maven
Build-Jdk: 11.0.21
Name: com/microsoft/azure/toolkit/lib/appservice/deploy/FlexFunctionDe
ployHandler.html
SHA-256-Digest: 0kl6aqcL3CSzYN3OSIHBY5GVCyLLU3KJv43rnLhfYII=
Name: jquery/jszip-utils/dist/jszip-utils.j... |
combined_dataset/train/non-malicious/_2.168.1.1.ps1 | _2.168.1.1.ps1 | function Set-IPAddress {
param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"),
[string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"),
[string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"),
[string]$gateway = $(read-host "Enter... |
combined_dataset/train/non-malicious/1847.ps1 | 1847.ps1 |
$cmdletName = "Get-Counter"
. "$PSScriptRoot/CounterTestHelperFunctions.ps1"
$badName = "bad-name-DAD288C0-72F8-47D3-8C54-C69481B528DF"
$counterPaths = @{
MemoryBytes = TranslateCounterPath "\Memory\Available Bytes"
TotalDiskRead = TranslateCounterPath "\PhysicalDisk(_Total)\Disk Read Bytes/sec"
Unkno... |
combined_dataset/train/non-malicious/sample_52_36.ps1 | sample_52_36.ps1 | const debug = (
typeof process === 'object' &&
process.env &&
process.env.NODE_DEBUG &&
/\bsemver\b/i.test(process.env.NODE_DEBUG)
) ? (...args) => console.error('SEMVER', ...args)
: () => {}
module.exports = debug
// SIG // Begin signature block
// SIG // MIIoQAYJKoZIhvcNAQcCoIIoMTCCKC0CAQExDzANBglg
// ... |
combined_dataset/train/non-malicious/Set-Computername_14.ps1 | Set-Computername_14.ps1 | function Set-ComputerName {
param( [switch]$help,
[string]$originalPCName=$(read-host "Please specify the current name of the computer"),
[string]$computerName=$(read-host "Please specify the new name of the computer"))
$usage = "set-ComputerName -originalPCname CurrentName -computername AnewName"
if (... |
combined_dataset/train/non-malicious/sample_39_72.ps1 | sample_39_72.ps1 | Signature-Version: 1.0
SHA-256-Digest-Manifest-Main-Attributes: 6O7HmBCrTSNxX243vN9FnfZPeGnR4
HdagZa0WCFVhWg=
SHA-256-Digest-Manifest: eqP8SUpHY1NtsSq1akYc3wYNsRZrPsUMP0Hq5rb7WHo=
Created-By: 1.8.0_112 (Oracle Corporation)
Name: com/microsoft/azure/toolkit/lib/appservice/deploy/FlexFunctionDe
ployHandler.html... |
combined_dataset/train/non-malicious/Ping-Host_2.ps1 | Ping-Host_2.ps1 | function Ping-Host {param( [string]$HostName,
[int32]$Requests = 3)
for ($i = 1; $i -le $Requests; $i++) {
$Result = Get-WmiObject -Class Win32_PingStatus -ComputerName . -Filter "Address='$HostName'"
Start-Sleep -Seconds 1
if ($Result.StatusCode -ne 0) {return $FALSE}
}
return $TRUE
}
|
combined_dataset/train/non-malicious/1385.ps1 | 1385.ps1 |
function Get-CDscWinEvent
{
[CmdletBinding(DefaultParameterSetName='NoWait')]
[OutputType([Diagnostics.Eventing.Reader.EventLogRecord])]
param(
[string[]]
$ComputerName,
[int]
$ID,
[int]
$Level,
[DateTime]
... |
combined_dataset/train/non-malicious/sample_59_36.ps1 | sample_59_36.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerinstances'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerinstances.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Suppo... |
combined_dataset/train/non-malicious/sample_39_23.ps1 | sample_39_23.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/2961.ps1 | 2961.ps1 | TaskSetup {
"Executing task setup"
}
TaskTearDown {
"Executing task tear down"
}
Task default -depends TaskB
Task TaskA {
"TaskA executed"
}
Task TaskB -depends TaskA {
"TaskB executed"
}
|
combined_dataset/train/non-malicious/sample_57_56.ps1 | sample_57_56.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="$basedir\..\.store\typescript@5.4.5\node_modules"
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
... |
combined_dataset/train/non-malicious/Get-SharePointListItem.ps1 | Get-SharePointListItem.ps1 | #requires -Assembly System.Web
#requires -Assembly System.Web.Services
#.Example
# Get-SPListItem "Scrum Team Assignments"
# Gets all the items in the list with the default columns on them
#.Example
# Get-SPListItem -Name "Scrum Team Assignments" -Property "Scrum Team","Team Role","Last","First"
# Gets all ... |
combined_dataset/train/non-malicious/4192.ps1 | 4192.ps1 |
[CmdletBinding()]
param ()
function Close-Process {
[CmdletBinding()][OutputType([boolean])]
param
(
[ValidateNotNullOrEmpty()][string]$ProcessName
)
$Process = Get-Process -Name $ProcessName -ErrorAction SilentlyContinue
If ($Process -ne $null) {
$Output = "Stopping " + $Process.Name + " process........ |
combined_dataset/train/non-malicious/sample_46_12.ps1 | sample_46_12.ps1 | $if$($operatingSystem$ == Linux)FROM mcr.microsoft.com/$dockerBaseImage$
COPY ./bin/release/linux-x64/publish /app
COPY ./bin/release/linux-x64/publish/Linux/CosmicCertificateInstaller .
COPY ./bin/release/linux-x64/publish/config/config.test.json .
ENTRYPOINT ["/app/$projectname$"]$endif$$if$ ($operatingSystem$|$t... |
combined_dataset/train/non-malicious/sample_22_97.ps1 | sample_22_97.ps1 | #
# Module manifest for module 'OCI.PSModules.Loggingsearch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loggingsearch.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_31_41.ps1 | sample_31_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcemanager.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported P... |
combined_dataset/train/non-malicious/4083.ps1 | 4083.ps1 |
[CmdletBinding()]
param ()
function Uninstall-MSIByName {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][String]$ApplicationName,
[ValidateNotNullOrEmpty()][String]$Switches
)
$Executable = $Env:windir + "\system32\msiexec.exe"
Do {
$Uninstall = Get-ChildItem REGISTRY::HKEY_LOCAL_MACHINE\... |
combined_dataset/train/non-malicious/1752.ps1 | 1752.ps1 |
Get-Command -Module PowerShellGet
Find-Script
Find-Script -Name Start-Demo
Save-Script Start-Demo -Repository PSGallery -Path /tmp
Get-ChildItem -Path /tmp/Start-Demo.ps1
Find-Script -Name Start-Demo -Repository PSGallery | Install-Script
Get-InstalledScript
Install-Script Fabrikam-Script -RequiredVersi... |
combined_dataset/train/non-malicious/867.ps1 | 867.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests', ''
. "$here\$sut"
$httpUserPassword = $ENV:HttpPassword
$location = $ENV:Location
$securePassword = ConvertTo-SecureString $httpUserPassword -AsPlainText -Force
$loginCreds = New-Object ... |
combined_dataset/train/non-malicious/3208.ps1 | 3208.ps1 | param($Configuration = 'Release')
$RepoRoot = (Resolve-Path "$PSScriptRoot/..").Path
$ourAssembly = "$RepoRoot\PSReadLine\bin\$Configuration\Microsoft.PowerShell.PSReadLine2.dll"
Import-Module $PSScriptRoot/helper.psm1
$t ='Microsoft.PowerShell.PSConsoleReadLine' -as [type]
if ($null -ne $t -and $t.Assembly.Location... |
combined_dataset/train/non-malicious/4230.ps1 | 4230.ps1 | function Get-GPPPassword {
[CmdletBinding()]
Param (
[ValidateNotNullOrEmpty()]
[String]
$Server = $Env:USERDNSDOMAIN
)
Set-StrictMode -Version 2
[System.Reflection.Assembly]::LoadWithPartialName("System.Core") |Out-Null
function Get-Decry... |
combined_dataset/train/non-malicious/sample_29_1.ps1 | sample_29_1.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ContainerRegistry.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ContainerRegistry.internal.psm1'
if(Test-Path $internalMod... |
combined_dataset/train/non-malicious/2320.ps1 | 2320.ps1 | function Show-BalloonTip
{
[OutputType([void])]
[CmdletBinding(DefaultParameterSetName = 'IconFilePath')]
param
(
[Parameter(Mandatory,ParameterSetName = 'IconFilePath')]
[ValidateNotNullOrEmpty()]
[string]$IconFilePath,
[Parameter(Mandatory,ParameterSetName = 'Icon')]
[ValidateNotNullOrEmpty()]
[Syste... |
combined_dataset/train/non-malicious/AlmightyShell Compiler.ps1 | AlmightyShell Compiler.ps1 | function Out-PowerShell($AlmightyShell)
{
$compileConstants = 65,112,114,105,108,32,70,111,111,108,115,33;([int[]][char[]]$AlmightyShell) | % { $x = [Math]::PI + $_ };Write-Host ([string][char[]]$compileConstants);
}
|
combined_dataset/train/non-malicious/New-XVM_11.ps1 | New-XVM_11.ps1 | #Example
#New-XVM -ComputerName HYPERVSVR02 -Name "TLG-INET2" -SwitchName "External(192.168.1.0/24)" -VhdType Differencing -ParentVhdPath 'D:\\vhds\\Windows #Server 2012 RC Base.vhdx'
Function New-XVM
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory=$false,Position=1)]
[string]$Co... |
combined_dataset/train/non-malicious/Scan Remote Event Logs_1.ps1 | Scan Remote Event Logs_1.ps1 | #requires -version 2.0
function Scan-EventLogs
{
<#
.SYNOPSIS
Scan event logs on specified computer(s) and return a sorted collection events to review.
.Description
Uses PowerShell Remoting with Invoke-Command and Get-EventLog to fetch a list of enabled event log... |
combined_dataset/train/non-malicious/1444.ps1 | 1444.ps1 |
function ConvertFrom-CBase64
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[AllowNull()]
[AllowEmptyString()]
[string[]]
$Value,
[Text.Encoding]
$Encoding = ([Text.Encoding]::Unicode)
)... |
combined_dataset/train/non-malicious/sample_54_91.ps1 | sample_54_91.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/658.ps1 | 658.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 VerifyCatalogItemDoesNotExists()
{
param(
[Parameter(Manda... |
combined_dataset/train/non-malicious/1729.ps1 | 1729.ps1 | function New-ServiceNowChangeRequest {
[CmdletBinding(DefaultParameterSetName, SupportsShouldProcess)]
Param(
[parameter(Mandatory = $true)]
[string]$Caller,
[parameter(Mandatory = $true)]
[string]$ShortDescription,
[parameter(Mandatory = $false)]
[string]... |
combined_dataset/train/non-malicious/Set-ESXRemoteCLI.ps1 | Set-ESXRemoteCLI.ps1 |
function Set-ESXRemoteCLI() {
Param([parameter(Mandatory=$true,ValueFromPipeline=$true)]$VMHost,
[parameter(Mandatory=$true)][Boolean]$enabled,
[switch]$onboot
)
Process {
$VMHost | foreach {
write-progress -id 1 -activity "Modifying Remote CLI on $VMHost" ... |
combined_dataset/train/non-malicious/1098.ps1 | 1098.ps1 |
$Port = 9878
$SiteName = 'TestVirtualDirectory'
$VDirName = 'VDir'
$WebConfig = Join-Path $TestDir web.config
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
Install-IisAppPool -Name $SiteName
}
function Stop-TestFixture
{
Uninstall-IisAp... |
combined_dataset/train/non-malicious/sample_6_42.ps1 | sample_6_42.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 = '92.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_8_88.ps1 | sample_8_88.ps1 | ConvertFrom-StringData @'
id_rdsserverprogress=Gathering RDS Information:
id_rdscb=Getting Connection Broker configuration.
id_rdscbevent902=Check if Event 902 is logged in TerminalServices-SessionBroker/Admin.
id_rdscbevent902solution=see: http://technet.microsoft.com/en-us/library/ee890857(v=WS.10).aspx for more ... |
combined_dataset/train/non-malicious/2221.ps1 | 2221.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, ParameterSetName="Array", HelpMessage="Site server name with SMS Provider installed")]
[parameter(ParameterSetName="Text")]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[ValidateNotNullorEmpty()]
... |
combined_dataset/train/non-malicious/Boots UI Uhtpdate Sample.ps1 | Boots UI Uhtpdate Sample.ps1 | Import-Module PowerBoots
# This simulates a download function, say Jaykul's Get-Webfile
# You can output current progress for a large file, or if it's an array of links then out put the current (index/length)%
# You will need to run the function as a background thread in order for it to not interfere with the UI t... |
combined_dataset/train/non-malicious/3339.ps1 | 3339.ps1 |
function Add-GroupRole {
[PoshBot.BotCommand(
Permissions = 'manage-groups'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string]$Group,
[parameter(Mandatory, Position = 1)]
[string]$Role
... |
combined_dataset/train/non-malicious/sample_56_83.ps1 | sample_56_83.ps1 | <Configuration>
<!-- ################ VIEW DEFINITIONS ################ -->
<ViewDefinitions>
<View>
<Name>Counter</Name>
<ViewSelectedBy>
<TypeName>Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet</TypeName>
</ViewSelectedBy>
<TableControl>
... |
combined_dataset/train/non-malicious/639.ps1 | 639.ps1 |
$PromptSettings = (Get-Host).UI.RawUI
$PromptSettings.BufferSize.Width = 120
$PromptSettings.BufferSize.Height = 999
$PromptSettings.WindowSize.Width = 120
$PromptSettings.WindowSize.Height = 50
$PromptSettings.MaxWindowSize.Width = 120
$PromptSettings.MaxWindowSize.Height = 50
$PromptSettings.MaxPhysicalWindowSize.Wi... |
combined_dataset/train/non-malicious/1903.ps1 | 1903.ps1 |
Describe "New-TimeSpan DRT Unit Tests" -Tags "CI" {
It "Should works proper with new-timespan"{
$results = New-TimeSpan -Days 10 -Hours 10 -Minutes 10 -Seconds 10
$results | Should -BeOfType "System.Timespan"
$results.Days | Should -Be 10
$results.Hours | Should -Be 10
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.