full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_43_38.ps1 | sample_43_38.ps1 | #
# Module manifest for module 'OCI.PSModules.Accessgovernancecp'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Accessgovernancecp.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Suppo... |
combined_dataset/train/non-malicious/Get-Parameter_8.ps1 | Get-Parameter_8.ps1 | function Get-Parameter ( $Cmdlet, [switch]$ShowCommon, [switch]$Full ) {
$command = Get-Command $Cmdlet -ea silentlycontinue
# resolve aliases (an alias can point to another alias)
while ($command.CommandType -eq "Alias") {
$command = Get-Command ($command.definition)
}
if (-not $command) { return }... |
combined_dataset/train/non-malicious/sample_4_61.ps1 | sample_4_61.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/2245.ps1 | 2245.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Set the URI for the ConfigMgr WebService.")]
[ValidateNotNullOrEmpty()]
[string]$URI,
[parameter(Mandatory=$true, HelpMessage="Specify the known secret key for the ConfigMgr WebService.")]
[ValidateNotNull... |
combined_dataset/train/non-malicious/sample_46_62.ps1 | sample_46_62.ps1 | #
# Module manifest for module 'OCI.PSModules.Applicationmigration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Applicationmigration.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# S... |
combined_dataset/train/non-malicious/sample_18_21.ps1 | sample_18_21.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 = '79.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/Create datastore by LUN .ps1 | Create datastore by LUN .ps1 | function New-DatastoreByLun { param( [string]$vmHost, [string]$hbaId, [int]$targetId, [int]$lunId, [string]$dataStoreName )
$view = Get-VMHost $vmHost | get-view
$lun = $view.Config.StorageDevice.ScsiTopology | ForEach-Object { $_.Adapter } | Where-Object {$_.Key -match $hbaId} | ForEach-Object {$_.Target} | ... |
combined_dataset/train/non-malicious/sample_13_41.ps1 | sample_13_41.ps1 | @{
GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @('MSFT_MpPerformanceRecording.psm1')
FormatsToProcess = @(... |
combined_dataset/train/non-malicious/PWD Expiration Email.ps1 | PWD Expiration Email.ps1 | #Active Directory Group Name To Be Edited
#Load Active Directory Module
if(@(get-module | where-object {$_.Name -eq "ActiveDirectory"} ).count -eq 0) {import-module ActiveDirectory}
# get domain maximumPasswordAge value
$MaxPassAge = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge.days
if($MaxPassAge -le ... |
combined_dataset/train/non-malicious/3552.ps1 | 3552.ps1 |
$containerName = "pstestwlvm1bca8"
$resourceGroupName = "pstestwlRG1bca8"
$vaultName = "pstestwlRSV1bca8"
$resourceId = "/subscriptions/da364f0f-307b-41c9-9d47-b7413ec45535/resourceGroups/pstestwlRG1bca8/providers/Microsoft.Compute/virtualMachines/pstestwlvm1bca8"
function Get-AzureVmWorkloadContainer
{
... |
combined_dataset/train/non-malicious/316.ps1 | 316.ps1 | function Get-PSFPipeline
{
[OutputType([PSFramework.Meta.Pipeline])]
[CmdletBinding()]
param (
)
begin
{
function Get-PrivateProperty
{
[CmdletBinding()]
param (
$Object,
[string]
$Name,
[ValidateSet('Any', 'Field', 'Property')]
[string]
$Type = 'Any'
)
... |
combined_dataset/train/non-malicious/sample_41_2.ps1 | sample_41_2.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.StreamAnalytics.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.StreamAnalytics.Module]::Instance
# Export nothing to clear imp... |
combined_dataset/train/non-malicious/2660.ps1 | 2660.ps1 |
[CmdletBinding()]
Param (
[Parameter(Mandatory=$false)]
[ValidateSet('Install','Uninstall')]
[string]$DeploymentType = 'Install',
[Parameter(Mandatory=$false)]
[ValidateSet('Interactive','Silent','NonInteractive')]
[string]$DeployMode = 'Interactive',
[Parameter(Mandatory=$false)]
[switch]$AllowRebootPassThru ... |
combined_dataset/train/non-malicious/sample_57_4.ps1 | sample_57_4.ps1 | @{
GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
FunctionsToExport = @()
CmdletsToExport = "Get-Credential", "Get-ExecutionP... |
combined_dataset/train/non-malicious/4008.ps1 | 4008.ps1 |
$resourceGroupName = "PSCmdletTest-RG"
$automationAccountName = "PSCmdletTestAccount01"
function AssertContains
{
param([string] $str, [string] $substr, [string] $message)
if (!$message)
{
$message = "Assertion failed because '$str' does not contain '$substr'"
}
if (!$st... |
combined_dataset/train/non-malicious/916.ps1 | 916.ps1 |
$keyVaultName = "myKeyVault00"
$rgName = "myResourceGroup"
$location = "East US"
$password = $([guid]::NewGuid()).Guid)
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$appName = "My App"
$vmName = "myEncryptedVM"
$vmAdminName = "encryptedUser"
New-AzResourceGroup -Location $loc... |
combined_dataset/train/non-malicious/sample_48_60.ps1 | sample_48_60.ps1 | $ModuleManifestName = '<%=$PLASTER_PARAM_ModuleName%>.psd1'
$ModuleManifestPath = "$PSScriptRoot\..\$ModuleManifestName"
Describe 'Module Manifest Tests' {
It 'Passes Test-ModuleManifest' {
Test-ModuleManifest -Path $ModuleManifestPath | Should Not BeNullOrEmpty
$? | Should Be $true
}
}
# SIG... |
combined_dataset/train/non-malicious/sample_28_31.ps1 | sample_28_31.ps1 | @{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
'PSUseConsistentWhitespace',
'PSUseConsistentIndentation',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'
)
Rules = @{
PSPlaceOpenBrace = @{
Enable ... |
combined_dataset/train/non-malicious/sample_9_87.ps1 | sample_9_87.ps1 | # Run_Discovery.ps1
PARAM ([string] $SchemaXMLPath = 'ConfigXPLSchema.xml',
[string] $WorkingPath = ''
)
# 2023-02-20 WalterE mod Trap #we#
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.... |
combined_dataset/train/non-malicious/3250.ps1 | 3250.ps1 |
class BaseLogger {
[Logger]$Logger
BaseLogger() {}
BaseLogger([string]$LogDirectory, [LogLevel]$LogLevel, [int]$MaxLogSizeMB, [int]$MaxLogsToKeep) {
$this.Logger = [Logger]::new($LogDirectory, $LogLevel, $MaxLogSizeMB, $MaxLogsToKeep)
}
[void]LogInfo([string]$Message) {
$logMess... |
combined_dataset/train/non-malicious/sample_0_15.ps1 | sample_0_15.ps1 | // Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved.
// ==================================================================
// DCIM_PSMemberOfCollection
// ==================================================================
[dynamic, provider("dcismprovider"),
Association, Description ("DC... |
combined_dataset/train/non-malicious/sample_24_23.ps1 | sample_24_23.ps1 | #
# Module manifest for module 'OCI.PSModules.Bds'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bds.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/New-Struct_2.ps1 | New-Struct_2.ps1 | ## New-Struct
## Creates a Struct class and emits it into memory
## The Struct includes a constructor which takes the parameters in order...
##
## Usage:
## # Assuming you have a csv file with no header and columns: artist,name,length
## New-Struct Song @{
## Artist=[string];
## Name=[string];
... |
combined_dataset/train/non-malicious/1985.ps1 | 1985.ps1 |
Describe "Sort-Object" -Tags "CI" {
It "should be able to sort object in ascending with using Property switch" {
{ Get-ChildItem -Path $PSScriptRoot -Include *.ps1 -Recurse | Sort-Object -Property Length } | Should -Not -Throw
$firstLen = (Get-ChildItem -Path $PSScriptRoot -Include *.ps1 -Recurs... |
combined_dataset/train/non-malicious/682.ps1 | 682.ps1 |
function Initialize-Rs
{
[cmdletbinding()]
param
(
[Alias('SqlServerInstance')]
[string]
$ReportServerInstance,
[Alias('SqlServerVersion')]
[Microsoft.ReportingServicesTools.SqlServerVersion]
$ReportServerVersion,
... |
combined_dataset/train/non-malicious/sample_46_58.ps1 | sample_46_58.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/3003.ps1 | 3003.ps1 | Set-StrictMode -Version Latest
$scriptRoot = Split-Path (Split-Path $MyInvocation.MyCommand.Path)
Describe 'Testing Gherkin Hook' -Tag Gherkin {
BeforeEach {
& ( Get-Module Pester ) {
$script:GherkinHooks = @{
BeforeEachFeature = @()
BeforeEachScenario = @()
... |
combined_dataset/train/non-malicious/sample_10_8.ps1 | sample_10_8.ps1 | ConvertFrom-StringData @'
id_rsop=Resultant Set of Policy (RSoP)
id_rsopobtaining=Obtaining Resultant Set of Policy (RSoP) via gpresult.exe utility
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JN... |
combined_dataset/train/non-malicious/3495.ps1 | 3495.ps1 |
function Test-AzureRmAlias
{
Disable-AzureRmAlias
Assert-Throws { Get-AzureRmSubscription }
Enable-AzureRmAlias
Get-AzureRmSubscription
Disable-AzureRmAlias -Scope "Process" -Module Az.Accounts
Assert-Throws { Get-AzureRmSubscription }
Enable-AzureRmAlias -Module Az.Compute, Az.Resources
Assert-... |
combined_dataset/train/non-malicious/Excel Auto-frontend.ps1 | Excel Auto-frontend.ps1 | Function New-DummyVM {
param(
[Parameter(Mandatory=$true,HelpMessage="Target Host")]
[VMware.VimAutomation.Types.VMHost]
$TargetHost,
[Parameter(Mandatory=$true,HelpMessage="Target Host")]
[VMware.VimAutomation.Types.ResourcePool]
$ResourcePool,
[Parameter(Mandatory=$true,HelpMessage="New VM Name")]... |
combined_dataset/train/non-malicious/MailChimp GetDistributio.ps1 | MailChimp GetDistributio.ps1 | #Author: Tozzi June 2012
#OriginalAuthor: Ant B 2012
#Purpose: Batch feed recipients to MailChimp
$ie = new-object -com "InternetExplorer.Application"
# Vars for building the URL
$apikey = "api-key-from-mailchimp"
$listid = "list-id-from-mailchimp"
# Important is to use correct MailChimp data centre. In th... |
combined_dataset/train/non-malicious/sample_13_22.ps1 | sample_13_22.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'https://aka... |
combined_dataset/train/non-malicious/sample_5_25.ps1 | sample_5_25.ps1 | #************************************************
# TS_RegistrySizeLimitCheck.ps1
# Version 1.0
# Date: 12-21-2011
# Author: v-anecho
# Description: The RegistrySizeLimit entry exists in the registry. This may cause the computer to stop responding as well as log Event ID 333's in the System Event Log.
#**********... |
combined_dataset/train/non-malicious/sample_27_80.ps1 | sample_27_80.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.SYNOPSIS
Starts the language and debug services from the PowerShellEditorServices module.
.DESCRIPTION
PowerShell Editor Services Bootstrapper Script
----------------------------------------------
This script contains... |
combined_dataset/train/non-malicious/1980.ps1 | 1980.ps1 |
Describe "New-Object" -Tags "CI" {
It "Support 'ComObject' parameter on platforms" {
if ($IsLinux -or $IsMacOs ) {
{ New-Object -ComObject "Shell.Application" } | Should -Throw -ErrorId "NamedParameterNotFound,Microsoft.PowerShell.Commands.NewObjectCommand"
} else {
... |
combined_dataset/train/non-malicious/4181.ps1 | 4181.ps1 |
[CmdletBinding()]
param ()
function Get-CurrentDate {
[CmdletBinding()][OutputType([string])]
param ()
$CurrentDate = Get-Date
$CurrentDate = $CurrentDate.ToShortDateString()
$CurrentDate = $CurrentDate -replace "/", "-"
If ($CurrentDate[2] -ne "-") {
$CurrentDate = $CurrentDate.Insert(0, "0")
}
If ($C... |
combined_dataset/train/non-malicious/3270.ps1 | 3270.ps1 |
class Message {
[string]$Id
[MessageType]$Type = [MessageType]::Message
[MessageSubtype]$Subtype = [MessageSubtype]::None
[string]$Text
[string]$To
[string]$ToName
[string]$From
[string]$FromName ... |
combined_dataset/train/non-malicious/sample_65_51.ps1 | sample_65_51.ps1 | Get-Module | ForEach-Object { Remove-Module -Name $_.Name -Force }
$PSModuleAutoloadingPreference = 'none'
Import-Module Microsoft.PowerShell.Utility
#Enforcing default PSModulePath to avoid getting unexpected modules to run instead of built-in modules
$env:PSModulePath = "C:\Program Files\WindowsPowerShell\Modules... |
combined_dataset/train/non-malicious/2080.ps1 | 2080.ps1 |
Describe 'NestedModules' -Tags "CI" {
function New-TestModule {
param(
[string]$Name,
[string]$Content,
[string[]]$NestedContents
)
new-item -type directory -Force "TestDrive:\$Name" > $null
$manifestParams = @{
Path = "TestDrive:\$... |
combined_dataset/train/non-malicious/get windows product key_1.ps1 | get windows product key_1.ps1 | function get-windowsproductkey([string]$computer)
{
$Reg = [WMIClass] ("\\\\" + $computer + "\\root\\default:StdRegProv")
$values = [byte[]]($reg.getbinaryvalue(2147483650,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion","DigitalProductId").uvalue)
$lookup = [char[]]("B","C","D","F","G","H","J","K","M","P","Q","R"... |
combined_dataset/train/non-malicious/sample_31_71.ps1 | sample_31_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Onesubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_5_4.ps1 | sample_5_4.ps1 | <#
.SYNOPSIS
Biztalk Integration module for collecting traces
.DESCRIPTION
Define ETW traces for Windows Biztalk Integration components
Add any custom tracing functinaliy for tracing Biztalk components
For Developers:
1. Component test: .\TSS.ps1 -Start -INT_TEST1
2. Scenario test: .\TSS.ps1 -start -Sc... |
combined_dataset/train/non-malicious/sample_49_10.ps1 | sample_49_10.ps1 | #
# Module manifest for module 'OCI.PSModules.Announcementsservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Announcementsservice.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# S... |
combined_dataset/train/non-malicious/4262.ps1 | 4262.ps1 | function Invoke-TheHash
{
[CmdletBinding()]
param
(
[parameter(Mandatory=$true)][Array]$Targets,
[parameter(Mandatory=$false)][Array]$TargetsExclude,
[parameter(Mandatory=$true)][String]$Username,
[parameter(Mandatory=$false)][String]$Domain,
[parameter(Mandatory=$false)][String]$Service,
[para... |
combined_dataset/train/non-malicious/2825.ps1 | 2825.ps1 | function Send-BulkGraphiteMetrics
{
param
(
[CmdletBinding(DefaultParametersetName = 'Date Object')]
[parameter(Mandatory = $true)]
[string]$CarbonServer,
[parameter(Mandatory = $false)]
[ValidateRange(1, 65535)]
[int]$CarbonServerPort = 2003,
[paramete... |
combined_dataset/train/non-malicious/1853.ps1 | 1853.ps1 |
Describe "Get-Command Tests" -Tags "CI" {
BeforeAll {
function TestGetCommand-DynamicParametersDCR
{
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, Position = 0)]
[ValidateSet("ReturnNull", "ReturnThis", "Return1", "Return2","Return3", "ReturnDu... |
combined_dataset/train/non-malicious/3462.ps1 | 3462.ps1 |
function Test-Run
{
$dfname = Get-DataFactoryName
$rgname = Get-ResourceGroupName
$rglocation = Get-ProviderLocation ResourceManagement
$dflocation = Get-ProviderLocation DataFactoryManagement
$endDate = [DateTime]::Parse("04/08/2017")
$startDate = $endDate.AddDays(-10)
... |
combined_dataset/train/non-malicious/Unlock & Password Reset.ps1 | Unlock & Password Reset.ps1 | <#
Author: Matt Schmitt
Date: 11/28/12
Version: 1.0
From: USA
Email: ithink2020@gmail.com
Website: http://about.me/schmittmatt
Twitter: @MatthewASchmitt
Description
A script for forwarding and unforwarding email for users in Office 365.
#>
Import-Module ActiveD... |
combined_dataset/train/non-malicious/272.ps1 | 272.ps1 | function Connect-Office365
{
[CmdletBinding()]
PARAM (
)
BEGIN
{
TRY
{
IF (-not (Get-Module -Name MSOnline -ListAvailable))
{
Write-Verbose -Message "BEGIN - Import module Azure Active Directory"
Import-Module -Na... |
combined_dataset/train/non-malicious/sample_30_27.ps1 | sample_30_27.ps1 | @{
GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @('MSFT_MpPerformanceRecording.psm1')
FormatsToProcess = @(... |
combined_dataset/train/non-malicious/sample_65_96.ps1 | sample_65_96.ps1 | import{m as s}from"./index-D0knu95e.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-edit... |
combined_dataset/train/non-malicious/3489.ps1 | 3489.ps1 |
function Test-AzureRmDevSpacesController
{
$resourceGroupName = "rgps4504"
$kubeClusterName = "kubeps5496"
$devSpacesName = Get-DevSpacesControllerName
$tagKey = Get-DevSpacesControllerTagKey
$tagValue = Get-DevSpacesControllerTagValue
$referenceObject = @{}
$referenceObject.N... |
combined_dataset/train/non-malicious/sample_11_86.ps1 | sample_11_86.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
# TODO: Use Common functions for session re-use
... |
combined_dataset/train/non-malicious/sample_4_3.ps1 | sample_4_3.ps1 | <#
.SYNOPSIS
Scenario module for collecting machine licensing/activation related data
.DESCRIPTION
Collect machine licensing/activation related troubleshooting data
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedback : htt... |
combined_dataset/train/non-malicious/2244.ps1 | 2244.ps1 | [CmdletBinding()]
param(
[parameter(Mandatory=$true)]
$SiteServer,
[parameter(Mandatory=$true)]
$SiteCode,
[parameter(Mandatory=$true)]
$ComputerName,
[parameter(Mandatory=$true)]
$PastHours
)
$TimeFrame = [System.Management.ManagementDateTimeConverter]::ToDmtfDateTime((Get-Date).AddHours(-$PastHours))
$TSSummary = Ge... |
combined_dataset/train/non-malicious/sample_46_23.ps1 | sample_46_23.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_35_97.ps1 | sample_35_97.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=A szükséges PowerShell-modul (FailoverClusters) nem található. Használja a Szerepkörök és szolgáltatások területen látható eszközt a telepítéshez: Távoli kiszolgálófelügyelet eszközei | Szolgáltatás-felügyeleti eszközök | Feladatátvételi fürtszolgáltatás eszköze... |
combined_dataset/train/non-malicious/sample_21_29.ps1 | sample_21_29.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 = '77.0.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_0_13.ps1 | sample_0_13.ps1 | [dynamic, provider("dcismprovider")]
class DCIM_Role : CIM_Role
{
[
Description ("CreationClassName indicates the name of the class or the subclass that is used in the creation of an instance. When used with the other key properties of this class, this property allows all instances of this class and... |
combined_dataset/train/non-malicious/sample_43_56.ps1 | sample_43_56.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/Start-Timer_1.ps1 | Start-Timer_1.ps1 | A syntax error on your $Status array definition - you forgot the braces around the elements;
[string[]]$status=("Cooking","Burning")
cheers, yeatsie
## Start-Timer.ps1
## A kitchen timer script with visible countdown and customizable audio alert and messages
################################################... |
combined_dataset/train/non-malicious/1998.ps1 | 1998.ps1 |
Describe "Validate start of console host" -Tag CI {
BeforeAll {
if (-not $IsWindows) {
return
}
$csharp_source = @'
using System;
using System.Runtime.InteropServices;
public class ScreenReaderTestUtility {
private const ui... |
combined_dataset/train/non-malicious/sample_6_19.ps1 | sample_6_19.ps1 | # Rule ID 5135
# ---------
# http://sharepoint/sites/rules/Rule%20Submissions/Dynamics-CRM_ddevine_2012-08-15-08-30-43.xml
#
# Description
# -----------
# This checks the keys under HKLM\Software\Microsoft\MSCRM for the UR6 Upgrade keys
# If present, generate an alert. They are meant to only be in pla... |
combined_dataset/train/non-malicious/sample_25_55.ps1 | sample_25_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubsubscription.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported... |
combined_dataset/train/non-malicious/Start-IRCJabberBridge_1.ps1 | Start-IRCJabberBridge_1.ps1 | @@## Depends on the PoshXmpp.dll from http://CodePlex.com/PoshXmpp
@@#requires -pssnapin PoshXmpp
##########################################################################################
# @Author: Joel Bennnett
# @Usage:
# Start-JabberMirror.ps1 User@JabberServer.com Password "groupchat@oneserver.com" "groupcha... |
combined_dataset/train/non-malicious/sample_9_93.ps1 | sample_9_93.ps1 | ConvertFrom-StringData @'
id_ex_regkeysact=Exchange Server Registry Values
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBdKgjBTXIWaNR8
# ... |
combined_dataset/train/non-malicious/sample_42_83.ps1 | sample_42_83.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
function Register-EditorCommand {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]$Name,
... |
combined_dataset/train/non-malicious/2185.ps1 | 2185.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_33_64.ps1 | sample_33_64.ps1 | function Get-PerformanceProfile {
Param(
[Parameter(Mandatory = $false)]
$LaunchConfig
)
$ServiceUrl = Get-ServiceUrl -Method 'GetPerformanceProfile' -LaunchConfig $LaunchConfig
$Credential = Get-ALTestRunnerCredential -LaunchConfig $LaunchConfig
$PerformanceProfilePath = ... |
combined_dataset/train/non-malicious/sample_43_79.ps1 | sample_43_79.ps1 | /*!---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*----------------------------------------------------------*/
define(["require", "exports"], function (require, exports) {
/// <reference path="../../../Scripts/global.d.ts" />
});
// S... |
combined_dataset/train/non-malicious/1859.ps1 | 1859.ps1 |
function New-ModuleFromLayout
{
param(
[Parameter(Mandatory=$true)]
[hashtable]
$Layout,
[Parameter(Mandatory=$true)]
[string]
$BaseDir
)
if (-not (Test-Path $BaseDir))
{
$null = New-Item -Path $BaseDir -ItemType Directory
}
forea... |
combined_dataset/train/non-malicious/2796.ps1 | 2796.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
FullName,
LastWriteTimeUtc,
PSComputerName
FROM
*PrefetchListing.tsv
ORDER BY
LastWriteTimeUtc Desc
"@
& logparser -stats:off -i:csv -fixedsep:on -dtlines:0 -rtp:-1 $lpquery
} else {
$ScriptName = ... |
combined_dataset/train/non-malicious/sample_9_33.ps1 | sample_9_33.ps1 | ConvertFrom-StringData @'
id_clusterrelatedevtlogs=Event Logs - Failover Cluster
id_clusterrelatedevtlogsStorage=Event Logs - Storage
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIB... |
combined_dataset/train/non-malicious/get-DiskVolumeInfo_1.ps1 | get-DiskVolumeInfo_1.ps1 | function get-DiskVolumeInfo
{
<#
.SYNOPSIS
Returns information about disk volumes including freespace
.DESCRIPTION
Returns information about disk volumes including freespace
.EXAMPLE
show-InnerException ExceptionObject
Shows the in... |
combined_dataset/train/non-malicious/sample_27_94.ps1 | sample_27_94.ps1 | ConvertFrom-StringData @'
###PSLOC
TestMgmtSubnetPass = Start IP '{0}' and End IP '{1}' on the same subnet
TestMgmtSubnetFail = Start IP '{0}' and End IP '{1}' not on the same subnet
TestMgmtRangeSizePass = IP range within minmum '{0}' and maximum '{1}'
TestMgmtRangeSizeFail = IP range not within minmum '{0}' and ... |
combined_dataset/train/non-malicious/4251.ps1 | 4251.ps1 |
function Get-ModifiableFile {
[CmdletBinding()]
Param(
[Parameter(ValueFromPipeline=$True, Mandatory = $True)]
[String]
$Path
)
begin {
$Excludes = @("MsMpEng.exe", "NisSrv.exe")
$OrigError = $ErrorActionPreference
$ErrorActionPrefere... |
combined_dataset/train/non-malicious/4389.ps1 | 4389.ps1 | function Test-RunningAsElevated
{
[CmdletBinding()]
[OutputType([bool])]
Param()
if(-not $script:IsRunningAsElevatedTested -and $script:IsRunningAsElevated)
{
if($script:IsWindows)
{
$wid=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$prp=new-obj... |
combined_dataset/train/non-malicious/Snippet Compiler_4.ps1 | Snippet Compiler_4.ps1 | $def = $(if ((gi .).FullName -eq (gi .).Root) {
([string](gi .).Root).TrimEnd("\\")
}
else { (gi .).FullName }
)
##################################################################################################
function Get-CursorPoint {
$x = $rtbEdit.SelectionStart - $... |
combined_dataset/train/non-malicious/714.ps1 | 714.ps1 |
function Set-RsRestItemDataSource
{
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')]
param(
[Parameter(Mandatory = $True)]
[Alias('ItemPath','Path')]
[string]
$RsItem,
[Parameter(Mandatory = $True)]
[ValidateSet("PowerBIReport", "... |
combined_dataset/train/non-malicious/sample_55_67.ps1 | sample_55_67.ps1 | ##########################################################################
# DELL PROPRIETARY INFORMATION
#
# This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this
# software to you under the terms of a license agreement,nondisclosure agreement or both.
# You may not copy, disclose, o... |
combined_dataset/train/non-malicious/sample_27_82.ps1 | sample_27_82.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicecatalog'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicecatalog.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSE... |
combined_dataset/train/non-malicious/sample_62_45.ps1 | sample_62_45.ps1 | Get-Module | ForEach-Object { Remove-Module -Name $_.Name -Force }
$PSModuleAutoloadingPreference = 'none'
Import-Module Microsoft.PowerShell.Utility
#Enforcing default PSModulePath to avoid getting unexpected modules to run instead of built-in modules
$env:PSModulePath = "C:\Program Files\WindowsPowerShell\Modules... |
combined_dataset/train/non-malicious/finddupe_22.ps1 | finddupe_22.ps1 | 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
try
{
$stream = $file.OpenRead()
}
... |
combined_dataset/train/non-malicious/sample_4_37.ps1 | sample_4_37.ps1 | param(
[string]$DataPath,
[switch]$AcceptEula,
[switch]$SkipLogs,
[switch]$Trace,
[switch]$Network,
[switch]$RPC,
[switch]$ProcMon,
[switch]$PSR
)
<#
COM-COLLECT
ALIAS : bpostaci, maporcol
Date : 15/11/2023
Updates:
v1.0 | Initial release
v1.1 | 2023... |
combined_dataset/train/non-malicious/Check-ClusterPatches.ps1 | Check-ClusterPatches.ps1 |
## Check-ClusterPatches.ps1
param($ClusterNode=$Env:ComputerName)
$Patches = @{}
$PatchList = $Null
$PatchListComplete = $Null
$Results = @()
Write-Host "Getting Nodes via WMI..." -foregroundcolor Green
$Nodes = Get-WmiObject -computerName $ClusterNode -namespace ROOT\\MSCluster -class MSCluster_Node | S... |
combined_dataset/train/non-malicious/sample_26_90.ps1 | sample_26_90.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'https://aka... |
combined_dataset/train/non-malicious/sample_6_38.ps1 | sample_6_38.ps1 | ConvertFrom-StringData @'
id_surfacepro3detectconnectedstandbyhibernationconfig=Detect Surface Pro 3 Connected Standby Hibernation Configuration Issue
id_surfacepro3detectconnectedstandbyhibernationconfigdesc=Detected Surface Pro 3 Connected Standby Hibernation Configuration Issue.
'@
# SIG # Begin signature bloc... |
combined_dataset/train/non-malicious/sample_39_50.ps1 | sample_39_50.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=找不到所需的 PowerShell 模块(FailoverClusters)。使用“角色和功能”工具安装: 远程服务器管理工具 | 功能管理工具 | 故障转移群集工具 | Windows PowerShell 故障转移群集模块。
'@
# SIG # Begin signature block
# MIIn0AYJKoZIhvcNAQcCoIInwTCCJ70CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCY... |
combined_dataset/train/non-malicious/Convert-ToCHexString.ps1 | Convert-ToCHexString.ps1 | function Convert-ToCHexString {
param([String] $input
$ans = ''
[System.Text.Encoding]::ASCII.GetBytes($str) | % { $ans += "0x{0:X2}, " -f $_ }
return $ans.Trim(',',' ')
}
|
combined_dataset/train/non-malicious/Hash Checker_2.ps1 | Hash Checker_2.ps1 | #.Synopsis
# Test the HMAC hash(es) of a file
#.Description
# Takes the HMAC hash of a file using specified algorithm, and optionally, compare it to a baseline hash
#.Example
# Test-Hash npp.5.3.1.Installer.exe -HashFile npp.5.3.1.release.md5
#
# Searches the provided hash file for a line matching the "... |
combined_dataset/train/non-malicious/2456.ps1 | 2456.ps1 |
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[ValidateScript({ Test-Path -Path $_ -PathType 'Leaf' })]
[string]$FilePath,
[Parameter()]
[string]$Arguments,
[switch]$Force
)
begin {
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
function New-OnBootScheduledTask {
[CmdletBinding()]
... |
combined_dataset/train/non-malicious/308.ps1 | 308.ps1 | function Register-PSFTeppScriptblock
{
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFTeppScriptblock')]
Param (
[Parameter(Mandatory = $true)]
[System.Management.Automation.ScriptBlock]
$ScriptBlock,
[Parameter(Mandatory = $true)]
[string]
$Name,
... |
combined_dataset/train/non-malicious/sample_10_47.ps1 | sample_10_47.ps1 | @{
GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @('MSFT_MpPerformanceRecording.psm1')
FormatsToProcess = @(... |
combined_dataset/train/non-malicious/sample_35_62.ps1 | sample_35_62.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
param(
[ValidateSet('Hang', 'Fail')]
$TestHook
)
$waitTimeoutSeconds = 300
switch ($TestHook) {
'Hang' {
$waitTimeoutSeconds = 10
$jobScript = { Start-Sleep -Seconds 600 }
}
'Fail' {
$jo... |
combined_dataset/train/non-malicious/sample_26_54.ps1 | sample_26_54.ps1 | #
# Module manifest for module 'DscInstall'
#
# Generated by: Zia Jalali
#
# Generated on: 07/31/2017
#
@{
# Script module or binary module file associated with this manifest.
ModuleToProcess = 'Heartbeat.psm1'
# Version number of this module.
ModuleVersion = '1.1'
# ID used to uniquely identify thi... |
combined_dataset/train/non-malicious/Page-Output 1.1.ps1 | Page-Output 1.1.ps1 | ## Page (aka More, aka Page-Output)
###################################################################################################
## This is like a (very simple) "more" script for PowerShell ...
## The problem with it is that you're paging by a count of objects, not by how many lines of text
## they'll outp... |
combined_dataset/train/non-malicious/sample_59_14.ps1 | sample_59_14.ps1 | # Import the helper functions
Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false
function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param
(
[parameter(Mandatory = $true)]
[System.String]
$Category
)
#Write-Verbose "Use this cmdlet t... |
combined_dataset/train/non-malicious/sample_18_63.ps1 | sample_18_63.ps1 | #
# Module manifest for module 'OCI.PSModules.Vnmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vnmonitoring.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_24_39.ps1 | sample_24_39.ps1 | #
# Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker'
#
# Generated by: Microsoft Corporation
#
# Generated on: 19/01/2022
#
@{
# Script module or binary module file associated with this manifest.
RootModule = ''
# Version number of this module.
ModuleVersion = '1.2100.25... |
combined_dataset/train/non-malicious/604.ps1 | 604.ps1 |
function Send-PPErrorReport{
param(
[Parameter(Mandatory=$true)]
[String]
$FileName,
[Parameter(Mandatory=$true)]
[String]
$ScriptName,
[switch]
$ClearErrorVariable
)
if($Error){
$Error
$Body = ""
$Error | foreach{$Body += $_.ToString() + $_.InvocationIn... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.