full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_36_37.ps1 | sample_36_37.ps1 | # ---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------------------------... |
combined_dataset/train/non-malicious/Balance-Datastores.ps1 | Balance-Datastores.ps1 | #Parameter- Name of the VMware cluster to work in
param($cluster)
Write-Output "`n$(Get-Date)- Script started`n"
# Validate parameter input
$IsClusterNameInvalid = $true
Get-Cluster | % { If ($_.Name -eq $Cluster) {$IsClusterNameInvalid = $false} }
If ($IsClusterNameInvalid) {
Write-Host "Error- Invalid Clu... |
combined_dataset/train/non-malicious/3414.ps1 | 3414.ps1 |
$VerbosePreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"
$results = @{
totalCount = 0;
passedCount = 0;
passedTests = @();
failedTests = @();
times = @{};
startTime = Get-Date;
}
function Run-TestProtectedAsJob
{
param($script, $testName)
$job = Start-Job -Name $testName -ScriptBloc... |
combined_dataset/train/non-malicious/2181.ps1 | 2181.ps1 | [CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Specify the Primary Site server")]
[ValidateNotNullOrEmpty()]
[string]$SiteServer
)
Begin {
try {
Add-Type -AssemblyName "System.Drawing" -ErrorAction Stop
Add-Type -AssemblyName "System.Win... |
combined_dataset/train/non-malicious/2737.ps1 | 2737.ps1 |
$Error.Clear()
$ErrorActionPreference = "SilentlyContinue"
$office_versions = @("15.0",
"14.0",
"11.0",
"10.0",
"9.0"
)
$user_SIDs = gwmi win32_userprofile | select sid
Foreach ($user_SID in $user_SIDs.sid){
Foreach ($version in $office_versions){
$key_base = "\HKEY_USERS\" +... |
combined_dataset/train/non-malicious/Check Service_1.ps1 | Check Service_1.ps1 | ####################################################################################
#PoSH script to check if a server is up and if it is check for a service.
#If the service isn't running, start it and send an email
# JK - 7/2009
#Updated: 07/22/09 by Steven Murawski (http://blog.usepowershell.com)
#Changed the p... |
combined_dataset/train/non-malicious/1210.ps1 | 1210.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldTestExistingIPV4Address
{
Get-IPAddress -V4 | ForEach-Object { Assert-True (Test-IPAddress -IPAddress $_) }
}
function Test-ShouldTestExistingIPV4String
{
Get... |
combined_dataset/train/non-malicious/2982.ps1 | 2982.ps1 | function BeforeEachFeature {
[CmdletBinding(DefaultParameterSetName = "All")]
param(
[Parameter(Mandatory = $True, Position = 0, ParameterSetName = "Tags")]
[String[]]$Tags = @(),
[Parameter(Mandatory = $True, Position = 1, ParameterSetName = "Tags")]
[Parameter(Mandatory ... |
combined_dataset/train/non-malicious/sample_4_82.ps1 | sample_4_82.ps1 | #************************************************
# TS_UploadSingleFile
# Version 1.2.1
# Date: 02-19-2012
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script ask customer a file name giving the option for them to upload the selected file
#************************************************
... |
combined_dataset/train/non-malicious/599.ps1 | 599.ps1 |
function Get-SPWebs{
param(
[Parameter(Mandatory=$false)]
$SPWeb
)
if ((Get-PSSnapin “Microsoft.SharePoint.PowerShell” -ErrorAction SilentlyContinue) -eq $null) {
Add-PSSnapin “Microsoft.SharePoint.PowerShell”
}
if($SPWeb){
Get-SPW... |
combined_dataset/train/non-malicious/sample_35_9.ps1 | sample_35_9.ps1 | #
# Module manifest for module 'OCI.PSModules.Vbsinst'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vbsinst.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/GUI ProductKey.ps1 | GUI ProductKey.ps1 | $def = (gci $MyInvocation.MyCommand.Name).Directory
##################################################################################################
$mnuScan_Click= {
$lstView.Items.Clear()
try {
Get-AllData ("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion")
Get-AllData (Expand-OfficeKey)
}
... |
combined_dataset/train/non-malicious/Enable and Configure SNM.ps1 | Enable and Configure SNM.ps1 | #Powershell Script To Install SNMP Services (SNMP Service, SNMP WMI Provider)
#Variables :)
$pmanagers = "ADD YOUR MANAGER(s)"
$commstring = "ADD YOUR COMM STRING"
#Import ServerManger Module
Import-Module ServerManager
#Check If SNMP Services Are Already Installed
$check = Get-WindowsFeature | Where-Objec... |
combined_dataset/train/non-malicious/4155.ps1 | 4155.ps1 |
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][string]
$FilesFolders
)
function Grant-FolderOwnership {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][string]
$FileFolder,
[switch]
$Recurse
)
$Errors = $false
If ((Test-Path $FileFolder) -eq $true) {
$Output = "Taking ownership of " ... |
combined_dataset/train/non-malicious/sample_24_72.ps1 | sample_24_72.ps1 | #
# Module manifest for module 'OCI.PSModules.Rover'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Rover.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_1_28.ps1 | sample_1_28.ps1 | ConvertFrom-StringData @'
id_clusterinfo=Cluster Information
id_clusterinforesquery=Processing Resources: %ResourceName% (%Current% of %top%)
id_clusterinfoquery=Cluster Group %GroupName% - Querying resources
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# ... |
combined_dataset/train/non-malicious/sample_38_67.ps1 | sample_38_67.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 = '81.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/3490.ps1 | 3490.ps1 |
function Get-DevSpacesControllerName
{
return 'devspaces' + (getAssetName)
}
function Get-DevSpacesControllerTagKey
{
return 'tagKey' + (getAssetName)
}
function Get-DevSpacesControllerTagValue
{
return 'tagValue' + (getAssetName)
}
function Assert-AreEqualPSController($controller1, $c... |
combined_dataset/train/non-malicious/sample_43_92.ps1 | sample_43_92.ps1 | #
# Module manifest for module 'OCI.PSModules.Stackmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Stackmonitoring.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_7_62.ps1 | sample_7_62.ps1 | # Load Common Library
# Load Reporting Utilities
#_#$debug = $false
. ./utils_cts.ps1
. ./TS_RemoteSetup.ps1
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.S... |
combined_dataset/train/non-malicious/sample_58_37.ps1 | sample_58_37.ps1 | @{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.ServiceFabric.Powershell'
# Version number of this module.
ModuleVersion = '3.1.0.0'
# ID used to uniquely identify this module
GUID = 'd2c42633-5254-4a82-a312-1dc0697a55cd'
# Author of this module
Author = '... |
combined_dataset/train/non-malicious/sample_60_60.ps1 | sample_60_60.ps1 | #
# Module manifest for module 'OCI.PSModules.Logging'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Logging.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_27_44.ps1 | sample_27_44.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 = '83.2.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/getMyModulePrefix.ps1 | getMyModulePrefix.ps1 | function getMyModulePrefix {
<#
.SYNOPSIS
An internal support routine for imported modules to retrieve a prefix
assigned using the Import-Module -prefix argument.
.DESCRIPTION
Functions in modules imported with the -prefix option have two command
names. The module defined name and the prefixed name. ... |
combined_dataset/train/non-malicious/sample_17_73.ps1 | sample_17_73.ps1 | ConvertFrom-StringData @'
id_printcsrbloatingcheck_st=Possible client size rendering registry bloat detected
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCW... |
combined_dataset/train/non-malicious/sample_61_61.ps1 | sample_61_61.ps1 | #
# Module manifest for module 'OCI.PSModules.Emaildataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emaildataplane.dll'
# Version number of this module.
ModuleVersion = '88.1.0'
# Supported PSE... |
combined_dataset/train/non-malicious/sample_21_19.ps1 | sample_21_19.ps1 | ConvertFrom-StringData @'
id_netbasicinfo=Networking Information
id_netbasicinfoobtaining=Obtaining basic networking information
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBA... |
combined_dataset/train/non-malicious/sample_7_69.ps1 | sample_7_69.ps1 | # 2023-02-24 WalterE mod Trap #we#
$startTime_AutoAdd = Get-Date
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_"
}
Write-Host -Background... |
combined_dataset/train/non-malicious/FS_FindFiles_1.ps1 | FS_FindFiles_1.ps1 | Param (
[string[]]$Computers=$env:ComputerName,
[string[]] $Paths = @("C:\\Windows","C:\\Windows\\system32"),
[string[]] $FileNames = @("fsb.tmp","fsb.stb","notpad.exe")
)
$Global:objOut = @()
Function FindFiles ($Computer, $Filter){
try{
$Files = Gwmi -namespace "root\\CIMV2" -computername $Computer... |
combined_dataset/train/non-malicious/sample_19_39.ps1 | sample_19_39.ps1 | #************************************************
# DC_WinHTTP-Component.ps1
# Version 1.0
# Version 1.1: Moved $sectionDescription to the correct location.
# Date: 2009-2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about WinHTTP.
# Called from: Main Networking Diag, PKI ... |
combined_dataset/train/non-malicious/Update-vSwitchSecurity.ps1 | Update-vSwitchSecurity.ps1 | #requires -version 2.0
# Author: Glenn Sizemore 12/19/2009
# Source: http://get-admin.com/blog/?p=239
#
# v1.0 : It works
Cmdlet Update-vSwitchSecurity -SupportsShouldProcess {
param (
[Parameter(position=0,Mandatory=$TRUE,HelpMessage="Name of the vSwitch to modify")]
[string]
$vSwitch,
[Parameter(po... |
combined_dataset/train/non-malicious/sample_36_17.ps1 | sample_36_17.ps1 | using module ..\..\Config.psm1
param(
[switch]$TestStatus
)
Import-Module (Join-Path $PSScriptRoot "..\..\Events.psm1")
. (Join-Path $PSScriptRoot ..\..\Elevate.ps1)
Elevate $MyInvocation
# OS version strings should be taken from here:
# https://aka.ms/Windows/ReleaseInfo
Set-Variable -Option Con... |
combined_dataset/train/non-malicious/sample_34_78.ps1 | sample_34_78.ps1 | # Use the PowerShell extension setting `powershell.scriptAnalysis.settingsPath` to get the current workspace
# to use this PSScriptAnalyzerSettings.psd1 file to configure code analysis in Visual Studio Code.
# This setting is configured in the workspace's `.vscode/settings.json`.
#
# For more information on PSScrip... |
combined_dataset/train/non-malicious/1421.ps1 | 1421.ps1 |
function Clear-CDscLocalResourceCache
{
[CmdletBinding()]
param(
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
Get-WmiObject msft_providers |
Where-Object {$_.provider -like 'dsccore'} |
Select-Object ... |
combined_dataset/train/non-malicious/sample_13_12.ps1 | sample_13_12.ps1 | #
# Module manifest for module 'OCI.PSModules.Bastion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bastion.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_56_15.ps1 | sample_56_15.ps1 | #
# Module manifest for module 'OCI.PSModules.Ons'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ons.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/1906.ps1 | 1906.ps1 |
Describe "Get-FileHash" -Tags "CI" {
BeforeAll {
$testDocument = Join-Path -Path $TestDrive -ChildPath "hashable.txt"
$utf8NoBOM = [System.Text.UTF8Encoding]::new($false)
[System.IO.File]::WriteAllText($testDocument, "Get-Module`n", $utf8NoBOM)
}
Context "Validate platform encodi... |
combined_dataset/train/non-malicious/Audit NTFS on Shares.ps1 | Audit NTFS on Shares.ps1 | $Excel = New-Object -Com Excel.Application
$Excel.visible = $True
$Excel = $Excel.Workbooks.Add()
$wSheet = $Excel.Worksheets.Item(1)
$wSheet.Cells.item(1,1) = "Folder Path:"
$wSheet.Cells.Item(1,2) = "Users/Groups:"
$wSheet.Cells.Item(1,3) = "Permissions:"
$wSheet.Cells.Item(1,4) = "Permissions Inherited:"
... |
combined_dataset/train/non-malicious/sample_28_48.ps1 | sample_28_48.ps1 | $osInfo = Get-WmiObject -Class Win32_OperatingSystem
# check if running on Windows Server
if ($osInfo.ProductType -eq 3) {
Install-WindowsFeature Server-Media-Foundation
}
# SIG # Begin signature block
# MIInwgYJKoZIhvcNAQcCoIInszCCJ68CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwE... |
combined_dataset/train/non-malicious/sample_37_0.ps1 | sample_37_0.ps1 | # MIDDLEWARE SERVICES
USER_API_URL = 'https://t2c-user-service.qxlabai.com'
MIDDLEWARE_API_URL = 'https://t2c-middleware-service.qxlabai.com'
# USER_API_URL = 'http://localhost:3007'
# MIDDLEWARE_API_URL = 'http://localhost:3005'
# OPENLAB_AI
OPEN_LAB_AI_BASE_URL = https://13.248.139.177
OPEN_LAB_AI_KEY = '0546a8c6-12... |
combined_dataset/train/non-malicious/sample_54_7.ps1 | sample_54_7.ps1 | #
# Module manifest for module 'OCI.PSModules.Queue'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Queue.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_33_29.ps1 | sample_33_29.ps1 | #
# Module manifest for module 'OCI.PSModules.Networkloadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Networkloadbalancer.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Sup... |
combined_dataset/train/non-malicious/sample_33_59.ps1 | sample_33_59.ps1 | #
# Module manifest for module 'OCI.PSModules.Goldengate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Goldengate.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_36_41.ps1 | sample_36_41.ps1 | #===========================================================================
#DVInstaller.ps1
#----------------------------------------------------------------------------
#Copyright (C) 2021 Intel Corporation
#SPDX-License-Identifier: MIT
#--------------------------------------------------------------------------*/
#... |
combined_dataset/train/non-malicious/sample_0_41.ps1 | sample_0_41.ps1 | ConvertFrom-StringData @'
id_printcsrbloatingcheck_st=Possible client size rendering registry bloat detected
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCW... |
combined_dataset/train/non-malicious/3581.ps1 | 3581.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Get-ApiManagementServiceName
{
return getAssetName
}
function Get-ResourceName
{
return getAssetName
}
function Get-ProviderLocation($provider)
{
$locations = Get-ProviderLocations $provider
if ($locations -eq $null... |
combined_dataset/train/non-malicious/sample_66_6.ps1 | sample_66_6.ps1 | #
# Module manifest for module 'OCI.PSModules.Budget'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Budget.dll'
# Version number of this module.
ModuleVersion = '89.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_30_78.ps1 | sample_30_78.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/sample_30_1.ps1 | sample_30_1.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/sample_61_54.ps1 | sample_61_54.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
# UnzipAndCopyMDS.ps1
# Kill all running Monitoring processes an... |
combined_dataset/train/non-malicious/335.ps1 | 335.ps1 | function Resolve-PSFDefaultParameterValue
{
[OutputType([System.Collections.Hashtable])]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Resolve-PSFDefaultParameterValue')]
param (
[Parameter(Mandatory = $true)]
[System.Collections.Hashtable]
$Reference,
[Parameter(Ma... |
combined_dataset/train/non-malicious/sample_2_16.ps1 | sample_2_16.ps1 | ConvertFrom-StringData @'
id_ctsdhcpclient=DHCP Client
id_ctsdhcpclientdescription=Collects information about DHCP Client.
'@
# SIG # Begin signature block
# MIIoPAYJKoZIhvcNAQcCoIIoLTCCKCkCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAI... |
combined_dataset/train/non-malicious/2834.ps1 | 2834.ps1 | function WriteTaskTimeSummary($invokePsakeDuration) {
if ($psake.context.count -gt 0) {
$currentContext = $psake.context.Peek()
if ($currentContext.config.taskNameFormat -is [ScriptBlock]) {
& $currentContext.config.taskNameFormat "Build Time Report"
} elseif ($currentContext.con... |
combined_dataset/train/non-malicious/2249.ps1 | 2249.ps1 |
function Write-LogFile {
param(
[parameter(Mandatory=$true, HelpMessage="Name of the log file, e.g. 'FileName'. File extension should not be specified")]
[ValidateNotNullOrEmpty()]
[string]$Name,
[parameter(Mandatory=$true, HelpMessage="Value added to the specified log file")]
[ValidateNotNullOrEmpty()]
[... |
combined_dataset/train/non-malicious/sample_16_28.ps1 | sample_16_28.ps1 | #************************************************
# TS_WMIHandleLeakKB2639077.ps1
# Version 1.0.1
# Date: 7/19/2013
# Author: v-kaw
# Description: [KSE Rule] [ Windows V3] Handle leak in Svchost.exe when a WMI query is triggered by using the Win32_PowerSettingCapabilities
# Rule number: 5c139a00-370c-4d1c-a929-... |
combined_dataset/train/non-malicious/2955.ps1 | 2955.ps1 | Properties {
$x = 1
$y = 2
}
FormatTaskName "[{0}]"
Task default -Depends Verify
Task Verify -Description "This task verifies psake's variables" {
Assert (Test-Path 'variable:\psake') "psake variable was not exported from module"
Assert ($psake.ContainsKey("version")) "psake variable does not contain 'v... |
combined_dataset/train/non-malicious/Product key_5.ps1 | Product key_5.ps1 | from System import Array, Char, Console
from System.Collections import ArrayList
from Microsoft.Win32 import Registry
def DecodeProductKey(digitalProductID):
map = ("BCDFGHJKMPQRTVWXY2346789").ToCharArray()
key = Array.CreateInstance(Char, 29)
raw = ArrayList()
i = 52
while i < 67:
raw... |
combined_dataset/train/non-malicious/TheGameOfLife.ps1 | TheGameOfLife.ps1 | [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
$SCRIPT:hostProperties = @{};
$SCRIPT:hostState = $null;
$SCRIPT:BoardWidth = 50;
$SCRIPT:BoardHeight = 50;
Function Initialize-Host
{
Param(
[Parameter(Mandatory=$false)]
$wndTitle = "Game of Life...",
[Parameter(Ma... |
combined_dataset/train/non-malicious/sample_58_29.ps1 | sample_58_29.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param (
[Parameter(Manda... |
combined_dataset/train/non-malicious/Advanced search.ps1 | Advanced search.ps1 | <#
Using examples:
Example 1:
Get-ItemPlace *.log -h
It will search all (including that have "Hidden" attribute) *.log files on local drives.
Example 2:
Get-ItemPlace sysinternals hkcu:\\
This command invoke search Sysinyetrnals key into HKEY_CURRENT_USER.
#>
function Get-ItemPlace {
param ([s... |
combined_dataset/train/non-malicious/1882.ps1 | 1882.ps1 |
Describe "Get-EventSubscriber" -Tags "CI" {
AfterEach {
Unregister-Event -SourceIdentifier PesterTestRegister -ErrorAction SilentlyContinue
}
Context "Check return type of Get-EventSubscriber" {
It "Should return System.Management.Automation.PSEventSubscriber as return type of New-Event" {
$pest... |
combined_dataset/train/non-malicious/994.ps1 | 994.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/Import-ExcelToSQL_2.ps1 | Import-ExcelToSQL_2.ps1 | #Change these settings as needed
$filepath = 'C:\\Users\\u00\\Documents\\backupset.xlsx'
#Comment/Uncomment connection string based on version
#Connection String for Excel 2007:
$connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=`"$filepath`";Extended Properties=`"Excel 12.0 Xml;HDR=YES`";"
#Connection S... |
combined_dataset/train/non-malicious/1742.ps1 | 1742.ps1 |
[cmdletbinding(DefaultParameterSetName='Build')]
param(
[Parameter(ParameterSetName='packageSigned')]
[Parameter(ParameterSetName='Build')]
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")]
[string]$ReleaseTag,
[Parameter(Mandatory,ParameterSetName='packageSigned')]
[string]
$Buil... |
combined_dataset/train/non-malicious/sample_0_87.ps1 | sample_0_87.ps1 | // Copyright (c) 2008 DMTF. All rights reserved.
[Abstract, Association, Version ( "2.18.0" ),
UMLPackagePath ( "CIM::Core::Collection" ),
Description (
"OwningCollectionElement represents an association between a "
"Collection and the ManagedElement responsible for the control "
... |
combined_dataset/train/non-malicious/sample_62_9.ps1 | sample_62_9.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 = '87.0.0'
# Supported P... |
combined_dataset/train/non-malicious/3695.ps1 | 3695.ps1 |
function Test-PolicyCrud
{
$Name = getAssetName
$resourceGroup = TestSetup-CreateResourceGroup
$resourceGroupName = $resourceGroup.ResourceGroupName
$tags = @{"tag1" = "value1"; "tag2" = "value2"}
$matchCondition1 = New-AzFrontDoorWafMatchConditionObject -MatchVariable RequestHeader -... |
combined_dataset/train/non-malicious/436.ps1 | 436.ps1 |
$registrationEvent = {
}
$begin_event = {
function Clean-FileSystemErrorXml
{
[CmdletBinding()]
Param (
$Path
)
$totalLength = $Null
$files = Get-ChildItem -Path $Path.FullName -Filter "$($env:ComputerName)_$($pid)_error_*.xml" | Sort-Object LastWriteTime
$totalLength = $files | Measure-Obje... |
combined_dataset/train/non-malicious/4477.ps1 | 4477.ps1 |
configuration PSModule_InstallModuleWithinVersionRangeConfig
{
param
(
[Parameter()]
[System.String[]]
$NodeName = 'localhost',
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String]
$ModuleName,
[Parameter(Mandatory = $tr... |
combined_dataset/train/non-malicious/sample_36_10.ps1 | sample_36_10.ps1 | <#
.SYNOPSIS
Demonstrates how to write a command that works with paths that do
not allow wildards and do not have to 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... |
combined_dataset/train/non-malicious/sample_2_38.ps1 | sample_2_38.ps1 | # <copyright>
# INTEL CONFIDENTIAL
#
# Copyright 2022 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you ("License").
# Unless the License provides otherwise, you may not us... |
combined_dataset/train/non-malicious/1111.ps1 | 1111.ps1 |
$siteName = 'Anonymous Authentication'
$sitePort = 4387
$webConfigPath = Join-Path $TestDir web.config
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
Uninstall-IisWebsite $siteName
Install-IisWebsite -Na... |
combined_dataset/train/non-malicious/2658.ps1 | 2658.ps1 |
Function Verb-Noun {
[CmdletBinding()]
Param (
)
Begin {
[string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name
Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header
}
Process {
Try {
}
Catch {
Write-Log -Message "<error message>. `... |
combined_dataset/train/non-malicious/sample_18_56.ps1 | sample_18_56.ps1 | #
# Module manifest for module 'OCI.PSModules.Bastion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bastion.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/SharePoint Large Lists_1.ps1 | SharePoint Large Lists_1.ps1 | [reflection.assembly]::loadwithpartialname("Microsoft.SharePoint")
$cs = [microsoft.sharepoint.administration.spwebservice]::ContentService
$global:largeListThreshhold = 2000
function Is-Admin([Microsoft.SharePoint.SPRoleAssignment]$roleAssignment)
{
return (($roleAssignment.roledefinitionbindings | where { ($_... |
combined_dataset/train/non-malicious/215.ps1 | 215.ps1 | function Get-NetStat
{
PROCESS
{
$data = netstat -n
$data = $data[4..$data.count]
foreach ($line in $data)
{
$line = $line -replace '^\s+', ''
$line = $line -split '\s+'
$pr... |
combined_dataset/train/non-malicious/Pipeline and Parameter_1.ps1 | Pipeline and Parameter_1.ps1 | param(
[Parameter(ValueFromPipeline=$true, Mandatory=$true, Position=0)]
[string[]]
$ComputerName
)
Process {
foreach ($cn in $ComputerName) {
Write-Host "Processing $cn"
}
}
|
combined_dataset/train/non-malicious/1178.ps1 | 1178.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$user = $null
$url = 'http://test-gethttpurlacl:10939/'
function Assert-TestUrl
{
param(
[Carbon.Security.HttpUrlSecurity[]]
$Acls
)
$Global:Error.Count | Should -Be 0
$Acls | Sh... |
combined_dataset/train/non-malicious/sample_47_91.ps1 | sample_47_91.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/Get-DNSZoneRecords_1.ps1 | Get-DNSZoneRecords_1.ps1 | #==========================================================================
# NAME: Get-DNSZoneRecords.ps1
# AUTHOR: Saehrig, Steven (trac3r726)
# DATE : 10/17/2008
#
# COMMENT:
# Just comment out the variable and enter the info you need for
# computername, dnszonename, and remove the credential portion if no... |
combined_dataset/train/non-malicious/sample_25_42.ps1 | sample_25_42.ps1 | # Localized 05/07/2022 06:50 AM (GMT) 303:7.0.30723 RS_Adjustwirelessadaptersettings.psd1
ConvertFrom-StringData @'
###PSLOC
reset_Wirelessadaptersettings=إعادة تعيين إعدادات المحول اللاسلكي
Report_name_Wirelessadaptersettings_AC_result=نتيجة إعادة تعيين إعدادات المحول اللاسلكي للتيار المتردد
Report_name_Wire... |
combined_dataset/train/non-malicious/416.ps1 | 416.ps1 | Register-PSFTeppScriptblock -Name "PSFramework-Encoding" -ScriptBlock {
'Unicode'
'BigEndianUnicode'
'UTF8'
'UTF8Bom'
'UTF8NoBom'
'UTF7'
'UTF32'
'Ascii'
'Default'
'BigEndianUTF32'
if (Get-PSFConfigValue -FullName 'PSFramework.Text.Encoding.FullTabCompletion')
{
[System.Text.Encoding]::GetEncodings().BodyN... |
combined_dataset/train/non-malicious/2849.ps1 | 2849.ps1 | function WriteColoredOutput {
param(
[string] $message,
[System.ConsoleColor] $foregroundcolor
)
$currentConfig = GetCurrentConfigurationOrDefault
if ($currentConfig.coloredOutput -eq $true) {
if (($null -ne $Host.UI) -and ($null -ne $Host.UI.RawUI) -and ($null -ne $Host.UI.RawU... |
combined_dataset/train/non-malicious/2021.ps1 | 2021.ps1 |
Import-Module HelpersCommon
Describe "New-PSSession basic test" -Tag @("CI") {
It "New-PSSession should not crash powershell" {
if ( (Get-PlatformInfo) -eq "alpine" ) {
Set-ItResult -Pending -Because "MI library not available for Alpine"
return
}
{ New-PSSession ... |
combined_dataset/train/non-malicious/sample_58_57.ps1 | sample_58_57.ps1 | Set-StrictMode -Version Latest
Import-Module (Join-Path $PSScriptRoot "Events.psm1")
Write-EventLog @EVL_CURTAINAPP -Message "Launching CurtainApp"
& $PSScriptRoot\CurtainApp\CurtainApp.exe --timeout 300 --mode "outofpackage"
& $Env:SystemDrive\Rigel\x64\Scripts\Provisioning\ScriptLaunch.ps1 ApplyConfig.ps1 -... |
combined_dataset/train/non-malicious/sample_24_51.ps1 | sample_24_51.ps1 | #
# Module manifest for module 'OCI.PSModules.Bastion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bastion.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_54_37.ps1 | sample_54_37.ps1 | #
# Module manifest for module 'OCI.PSModules.Appmgmtcontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Appmgmtcontrol.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSE... |
combined_dataset/train/non-malicious/2933.ps1 | 2933.ps1 |
task TaskAFromModuleB {
'Executing [TaskA] from module [TaskModuleB] version [0.2.0]'
}
task TaskBFromModuleB {
'Executing [TaskB] from module [TaskModuleB] version [0.2.0]'
}
|
combined_dataset/train/non-malicious/330802b9-dd0b-41e6-8020-cd304a79d948.ps1 | 330802b9-dd0b-41e6-8020-cd304a79d948.ps1 | function Run-Query($siteUrl, $queryText)
{
[reflection.assembly]::loadwithpartialname("microsoft.sharePOint") | out-null
[reflection.assembly]::loadwithpartialname("microsoft.office.server") | out-null
[reflection.assembly]::loadwithpartialname("microsoft.office.server.search") | out-null
$s = [microsoft.share... |
combined_dataset/train/non-malicious/Audit iPhone_Palm Users_1.ps1 | Audit iPhone_Palm Users_1.ps1 | #Created by P. Sukus
#Modified by D. Dill
#Name: mobile users syncing through OWA audit
#set the timeframe to audit in days
$Daysold = 1
$Date = (get-date).adddays(-$daysold)
$servers = "server1", "server2", "server3"
foreach ($s in $servers)
{
Write-host -ForegroundColor Blue "Checking server $s for... |
combined_dataset/train/non-malicious/chkhash_29.ps1 | chkhash_29.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... |
combined_dataset/train/non-malicious/PS FindFirstFileW.ps1 | PS FindFirstFileW.ps1 | param(
[string] $dirRoot = $pwd,
[string] $Spec = "*.*",
[bool] $longOnly = $false
)
# Changes:
# 23/05/2008, Wayne Martin, Added the option to only report +max_path entries, and report the short path of those directories (which makes it easier to access them)
#
#
# Description:
# Use the wide... |
combined_dataset/train/non-malicious/44121121-b64f-42c2-b48d-d6b74bc5fbb6.ps1 | 44121121-b64f-42c2-b48d-d6b74bc5fbb6.ps1 | #######################
<#
.SYNOPSIS
Execute T-SQL Statments and return messages from SQL Server (print).
.DESCRIPTION
Execute T-SQL Statments and return messages from SQL Server (print).
.INPUTS
None
You cannot pipe objects to Invoke-ExecuteTSQL
.OUTPUTS
PSObject :
Boolean Exitcode = $True or $False in... |
combined_dataset/train/non-malicious/3158.ps1 | 3158.ps1 |
$global:ThemeSettings = New-Object -TypeName PSObject -Property @{
CurrentUser = [System.Environment]::UserName
CurrentThemeLocation = "$PSScriptRoot\Themes\Agnoster.psm1"
MyThemesLocation = (Join-Path (Split-Path -Parent $PROFILE) "PoshThemes")
ErrorCount = 0
GitSymbols ... |
combined_dataset/train/non-malicious/sample_29_24.ps1 | sample_29_24.ps1 | #
# Module manifest for module 'OCI.PSModules.Appmgmtcontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Appmgmtcontrol.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSE... |
combined_dataset/train/non-malicious/1892.ps1 | 1892.ps1 |
Describe "Alias tests" -Tags "CI" {
BeforeAll {
$testPath = Join-Path testdrive:\ ("testAlias\.test")
New-Item -ItemType Directory -Path $testPath -Force | Out-Null
class TestData
{
[string] $testName
[string] $testFile
[string] $expectedError
... |
combined_dataset/train/non-malicious/sample_60_79.ps1 | sample_60_79.ps1 | <#
.SYNOPSIS
This script checks for potential CFA issues in the logs from the resultOutputDir.
It looks for CFA detections and taint events in the logs and constructs a list of CFADetection objects.
It then adds some diagnotics messages and guidance for each process.
It also constructs a list of fi... |
combined_dataset/train/non-malicious/3417.ps1 | 3417.ps1 |
function Test-MoveAzureResource
{
$sourceResourceGroupName = "testResourceGroup321"
$destinationResourceGroupName = "testResourceGroup432"
$testResourceName1 = "testResource123"
$testResourceName2 = "testResource234"
$location = "West US"
$apiversion = "2014-04-01"
$providerNa... |
combined_dataset/train/non-malicious/sample_50_86.ps1 | sample_50_86.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Export-CertForAMT {
<#
.Synopsis
Exports certificates from the Windows Certificate Store for use by the IntelvPro PowerShell Module
.Description
Exports certificates from the Windows Certificate Store for use by the Intelv... |
combined_dataset/train/non-malicious/sample_40_11.ps1 | sample_40_11.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.a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.