full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_64_3.ps1 | sample_64_3.ps1 | @{
GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Start-Transcript", "Stop-Transcript"
AliasesTo... |
combined_dataset/train/non-malicious/779.ps1 | 779.ps1 |
$peekBuf = $null
$currentLineNum = 0
$logEntryIndex = 0
function Parse-PsesLog {
param(
[Parameter(Mandatory=$true, Position=0)]
[Alias("PSPath")]
[ValidateNotNullOrEmpty()]
[string]
$Path,
[Parameter()]
[switch]
$OldLogFormat,
... |
combined_dataset/train/non-malicious/new-pshash.ps1 | new-pshash.ps1 | #this function takes nested hashtables and converts them to nested pscustomobjects
#it can also contain arrays of hashtables, and it will turn those hashtables in the arrays
#also into PScustomobjects
function new-pshash
{
[CmdletBinding()]
PARAM(
[parameter(valuefromPipeline=$true,Mandatory=$true, position = 1... |
combined_dataset/train/non-malicious/sample_20_9.ps1 | sample_20_9.ps1 | # Localized 06/28/2023 07:56 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Résolution des problèmes
Troubleshoot_DetectNetworkCache=Vérification du cache réseau du Lecteur multimédia Windows...
Resolution_Title=Résolution
Resolution_ResetConfiguration=Rétab... |
combined_dataset/train/non-malicious/AD FSMO Roles.ps1 | AD FSMO Roles.ps1 | function Get-FSMORole {
<#
.SYNOPSIS
Retrieves the FSMO role holders from one or more Active Directory domains and forests.
.DESCRIPTION
Get-FSMORole uses the Get-ADDomain and Get-ADForest Active Directory cmdlets to determine
which domain controller currently holds each of the Active Directory FSMO roles.
.PARA... |
combined_dataset/train/non-malicious/ff51eafa-111d-4023-b84d-e6e62b361e34.ps1 | ff51eafa-111d-4023-b84d-e6e62b361e34.ps1 | @@ Get-VIServer YOURSERVER
$Excel = New-Object -Com Excel.Application
$Excel.visible = $True
$Excel = $Excel.Workbooks.Add()
$Addsheet = $Excel.sheets.Add()
$Sheet = $Excel.WorkSheets.Item(1)
$Sheet.Cells.Item(1,1) = "Name"
$Sheet.Cells.Item(1,2) = "Power State"
$Sheet.Cells.Item(1,3) = "Description"
$Sheet.... |
combined_dataset/train/non-malicious/1992.ps1 | 1992.ps1 |
$ProgressPreference = "SilentlyContinue"
$RepositoryName = 'INTGallery'
$SourceLocation = 'https://www.poshtestgallery.com'
$RegisteredINTRepo = $false
$ContosoServer = 'ContosoServer'
$FabrikamServerScript = 'Fabrikam-ServerScript'
$Initialized = $false
function IsInbox { $PSHOME.EndsWith('\WindowsPowerShell\v... |
combined_dataset/train/non-malicious/sample_35_65.ps1 | sample_35_65.ps1 | #
# Module manifest for module 'ExtensionService'
#
# Generated by: Microsoft
#
# Generated on: 04/09/2020
#
@{
# Script module or binary module file associated with this manifest.
ModuleToProcess = 'ExtensionService.psm1'
# Version number of this module.
ModuleVersion = '1.0'
# ID used to uniquely ... |
combined_dataset/train/non-malicious/3786.ps1 | 3786.ps1 | Param(
[Parameter(Mandatory = $true,
HelpMessage="Name of the resource group to which the KeyVault belongs to. A new resource group with this name will be created if one doesn't exist")]
[ValidateNotNullOrEmpty()]
[string]$resourceGroupName,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrE... |
combined_dataset/train/non-malicious/Install-Module.ps1 | Install-Module.ps1 | function Install-Module {
[CmdletBinding()]
Param(
[Parameter(ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Mandatory=$true)]
[Alias("PSPath")]
[String]$ModuleFilePath
, [Switch]$Global
)
## Get the Full Path of the module file
$ModuleFilePath = Resolve-Path $ModuleFilePat... |
combined_dataset/train/non-malicious/4300.ps1 | 4300.ps1 |
function SuiteSetup {
Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue
Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue
$script:ProgramFilesScriptsPath = Get-AllUsersScriptsPath
$script:MyDocumentsScriptsPath = Get-CurrentUserScriptsPath
... |
combined_dataset/train/non-malicious/VCenter Reporting.ps1 | VCenter Reporting.ps1 | <# .SYNOPSIS
Collects statistics and settings for Hosts, Datastores, and Virtual Machines
from multiple VCenters.
.DESCRIPTION
Creates Excel spreadsheet report with separate worksheets for Hosts, Datastores, and
Virtual Machines by VCenter.
.PARAMETER
none
.INPUTS
.OU... |
combined_dataset/train/non-malicious/4179.ps1 | 4179.ps1 |
Function GetRelativePath{
Set-Variable -Name RelativePath -Scope Local -Force
$RelativePath = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\"
Return $RelativePath
Remove-Variable -Name RelativePath -Scope Local -Force
}
Function GenerateGUID {
Set-Variable -Name GetGUID -Scope Loca... |
combined_dataset/train/non-malicious/sample_39_3.ps1 | sample_39_3.ps1 | @{
GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Get-WinEvent", "New-WinEvent", "Get-C... |
combined_dataset/train/non-malicious/sample_48_83.ps1 | sample_48_83.ps1 | #
# Module manifest for module 'Az.DataShare'
#
# Generated by: Microsoft Corporation
#
# Generated on: 5/16/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.DataShare.psm1'
# Version number of this module.
ModuleVersion = '1.0.2'
# Supported PSEditions... |
combined_dataset/train/non-malicious/sample_8_18.ps1 | sample_8_18.ps1 | ConvertFrom-StringData @'
id_ctsbitsclient=BITS Client Component
id_ctsbitsclientdescription=Collects information about the BITS client component.
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNL... |
combined_dataset/train/non-malicious/1213.ps1 | 1213.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'System.Diagnostics.Process' {
It 'processes have ParentProcessID' {
$parents = @{}
Get-WmiObject Win32_Process |
ForEach-Object { $parents[$_.ProcessID] = $_.ParentProcessID }
... |
combined_dataset/train/non-malicious/sample_53_5.ps1 | sample_53_5.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ActionGroup.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ActionGroup.internal.psm1'
if(Test-Path $internalModulePath) {
... |
combined_dataset/train/non-malicious/sample_59_2.ps1 | sample_59_2.ps1 | #
# Module manifest for module 'OCI.PSModules.Osuborganizationsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll'
# Version number of this module.
ModuleVersion... |
combined_dataset/train/non-malicious/Get-VMCreationReport.ps1 | Get-VMCreationReport.ps1 | # Report VMs created per month.
# Before you begin run Alan's "Who Created that VM?" script.
# http://www.virtu-al.net/2010/02/23/who-created-that-vm/
function Get-VMCreationReport {
Get-VM | Group {
if ($_.CustomFields["CreatedOn"] -as [DateTime] -ne $null) {
"{0:Y}" -f [DateTime]$_.CustomFields["CreatedOn... |
combined_dataset/train/non-malicious/sample_32_92.ps1 | sample_32_92.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias'... |
combined_dataset/train/non-malicious/sample_34_24.ps1 | sample_34_24.ps1 | #
# Module manifest for module 'Microsoft.SME.RemoteDesktop'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.RemoteDesktop.psm1'
# Version number of this module.
ModuleVersion = '4.15.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID us... |
combined_dataset/train/non-malicious/Get-Constructor_2.ps1 | Get-Constructor_2.ps1 | function Get-Constructor {
PARAM( [Type]$type )
$type.GetConstructors() |
Format-Table @{
l="$($type.Name) Constructors"
e={ "New-Object $($type.FullName) $(($_.GetParameters() | ForEach { "[{0}] `${1}" -f $($_.ToString() -split " ") }) -Join ", ")" }
}
}
Set-Alias gctor Get-Constructor
|
combined_dataset/train/non-malicious/3755.ps1 | 3755.ps1 |
$WEBSERVICE_DEFINITION_FILE_PROD = 'TestData\GraphWebServiceDefinition_Prod.json'
$WEBSERVICE_DEFINITION_FILE_DOGFOOD = 'TestData\GraphWebServiceDefinition_Dogfoood.json'
$TEST_WEBSERVICE_DEFINITION_FILE = $WEBSERVICE_DEFINITION_FILE_PROD
function Test-CreateGetRemoveMLService
{
$service... |
combined_dataset/train/non-malicious/711.ps1 | 711.ps1 |
function Write-RsRestFolderContent
{
[CmdletBinding()]
param(
[Parameter(Mandatory = $True, ValueFromPipeline = $true)]
[string[]]
$Path,
[switch]
$Recurse,
[Parameter(Mandatory = $True)]
[string]
$RsFolder,
[Alias('Override')]
... |
combined_dataset/train/non-malicious/789.ps1 | 789.ps1 |
function Set-ScriptExtent {
[CmdletBinding(PositionalBinding=$false, DefaultParameterSetName='__AllParameterSets')]
param(
[Parameter(Position=0, Mandatory)]
[psobject]
$Text,
[Parameter(Mandatory, ParameterSetName='AsString')]
[switch]
$AsString,
... |
combined_dataset/train/non-malicious/1108.ps1 | 1108.ps1 |
$siteName = 'UnlockIisConfigSection'
$windowsAuthWasLocked = $false
$windowsAuthConfigPath = 'system.webServer/security/authentication/windowsAuthentication'
$cgiConfigPath = 'system.webServer/cgi'
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
... |
combined_dataset/train/non-malicious/1361.ps1 | 1361.ps1 |
function Test-CAdminPrivilege
{
[CmdletBinding()]
param(
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
Write-Debug -Message "Checking if current use... |
combined_dataset/train/non-malicious/sample_64_97.ps1 | sample_64_97.ps1 | <##############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
##############################################################>... |
combined_dataset/train/non-malicious/sample_32_15.ps1 | sample_32_15.ps1 | 16 / 31 [MS-3DMDTP] - v20240416 Data Visualization: 3-D Map Data Tour File Format Copyright © 2024 Microsoft Corporation Release: April 16, 2024 A9uwGUkc+qLzIpH6gfQNoPACLRjva+ycdkSLDpi2OISBlQe8XU9cmkfIFyyElfBNX1rzOqXYzswLiyGDOfICZUIFi+8KFNEGiIRB4kggCU+YLIAJKmvoKgtF/mtydNn0yEhF9EQKPJVINUMjWpj4ZTvn/NQNflQ3UFvw5tY+QOzSdzW... |
combined_dataset/train/non-malicious/sample_61_93.ps1 | sample_61_93.ps1 | #
# Module manifest for module 'OCI.PSModules.Emwarehouse'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emwarehouse.dll'
# Version number of this module.
ModuleVersion = '88.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_6_13.ps1 | sample_6_13.ps1 | #************************************************
# TS_HPWMICheck.ps1
# Version 1
# Date: 5-6-15
# Author: jasonf
# Description: check to see if HP WMI provider causes autorecover regkey corruption
#************************************************
Import-LocalizedData -BindingVariable ScriptStrings
$RuleAp... |
combined_dataset/train/non-malicious/1292.ps1 | 1292.ps1 |
function Enable-CIEActivationPermission
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
$sddlForIe = "O:BAG:BAD:(A;;CCDCSW;;;SY)(A;;CCDCLCSWRP;;;BA)(A;;CCDCSW;;;IU)(... |
combined_dataset/train/non-malicious/sample_9_19.ps1 | sample_9_19.ps1 | #************************************************
# DC_AppxCollect.ps1
# Version 1.1
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects AppX additional information.
# Called from: TS_AutoAddCommands_Apps.ps1
#*******************************************************
Trap [Ex... |
combined_dataset/train/non-malicious/sample_1_87.ps1 | sample_1_87.ps1 | #************************************************
# DC_Ex_ExBPAcmd.ps1
# Version 1.0.0
# Date: 04-27-2012
# Author: Brian Prince - brianpr@microsoft.com
# Description: This script runs ExBPAcmd.exe to generate health check for Organization, Administrative Group and local Exchange 2007 or 2010 Server.
#***********... |
combined_dataset/train/non-malicious/sample_3_65.ps1 | sample_3_65.ps1 | . ./utils_cts.ps1
SkipSecondExecution
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBpBM1pLw62hhop
# ehOlxUIjRqhNjsumpSDgpF4eaEfLiKCCDXYwggX0M... |
combined_dataset/train/non-malicious/sample_37_96.ps1 | sample_37_96.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/214.ps1 | 214.ps1 | Function Remove-HashTableEmptyValue
{
[CmdletBinding()]
PARAM([System.Collections.Hashtable]$HashTable)
$HashTable.GetEnumerator().name |
ForEach-Object -Process {
if($HashTable[$_] -eq "" -or $HashTable[$_] -eq $null)
{
Write-Verbose -Message "[Remove-HashT... |
combined_dataset/train/non-malicious/sample_46_3.ps1 | sample_46_3.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... |
combined_dataset/train/non-malicious/sample_13_74.ps1 | sample_13_74.ps1 | ConvertFrom-StringData @'
id_tcpipsettingscheck=Checking for KB 967224
id_tcpipsettingscheckdesc=Checking for modified TcpIp Reg Parameters
'@
# SIG # Begin signature block
# MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX... |
combined_dataset/train/non-malicious/VMtoolsUpgrade_1.ps1 | VMtoolsUpgrade_1.ps1 | #####################################################################
# TIAA-CREF VMWare Standard Scripts - PowerCLI
#
# Purpose: "Check and upgrade Tools during power cycling"
# Author: David Chung
# Support: IT Infrastructure
# Docs: N/A
#
# Instruction: 1. Create CSV file with list of servers
# ... |
combined_dataset/train/non-malicious/2182.ps1 | 2182.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[ValidateNotNullOrEmpty()]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMessag... |
combined_dataset/train/non-malicious/sample_15_80.ps1 | sample_15_80.ps1 | #
# Module manifest for module 'OCI.PSModules.Loganalytics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loganalytics.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/1695.ps1 | 1695.ps1 |
filter sortprop {
$obj = $_
$props = $obj | gm -m *property | % {$_.name} | sort
$obj | select $props
}
|
combined_dataset/train/non-malicious/527.ps1 | 527.ps1 |
function Import-PPSPWeb{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[String]
$Url,
[Parameter(Mandatory=$true)]
[String]
$Path,
[Parameter(Mandatory=$false)]
[String]
$Template = "STS
[Switch]
$NoFileCompression
)
... |
combined_dataset/train/non-malicious/43a28a15-5023-4feb-a71f-abe95aa0f2a6.ps1 | 43a28a15-5023-4feb-a71f-abe95aa0f2a6.ps1 | param
(
[Parameter(
Mandatory=$true,
Position = 0,
ValueFromPipeline=$true,
HelpMessage="Specifies the path to the IIS *.log file to import. You can also pipe a path to Import-Iss-Log."
)]
[ValidateNotNullOrEmpty()]
[string]
$Path,
[Parameter(
Position = 1,
HelpMessage="Specifies the d... |
combined_dataset/train/non-malicious/772.ps1 | 772.ps1 |
$releasePath = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\release")
$finalPackagePath = [System.IO.Path]::GetFullPath("$releasePath\FinalPackages")
$nugetPath = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\.nuget\NuGet.exe")
$packages = Get-ChildItem $finalPackagePath -Filter "*.nupkg"
foreach ($package in $... |
combined_dataset/train/non-malicious/Hack ESX MOTD.ps1 | Hack ESX MOTD.ps1 | $screen = @"
You see here a virtual switch. ------------ ------
#...........| |....|
--------------- ###------------ |...(|
|..%...........|########## ###-@...|
... |
combined_dataset/train/non-malicious/sample_18_2.ps1 | sample_18_2.ps1 | #************************************************
# DC_ClusterResourcesProperties.ps1
# Version 1.1.1
# Date: 11-22-2011
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script writes cluster resources properties
# on a text file called COMPUTERNAME_ClusterProperties.txt
#*******... |
combined_dataset/train/non-malicious/sample_54_29.ps1 | sample_54_29.ps1 | #
# Module manifest for module 'OCI.PSModules.Tenantmanagercontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Tenantmanagercontrolplane.dll'
# Version number of this module.
ModuleVersion = '85... |
combined_dataset/train/non-malicious/sample_28_90.ps1 | sample_28_90.ps1 |
///////////////////////////////////////////////////////////////////////////////
// Helper to set a designer prop
///////////////////////////////////////////////////////////////////////////////
function setDesignerProp(tname, ttype, tvalue) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)... |
combined_dataset/train/non-malicious/Invoke-Member.ps1 | Invoke-Member.ps1 | ##############################################################################\n##\n## Invoke-Member\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nEnables ea... |
combined_dataset/train/non-malicious/Print Cluster Comparison.ps1 | Print Cluster Comparison.ps1 | <#################################################################
# Print Cluster - Printer Comparison #
# #
# This script does a comparison between two print clusters and #
# looks for differences between the source and dest... |
combined_dataset/train/non-malicious/Force 64 bit for script.ps1 | Force 64 bit for script.ps1 | # am I running in 32 bit shell?
if ($pshome -like "*syswow64*") {
write-warning "Restarting script under 64 bit powershell"
# relaunch this script under 64 bit shell
# if you want powershell 2.0, add -version 2 *before* -file parameter
& (join-path ($pshome -replace "syswow64", "sysnative") powershell.exe... |
combined_dataset/train/non-malicious/879.ps1 | 879.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/2273.ps1 | 2273.ps1 |
function Validate-OS {
$ProductType = Get-WmiObject -Namespace "Root\CIMV2" -Class Win32_OperatingSystem | Select-Object -ExpandProperty ProductType
if ($ProductType -eq 3) {
Load-Form
}
else {
if ($ProductType -eq 2) {
$ShellObject = New-Object -ComObject Wscript.Shell
$PopupValid... |
combined_dataset/train/non-malicious/Get-ChildItemRecurse_1.ps1 | Get-ChildItemRecurse_1.ps1 | function Get-ChildItemRecurse {
<#
.Synopsis
Does a recursive search through a PSDrive up to n levels.
.Description
Does a recursive directory search, allowing the user to specify the number of
levels to search.
.Parameter path
The starting path.
.Parameter fileglob
(optional) the search string for ... |
combined_dataset/train/non-malicious/sample_39_84.ps1 | sample_39_84.ps1 | #
# Module manifest for module 'OCI.PSModules.Events'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Events.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/IniFile Functions _1.0.ps1 | IniFile Functions _1.0.ps1 | function Get-IniSection($inifile,$section)
{
$sections = select-string "^\\[.*\\]" $inifile
if(!$section) {
return $sections | %{$_.Line.Trim("[]")}
}
$start = 0
switch($sections){
{$_.Line.Trim() -eq "[$section]"}{
$start = $_.LineNumber -1
}
defaul... |
combined_dataset/train/non-malicious/sample_10_65.ps1 | sample_10_65.ps1 | image: mcr.microsoft.com/dotnet/sdk:8.0
definitions:
steps:
- step: &build
name: Build
runs-on:
- 'self.hosted'
- 'windows'
artifacts:
- src/function-app/publish.zip
script:
- cd ./src/function-app
- dotnet nuget loca... |
combined_dataset/train/non-malicious/2448.ps1 | 2448.ps1 | Configuration PullMode {
param (
[string]$Computername,
[string]$Guid
)
Node $Computername {
LocalConfigurationManager {
ConfigurationMode = 'ApplyOnly'
ConfigurationID = $Guid
RefreshMode = 'Pull'
DownloadManagerName = 'WebDownloadMana... |
combined_dataset/train/non-malicious/2645.ps1 | 2645.ps1 | function Export-SQLDacPacs{
param([string[]] $Instances = 'localhost',
[string] $outputdirectory=([Environment]::GetFolderPath("MyDocuments"))
)
$sqlpackage = (get-childitem C:\ -Recurse | Where-Object {$_.name -eq 'sqlpackage.exe'} |Sort-Object LastWriteTime | Select-Object -First 1).... |
combined_dataset/train/non-malicious/sample_21_76.ps1 | sample_21_76.ps1 | @{
GUID="766204A6-330E-4263-A7AB-46C87AFC366C"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManC... |
combined_dataset/train/non-malicious/Invoke-BinaryProcess.ps1 | Invoke-BinaryProcess.ps1 | ##############################################################################\n##\n## Invoke-BinaryProcess\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nInv... |
combined_dataset/train/non-malicious/sample_4_88.ps1 | sample_4_88.ps1 | #************************************************
# TS_PrintingHPTCPMonCheck.ps1
# Version 1.0.1
# Date: 1-19-2012
# Author: v-anecho
# Description: One or more network stored PST files were detected on this machine
#************************************************
Import-LocalizedData -BindingVariable Script... |
combined_dataset/train/non-malicious/3285.ps1 | 3285.ps1 |
class TeamsBackend : Backend {
[bool]$LazyLoadUsers = $true
[string[]]$MessageTypes = @(
'message'
)
[string]$TeamId = $null
[string]$ServiceUrl = $null
[string]$BotId = $null
[string]$BotName = $null
[string]$TenantId = $null
[hashtable]$DMConver... |
combined_dataset/train/non-malicious/Fast vMotion with GUI.ps1 | Fast vMotion with GUI.ps1 | #Generated Form Function
function GenerateForm {
########################################################################
# Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) v1.0.3.0
# Generated On: 7/21/2009 2:07 PM
# Generated By: afokkema
###################################################... |
combined_dataset/train/non-malicious/18.ps1 | 18.ps1 | . $PSScriptRoot\Shared.ps1
Describe 'TabExpansion function test' {
BeforeAll {
if ($PSVersionTable.PSVersion.Major -gt 5) {
$PSDefaultParameterValues["it:skip"] = $true
}
}
It 'Windows PowerShell v5 exports a TabExpansion function' {
$module.ExportedFunctions.Keys -conta... |
combined_dataset/train/non-malicious/sample_53_10.ps1 | sample_53_10.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_19_0.ps1 | sample_19_0.ps1 | # Copyright ?2010, Microsoft Corporation. All rights reserved.
# You may use this code and information and create derivative works of it,
# provided that the following conditions are met:
# 1. This code and information and any derivative works may only be used for
# troubleshooting a) Windows and b) products for ... |
combined_dataset/train/non-malicious/3443.ps1 | 3443.ps1 |
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True, Position=0)]
[String]$BuildArtifactsPath,
[Parameter(Mandatory=$True, Position=1)]
[String]$PSVersion,
[Parameter(Mandatory=$True, Position=2)]
[String]$CodePlexUsername,
[Parameter(Mandatory=$True, Position=3)]
[String]$CodePlexFork... |
combined_dataset/train/non-malicious/sample_13_52.ps1 | sample_13_52.ps1 | trap [Exception]
{
WriteTo-ErrorDebugReport -ErrorRecord $_
continue
}
If (!$Is_SiteServer) {
TraceOut "ConfigMgr Site Server not detected. This script gathers data only from a Site Server. Exiting."
exit 0
}
TraceOut "Started"
Import-LocalizedData -BindingVariable ScriptStrings
$sectiondescription... |
combined_dataset/train/non-malicious/sample_11_98.ps1 | sample_11_98.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/1662.ps1 | 1662.ps1 |
$a1 = New-Object System.Collections.ArrayList
$a2 = New-Object System.Collections.ArrayList
$a3 = New-Object System.Collections.ArrayList
1..5 | % {
$null = $a1.Add($(Measure-Command {
$StringBuilder = New-Object System.Text.StringBuilder
1..10000 | % {
$null = $stringBuilder.Append... |
combined_dataset/train/non-malicious/5c778a26-8386-434c-8824-00c38db7c470.ps1 | 5c778a26-8386-434c-8824-00c38db7c470.ps1 | param([Parameter(Mandatory=$true)][string]$Path,[Parameter(Mandatory=$true)][string]$Destination)
Get-ChildItem -Path $Path | Where-Object { !$_.PSIsContainer } | foreach {
$Target = Join-Path -Path $Destination -ChildPath (Split-Path -Leaf $_)
if ( Test-Path -Path $Target -PathType Leaf ) {
$PrevTargetBkup=(... |
combined_dataset/train/non-malicious/Test-EmptyFolder.ps1 | Test-EmptyFolder.ps1 | function Test-EmptyFolder {
<#
.SYNOPSIS
Tests for empty folders.
.DESCRIPTION
The Test-EmptyFolder function tests if a specified folder is empty by checking if it
contains files or folders. The function returns the folder path and a boolean value for empty.
.PARAMETER Path
Specifies the path of ... |
combined_dataset/train/non-malicious/Backup-EventLogs.ps1 | Backup-EventLogs.ps1 | Function Backup-EventLogs
{
<#
.SYNOPSIS
Backup Eventlogs from remote computer
.DESCRIPTION
This function backs up all logs on a Windows computer that have events written in them. This
log is stored as a .csv file in the current directory, where the filenam... |
combined_dataset/train/non-malicious/sample_16_54.ps1 | sample_16_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Osmanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osmanagement.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/2812.ps1 | 2812.ps1 |
$data = $null
foreach ($file in (ls *svcall.xml)) {
$data += Import-Clixml $file
}
$data | Select-Object Caption, Pathname | Sort-Object Caption, Pathname | Group-Object Caption, Pathname | Sort-Object Name |
combined_dataset/train/non-malicious/sample_18_66.ps1 | sample_18_66.ps1 | ## Copyright (c) Microsoft Corporation. All rights reserved.
<#
.SYNOPSIS
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans.
.DESCRIPTION
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans. These performance recordings contain Microsoft-Antimal... |
combined_dataset/train/non-malicious/1544.ps1 | 1544.ps1 |
function Get-MrService {
[CmdletBinding()]
param (
[ValidateNotNullOrEmpty()]
[string[]]$Name = '*',
[Microsoft.Management.Infrastructure.CimSession[]]$CimSession
)
$ServiceParams = @{}
if ($PSBoundParameters.CimSession) {
$ServiceParams.CimSession = $C... |
combined_dataset/train/non-malicious/ConvertTo-Hex_10.ps1 | ConvertTo-Hex_10.ps1 | # Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx
param ( [string]$SidString )
# Create SID .NET object using SID string provided
$sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring
# Create a byte array of the proper length
$sidBytes = New-Object byte[] ... |
combined_dataset/train/non-malicious/sample_52_96.ps1 | sample_52_96.ps1 | /*!---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*----------------------------------------------------------*/
"use strict";
/// <reference path="telemetry.d.ts" />
var IgnoreTelemetryReporter = (function () {
function IgnoreTelemetryReporter... |
combined_dataset/train/non-malicious/Get-PerformanceCounter.ps1 | Get-PerformanceCounter.ps1 | function Get-PerformanceCounter {
<#
.Synopsis
Gets one or more Performance Counter objects.
.Description
This function will use .NET to retrieve a single Counter or all counters
for a particular Instance and Category.
.Parameter category
The Performance Counter Category.
... |
combined_dataset/train/non-malicious/sample_20_79.ps1 | sample_20_79.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=必要な PowerShell モジュール (FailoverClusters) が見つかりませんでした。役割と機能ツールを使用して、次をインストールしてください: リモート サーバー管理ツール | 機能管理ツール | フェールオーバー クラスタリング ツール | Windows PowerShell 用フェールオーバー クラスター モジュール。
'@
# SIG # Begin signature block
# MIInwQYJKoZIhvcNAQcCoIInsjCCJ64CAQExDzANBglghkgB... |
combined_dataset/train/non-malicious/sample_12_91.ps1 | sample_12_91.ps1 | #$debug = $false
# Load Common Library:
. ./utils_cts.ps1
# Load DSD Common Function Library
. ./utils_DSD.ps1
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo... |
combined_dataset/train/non-malicious/sample_54_94.ps1 | sample_54_94.ps1 | # Web Deploy: Powershell script to set up delegated deployments with Web Deploy
# Copyright (C) Microsoft Corp. 2010
#
# Requirements: IIS 7, Windows Server 2008 (or higher)
#
# elevatedUsername/elevatedPassword: Credentials of a user that has write access to applicationHost.config. Used for createApp, appPoolNetF... |
combined_dataset/train/non-malicious/2807.ps1 | 2807.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(Value) as ct,
Value
FROM
*LogUserAssist.tsv
GROUP BY
Value
ORDER BY
ct ASC
"@
& logparser -stats:off -i:csv -dtlines:0 -fixedsep:on -rtp:-1 "$lpquery"
} else {
$ScriptName = [System.IO.Pa... |
combined_dataset/train/non-malicious/Get-ProxyAddress_1.ps1 | Get-ProxyAddress_1.ps1 | Param (
[Parameter(Mandatory=$true,
Position=0,
ValueFromPipeline=$true,
HelpMessage="Enter SMTP address to search for in Active-Directory."
)]
[string]$objSMTP
)
Function Get-ProxyAddresses ([string]$Address){
$objAD = $null
$objAD = Get-QADObject -LdapFilter "(proxyAddre... |
combined_dataset/train/non-malicious/Set-Prompt_1.ps1 | Set-Prompt_1.ps1 | param([Alias("copy","demo")][Switch]$Pasteable)
# This should go OUTSIDE the prompt function, it doesn't need re-evaluation
# We're going to calculate a prefix for the window title
# Our basic title is "PoSh - C:\\Your\\Path\\Here" showing the current path
if(!$global:WindowTitlePrefix) {
# But if you're runni... |
combined_dataset/train/non-malicious/sample_52_10.ps1 | sample_52_10.ps1 | #
# Module manifest for module 'OCI.PSModules.Aispeech'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aispeech.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_43_88.ps1 | sample_43_88.ps1 | #
# Script module for module 'Az.PrivateDns' that is executed when 'Az.PrivateDns' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 05/16/2024 06:33:09
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
... |
combined_dataset/train/non-malicious/ASPX Mailbox (2 of 6).ps1 | ASPX Mailbox (2 of 6).ps1 | public partial class MailboxTasks : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
System.Text.StringBuilder sbValid = new System.Text.StringBuilder();
sbValid.Append("if (typeof(Page_ClientValidate) == 'function') { ");
sbValid.Append("if (Page_Cl... |
combined_dataset/train/non-malicious/sample_51_89.ps1 | sample_51_89.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/1488.ps1 | 1488.ps1 |
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,Position=0)]
[string[]]
$Path,
[string]
$Name,
[string[]]
$Test,
[string]
$XmlLogPath,
[Switch]
$PassThru,
[Switch]
$Recurse
)
Set-StrictMode -Version 'Latest'
& (Join-P... |
combined_dataset/train/non-malicious/ProgressMessage .ps1 | ProgressMessage .ps1 | #Generated Form Function
function ProgressMessage {
########################################################################
# Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) v1.0.10.0
# Generated On: 29/01/2013 11:01 AM
# Generated By: admstpierdj
#####################################... |
combined_dataset/train/non-malicious/sample_67_87.ps1 | sample_67_87.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 = '84.0.0'
# Supported P... |
combined_dataset/train/non-malicious/Computer Inventory_2.ps1 | Computer Inventory_2.ps1 | # ========================================================
#
# Script Information
#
# Title: Remote Computer Inventory
# Author: Assaf Miron
# Originally created: 21/06/2008
# Original path: Computer-Inventory.PS1
# Description: Collects Remote Computer Data Using WMI and Registry Access
# Outputs... |
combined_dataset/train/non-malicious/Quickstats from VMware.ps1 | Quickstats from VMware.ps1 | connect-VIServer yourserver
# Written by Alan Renouf - Check http://teckinfo.blogspot.com for more examples
# This can easily be changed to pass parameters or be used as a function
# Set the following 3 variables for your needs
# Example stats are:
# % CPU Usage - cpu.usage.average
# Mhz CPU Usage - cpu.usageMH... |
combined_dataset/train/non-malicious/sample_25_46.ps1 | sample_25_46.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.