full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/2360.ps1 | 2360.ps1 |
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$ComputerName
)
try
{
$script:SessionEvents = @(
@{ 'Label' = 'Logon'; 'EventType' = 'SessionStart'; 'LogName' = 'Security'; 'ID' = 4624 }
@{ 'Label' = 'Logoff'; 'EventType' = 'SessionStop'; 'LogName' = 'Security'; 'ID... |
combined_dataset/train/non-malicious/sample_39_9.ps1 | sample_39_9.ps1 | <##############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
###########################################################... |
combined_dataset/train/non-malicious/1273.ps1 | 1273.ps1 |
function Resolve-CRelativePath
{
[CmdletBinding()]
param(
[Parameter(ValueFromPipelineByPropertyName=$true)]
[string]
[Alias('FullName')]
$Path,
[Parameter(Mandatory=$true,ParameterSetName='FromDirectory')]
[string]
$FromDi... |
combined_dataset/train/non-malicious/sample_27_45.ps1 | sample_27_45.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_3_30.ps1 | sample_3_30.ps1 | ConvertFrom-StringData @'
id_2k3poolusagemaximum_sd=Memory Manager trimming process threshold currently set on this machine
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAI... |
combined_dataset/train/non-malicious/sample_29_56.ps1 | sample_29_56.ps1 | $resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent
# Import localization helper functions.
$helperName = 'PowerShellGet.LocalizationHelper'
$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1"
Import-Module -Name $... |
combined_dataset/train/non-malicious/sample_60_78.ps1 | sample_60_78.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_17_64.ps1 | sample_17_64.ps1 | ConvertFrom-StringData @'
id_clusterdependencyreport=Cluster resource dependency report
id_clusterdependencyreportdesc1=Obtaining cluster resource dependency report
id_clusterdependencyreportdesc=Obtaining cluster resource dependency report from group %GroupName%
'@
# SIG # Begin signature block
# MIIoUgYJKoZIh... |
combined_dataset/train/non-malicious/Open-ISEFile Posh v3.ps1 | Open-ISEFile Posh v3.ps1 | #Requires -Version 3.0
function Open-ISEFile {
<#
.NOTES
Name: Open-ISEFile
Author: Tome Tanasovski
Created: 6/20/2010
Version: 2.0a
History: 1.0 6/20/2010 Initial Release
2.0 4/1/2012
Updated for v3
Added support to launch in ISE even if you are not in an ... |
combined_dataset/train/non-malicious/Test-Transcribing.ps1 | Test-Transcribing.ps1 | #requires -version 2.0
function Test-Transcribing {
$externalHost = $host.gettype().getproperty("ExternalHost",
[reflection.bindingflags]"NonPublic,Instance").getvalue($host, @())
try {
$consoleHost.gettype().getproperty("IsTranscribing",
[reflection.bindingflags]"NonPublic,Instance").getvalue($con... |
combined_dataset/train/non-malicious/2500.ps1 | 2500.ps1 |
function SQL-Query{
param([string]$Query,
[string]$SqlServer = $DEFAULT_SQL_SERVER,
[string]$DB = $DEFAULT_SQL_DB,
[string]$RecordSeparator = "`t")
$conn_options = ("Data Source=$SqlServer; Initial Catalog=$DB;" + "Integrated Security=SSPI")
$conn = New-Object System.Data.SqlClient.SqlConnection($conn_opt... |
combined_dataset/train/non-malicious/sample_4_47.ps1 | sample_4_47.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/Invoke-SqlCmd_7.ps1 | Invoke-SqlCmd_7.ps1 | #######################
<#
.SYNOPSIS
Runs a T-SQL script.
.DESCRIPTION
Runs a T-SQL script. Invoke-Sqlcmd2 only returns message output, such as the output of PRINT statements when -verbose parameter is specified.
Paramaterized queries are supported.
.INPUTS
None
You cannot pipe objects to Invoke-Sq... |
combined_dataset/train/non-malicious/sample_31_1.ps1 | sample_31_1.ps1 | #!powershell
# Copyright: (c) 2015, Corwin Brown <corwin.brown@maxpoint.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSCustomUseLiteralPath', '',
Justificat... |
combined_dataset/train/non-malicious/sample_36_40.ps1 | sample_36_40.ps1 | #
# Module manifest for module 'OCI.PSModules.Opsi'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Opsi.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_26_47.ps1 | sample_26_47.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 = '80.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/ASPX Mailbox (4 of 6).ps1 | ASPX Mailbox (4 of 6).ps1 | using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
using System.Net.Mail;
using System.Text.RegularExpressions;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Mailb... |
combined_dataset/train/non-malicious/1377.ps1 | 1377.ps1 |
function Enable-CAclInheritance
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
[Alias('PSPath')]
[string]
$Path,
[Switch]
$Preserve
... |
combined_dataset/train/non-malicious/1572.ps1 | 1572.ps1 |
function Invoke-MrPesterToSpeech {
[CmdletBinding()]
param (
[switch]$Quiet
)
$Params = @{}
if ($PSBoundParameters.Quiet) {
$Params.Quiet = $true
}
$Results = Invoke-Pester -PassThru @Params |
Select-Object -ExpandProperty TestResult
foreach ($Result in $Results) ... |
combined_dataset/train/non-malicious/sample_46_20.ps1 | sample_46_20.ps1 | #
# Module manifest for module 'OCI.PSModules.Loadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loadbalancer.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_41_61.ps1 | sample_41_61.ps1 | #
# Module manifest for module 'OCI.PSModules.Jms'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jms.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_5_80.ps1 | sample_5_80.ps1 | ConvertFrom-StringData @'
id_dcpromologs=DCPromo
id_dcpromologsobtaining=Obtaining DCPromo log files
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlA... |
combined_dataset/train/non-malicious/949.ps1 | 949.ps1 |
$apiVersion = "2015-04-08"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$keyspaceName = "keyspace1"
$tableName = "table1"
$keyspaceThroughputResourceType = "Microsoft.DocumentDb/databaseAccounts/apis/keyspaces/settings"
$keyspaceThroughputResourceName = $accountName + "/cassandra/" + $keyspa... |
combined_dataset/train/non-malicious/sample_54_8.ps1 | sample_54_8.ps1 | #
# Module manifest for module 'OCI.PSModules.Fleetsoftwareupdate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fleetsoftwareupdate.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Sup... |
combined_dataset/train/non-malicious/433da2cf-0b3d-481c-827e-375cf9760770.ps1 | 433da2cf-0b3d-481c-827e-375cf9760770.ps1 | function Get-ParameterEnum
{
<#
.Synopsis
Displays enumeration values for specific parameter.
.Description
For provided combination of cmdlet/parameter displays all possible values. Parameter has to be
enumeration type. Displays also numeric value and enumeration name.
.Parameter Cmdlet
Name of... |
combined_dataset/train/non-malicious/3005.ps1 | 3005.ps1 | Set-StrictMode -Version Latest
if ($PSVersionTable.PSVersion.Major -lt 6 -or $IsWindows) {
$tempPath = $env:TEMP
}
elseif ($IsMacOS) {
$tempPath = '/private/tmp'
}
else {
$tempPath = '/tmp'
}
Describe "Setup" {
It "returns a location that is in a temp area" {
$testDrivePath = (Get-Item $TestDr... |
combined_dataset/train/non-malicious/4363.ps1 | 4363.ps1 | function Log-ArtifactNotFoundInPSGallery
{
[CmdletBinding()]
Param
(
[Parameter()]
[string[]]
$SearchedName,
[Parameter()]
[string[]]
$FoundName,
[Parameter(Mandatory=$true)]
[string]
$operationName
)
if (-not $script:Telemet... |
combined_dataset/train/non-malicious/sample_28_17.ps1 | sample_28_17.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=此名称和类型的环境变量已存在。
EnvironmentErrorDoesNotExists=此名称和类型的环境变量不存在。
'@
# SIG # Begin signature block
# MIIoPQYJKoZIhvcNAQcCoIIoLjCCKCoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIB... |
combined_dataset/train/non-malicious/4ddb6e30-dac0-481f-b6b5-547139c8a98a.ps1 | 4ddb6e30-dac0-481f-b6b5-547139c8a98a.ps1 | Coresponding to the Scripting Guy blog "How Can I Both Save Information in a File and Display It on the Screen?"
(http://blogs.technet.com/heyscriptingguy/archive/2009/07/07/hey-scripting-guy-how-can-i-both-save-information-in-a-file-and-display-it-on-the-screen.aspx):
My comment is:
All of the above is cool but can... |
combined_dataset/train/non-malicious/sample_52_51.ps1 | sample_52_51.ps1 | #
# Module manifest for module 'OCI.PSModules.Managementagent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Managementagent.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_52_97.ps1 | sample_52_97.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
# MIIoKQYJKoZIhvcNAQcCoIIoGjCCKBYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwE... |
combined_dataset/train/non-malicious/SSL Oblivious Web Client_1.ps1 | SSL Oblivious Web Client_1.ps1 | function New-TrustAllWebClient {
# Create a compilation environment
$Provider=New-Object Microsoft.CSharp.CSharpCodeProvider
$Compiler=$Provider.CreateCompiler()
$Params=New-Object System.CodeDom.Compiler.CompilerParameters
$Params.GenerateExecutable=$False
$Params.GenerateInMemory=$True
$Params.IncludeDe... |
combined_dataset/train/non-malicious/20.ps1 | 20.ps1 |
. $PSScriptRoot\Shared.ps1
Describe 'Get-GitStatus Tests' {
Context 'Get-GitStatus Working Directory Tests' {
BeforeAll {
Set-Location $PSScriptRoot
}
It 'Returns the correct branch name' {
Mock -ModuleName posh-git git {
$OFS = " "
... |
combined_dataset/train/non-malicious/79.ps1 | 79.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aa... |
combined_dataset/train/non-malicious/1623.ps1 | 1623.ps1 |
function Get-LogonStatus ($computer = $env:COMPUTERNAME) {
$hash = @{
Computer = $computer
Name = '-'
User = '-'
Status = '-'
}
$obj = gwmi win32_computersystem -ComputerName $computer -ea 0
$hash.User = $obj.username
$hash.Name = $obj.name
try {
epsr ... |
combined_dataset/train/non-malicious/1168.ps1 | 1168.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'Install-Junction' {
$tempDir = Get-Item -Path 'TestDrive:'
$junctionPath = $null
function Assert-Junction
{
param(
$ExpectedTarget = $PSScriptRoot
)
... |
combined_dataset/train/non-malicious/3957.ps1 | 3957.ps1 |
function Check-CmdletReturnType
{
param($cmdletName, $cmdletReturn)
$cmdletData = Get-Command $cmdletName;
Assert-NotNull $cmdletData;
[array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") };
[arra... |
combined_dataset/train/non-malicious/8eb8f683-4672-43f6-ae5a-77f76eb77c88.ps1 | 8eb8f683-4672-43f6-ae5a-77f76eb77c88.ps1 | #You Need Quest AD Powershell Plugin
#You Need VMWare VI Toolkit
$Null = Connect-VIServer Your-VM-Server-Here;
$Servers = New-Object System.Collections.ArrayList
$Null = Get-QADComputer -SearchRoot 'your.domain.com/Path/To/Server/OU' | Select-Object -property Name | Format-Table -HideTableHeaders| Out-String... |
combined_dataset/train/non-malicious/sample_41_7.ps1 | sample_41_7.ps1 | # Copyright 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 use, modify, copy, publish, distribute, discl... |
combined_dataset/train/non-malicious/3693.ps1 | 3693.ps1 |
function Test-ProviderShareSubscriptionGrantAndRevoke
{
$resourceGroup = getAssetName
$AccountName = getAssetName
$ShareName = getAssetName
$ShareSubId = getAssetName
$resourceId = getAssetName
$revoked = Revoke-AzDataShareSubscriptionAccess -ResourceGroupName $resourceGroup -AccountNa... |
combined_dataset/train/non-malicious/sample_12_53.ps1 | sample_12_53.ps1 | ConvertFrom-StringData @'
id_sandev=Computer Storage Information
id_sanstorageinfooutput=SAN utility output
id_sanstorageinfooutputdesc=Storage Information
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7Y... |
combined_dataset/train/non-malicious/LNK file testing.ps1 | LNK file testing.ps1 | param(
$Path = (Split-Path $PSHOME -Qualifier)
)
if($lnks -eq $null) {
$lnks = ls -Recurse $Path | ?{$_.extension.tolower() -eq ".lnk"}
}
$wsh = New-Object -ComObject WScript.Shell;
foreach($lnk in $lnks) {
$lnko = $wsh.CreateShortcut($lnk.fullname);
$rtn = New-Object psobject -Property... |
combined_dataset/train/non-malicious/Add-SharePointLibraryFil.ps1 | Add-SharePointLibraryFil.ps1 | Add-SharePointLibraryFile
{
param
(
[System.IO.FileInfo] $File,
[System.Uri] $DocumentLibraryUrl = $(throw "Parameter -DocumentLibraryUrl [System.Uri] is required.")
)
Begin
{ }
Process
{
if($_)
{
$File = [System.IO.FileInfo] $_
}
if (!$File.Exists)
{
Write-Error ($... |
combined_dataset/train/non-malicious/1527.ps1 | 1527.ps1 |
function Assert-NodeDoesNotExist
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,Position=0)]
[xml]
$Xml,
[Parameter(Mandatory=$true,Position=1)]
[string]
$XPath,
[Parameter(Position=2)]
[string]
... |
combined_dataset/train/non-malicious/sample_21_37.ps1 | sample_21_37.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/sample_29_95.ps1 | sample_29_95.ps1 | #
# Module manifest for module 'OCI.PSModules.Sch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Sch.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/3074.ps1 | 3074.ps1 | function MiValidator($thing_to_validate) {
return $thing_to_validate.StartsWith("s")
}
function Invoke-SomethingThatUsesMiValidator {
param(
[ValidateScript( {MiValidator $_})]
$some_param
)
}
|
combined_dataset/train/non-malicious/1313.ps1 | 1313.ps1 |
function Invoke-CAppCmd
{
[CmdletBinding()]
param(
[Parameter(ValueFromRemainingArguments=$true)]
$AppCmdArgs
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
Write-Warning ('Invoke-CAppCmd is ... |
combined_dataset/train/non-malicious/Get-ServiceAccounts.ps1 | Get-ServiceAccounts.ps1 | #requires -pssnapin PSCX
#Author: Glenn Sizemore gesize@get-admin.com
#Purpose: Scan a remote system for any services running under a non standard account.
# Standard accounts would be considered, NT AUTHORITY\\NetworkService,
# NT AUTHORITY\\LocalService, LocalSystem, or .\\ASPNET
# ... |
combined_dataset/train/non-malicious/sample_56_75.ps1 | sample_56_75.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
function Unpublish-ServiceFab... |
combined_dataset/train/non-malicious/4321.ps1 | 4321.ps1 | function Get-InstalledModuleAuthenticodeSignature
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[PSModuleInfo]
$InstalledModuleInfo,
[Parameter(Mandatory=$true)]
[string]
$InstallLocation
)
$ModuleName = $InstalledModuleInfo.Name
... |
combined_dataset/train/non-malicious/PowerCLI error report_1.ps1 | PowerCLI error report_1.ps1 | $getVmScript = {
Connect-VIServer yourVCenterServer
Get-VM
}
$ getVmScript | Get-ErrorReport -ProblemScriptTimeoutSeconds 60 -ProblemDescription "Get-VM hangs when trying to retrieve all the VMs form the server. The server’s inventory can be successfully browsed via the vClient." -Destination 'D:\\bug report'
... |
combined_dataset/train/non-malicious/2617.ps1 | 2617.ps1 |
param([string[]]$SqlNodes)
Configuration SQLServer{
param([string[]] $ComputerName)
Import-DscResource -Module xNetworking
Import-DscResource –ModuleName 'PSDesiredStateConfiguration'
Node $ComputerName {
File DataDir{
DestinationPath = 'C:\DBFiles\Data'
Type = ... |
combined_dataset/train/non-malicious/sample_57_85.ps1 | sample_57_85.ps1 | #
# Module manifest for module 'OCI.PSModules.Ospgateway'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ospgateway.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_17_92.ps1 | sample_17_92.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicemesh'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicemesh.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_51_47.ps1 | sample_51_47.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#####################################################################################################
#
# Registers the WinRM endpoint for this instance of PowerShell.
#
# If the parameters '-PowerShellHome' were specified, it means that t... |
combined_dataset/train/non-malicious/CreateVDS.ps1 | CreateVDS.ps1 | function CreateVDS(
$dvsName, $datacenter, $vmHost, $physicalNic, $portGroupType = "earlyBinding", `
[array]$portGroupNameList = @(),[array]$uplinkList = @() ) {
# ------- Create vDS ------- #
$dvsCreateSpec = New-Object VMware.Vim.DVSCreateSpec
$dvsCreateSpec.configSpec = New-Object VMware.V... |
combined_dataset/train/non-malicious/sample_0_24.ps1 | sample_0_24.ps1 | #
# Module manifest for module 'OCI.PSModules.Ailanguage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ailanguage.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_54_22.ps1 | sample_54_22.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... |
combined_dataset/train/non-malicious/334.ps1 | 334.ps1 | function Compare-PSFArray
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseOutputTypeCorrectly", "")]
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, Position = 0)]
[object[]]
$ReferenceObject,
[Parameter(Mandatory = $true, Position = 1)]
[object[]]
$DifferenceObject,
[swit... |
combined_dataset/train/non-malicious/ConvertTo-Module.ps1 | ConvertTo-Module.ps1 | function ConvertTo-Module {
<#
.SYNOPSIS
Quickly convert a .NET type's static methods into functions
.DESCRIPTION
Quickly convert a .NET type's static methods into functions.
This function returns a PSModuleInfo, so you should pipe its
output to Import-Module to use the exported f... |
combined_dataset/train/non-malicious/sample_15_97.ps1 | sample_15_97.ps1 | # Copyright (c), Michael DeHaan <michael.dehaan@gmail.com>, 2014, and others
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
Set-StrictMode -Version 2.0
$ErrorActionPreference = "Stop"
Function Set-Attr($obj, $name, $value) {
<#
.SYNOPSIS
Helper f... |
combined_dataset/train/non-malicious/782.ps1 | 782.ps1 |
function Out-CurrentFile {
[CmdletBinding()]
param(
[Switch]$AsNewFile,
[Parameter(ValueFromPipeline, Mandatory = $true)]
$InputObject
)
Begin { $objectsToWrite = @() }
Process { $objectsToWrite += $InputObject }
End {
if ($AsNewFile) {
... |
combined_dataset/train/non-malicious/sample_38_85.ps1 | sample_38_85.ps1 | function New-AzDataProtectionPolicyTagCriteriaClientObject{
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IScheduleBasedBackupCriteria')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates a new criteria objec... |
combined_dataset/train/non-malicious/sample_5_35.ps1 | sample_5_35.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 = '92.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_47_57.ps1 | sample_47_57.ps1 | #
# Module manifest for module 'OCI.PSModules.Desktops'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Desktops.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/UIAutomation 1.3.ps1 | UIAutomation 1.3.ps1 | # #
# Select-Window Notepad | Remove-Window -passthru #
# ## And later ... #
# Select-Wi... |
combined_dataset/train/non-malicious/sample_39_34.ps1 | sample_39_34.ps1 | @{
GUID="{Fb6cc51d-c096-4b38-b78d-0fed6277096a}"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
RootModule="Microsoft.Management.Infrastructure.CimCmdlets"
RequiredAssembli... |
combined_dataset/train/non-malicious/sample_38_70.ps1 | sample_38_70.ps1 | #
# Module manifest for module 'OCI.PSModules.Mysql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Mysql.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/1464.ps1 | 1464.ps1 |
[CmdletBinding()]
param(
)
Set-StrictMode -Version Latest
$PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
if( (Get-Module Silk) )
{
Remove-Module Silk
}
Import-Module (Join-Path $PSScriptRoot Silk.psd1 -Resolve) -ErrorAction Stop
|
combined_dataset/train/non-malicious/sample_20_24.ps1 | sample_20_24.ps1 | ConvertFrom-StringData @'
id_waitingprocessfinish=Waiting for diagnostic processes to finish
id_waitingprocessfinishdesc=Waiting for background processes to complete. This can take a few minutes.
id_waitingprocessinginfo=Processing Information
id_waitingprocessinginfodesc=Preparing information to be collected
id_r... |
combined_dataset/train/non-malicious/1450.ps1 | 1450.ps1 |
function Install-CPerformanceCounter
{
[CmdletBinding(SupportsShouldProcess=$true,DefaultParameterSetName='SimpleCounter')]
param(
[Parameter(Mandatory=$true)]
[string]
$CategoryName,
[Parameter(Mandatory=$true)]
[string]
$Name,
... |
combined_dataset/train/non-malicious/645.ps1 | 645.ps1 | function Get-CredentialType() {
$wmiObject = New-RsConfigurationSettingObject -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext
switch ($wmiObject.DatabaseLogonType) {
0 { return 'Windows' }
1 { return 'SQL' }
2 { return 'ServiceAccount' }
default { throw 'Invalid C... |
combined_dataset/train/non-malicious/PS file locking.ps1 | PS file locking.ps1 | #################################################
#Scriptname: checklock.ps1
#Author: Michael Rüefli (www.miru.ch)
#Date: 21.11.2009
#Description: The code uses a file locking mechanism to ensure that the
# script beeing started is running exclusively. Mostly used where
# ... |
combined_dataset/train/non-malicious/4234.ps1 | 4234.ps1 | $idletime = $null
Function Get-IdleTime {
if ($idletime -ne "TRUE") {
$script:idletime = "TRUE"
echo "Loading Assembly"
$PS = "TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAATAED... |
combined_dataset/train/non-malicious/sample_25_7.ps1 | sample_25_7.ps1 | #
# Module manifest for module 'OCI.PSModules.Operatoraccesscontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Operatoraccesscontrol.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
#... |
combined_dataset/train/non-malicious/New-RDCManFile.ps1 | New-RDCManFile.ps1 | ###########################################################################
#
# NAME: New-RDCManFile.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jer@powershell.no
#
# COMMENT: Script to create a XML-file for use with Microsoft Remote Desktop Connection Manager
# For more details, see the following blog-post... |
combined_dataset/train/non-malicious/sample_22_10.ps1 | sample_22_10.ps1 | #
# Module manifest for module 'OCI.PSModules.Dashboardservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dashboardservice.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported... |
combined_dataset/train/non-malicious/3658.ps1 | 3658.ps1 |
function Test-CreateElasticPool
{
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
$rg = Create-ResourceGroupForTest $location
$server = Create-ServerForTest $rg $location
try
{
$poolName = Get-ElasticPoolName
$job = New-AzSqlElasticPool -ServerName $server.Server... |
combined_dataset/train/non-malicious/1017.ps1 | 1017.ps1 |
$random = (New-Guid).ToString().Substring(0,8)
$subscriptionId = "my-azure-subscription-id"
$apimServiceName = "apim-$random"
$resourceGroupName = "apim-rg-$random"
$location = "Japan East"
$organisation = "Contoso"
$adminEmail = "admin@contoso.com"
Select-AzSubscription -SubscriptionId $subscriptionId
New... |
combined_dataset/train/non-malicious/sample_46_50.ps1 | sample_46_50.ps1 | #
# Module manifest for module 'OCI.PSModules.Fleetsoftwareupdate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fleetsoftwareupdate.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Sup... |
combined_dataset/train/non-malicious/752.ps1 | 752.ps1 |
param(
[Parameter(Mandatory)]
[string]
$GitHubToken,
[Parameter(Mandatory)]
[version]
$ExtensionVersion,
[Parameter()]
[string[]]
$GalleryFileName = ('extensionsGallery.json','extensionsGallery-insider.json'),
[Parameter()]
[string]
$SourceFork = 'rjmholt',
[... |
combined_dataset/train/non-malicious/Deploy VM with Static IP_2.ps1 | Deploy VM with Static IP_2.ps1 | # 1. Create a simple customizations spec:
$custSpec = New-OSCustomizationSpec -Type NonPersistent -OSType Windows `
-OrgName “My Organization” -FullName “MyVM” -Domain “MyDomain” `
–DomainAdminUsername “user” –DomainAdminPassword “password”
# 2. Modify the default network customization settings:
$custSpe... |
combined_dataset/train/non-malicious/151.ps1 | 151.ps1 | function Get-ISEShortCut
{
PARAM($Key,$Name)
BEGIN
{
function Test-IsISE
{
try
{
return $psISE -ne $null;
}
catch
{
return $false;
}
}
}
PROCESS
{
if ($(Test-IsISE) -eq $true)
{
$gps = $psISE.GetType().Assembly
$rm = New-Object System.Resources.ResourceM... |
combined_dataset/train/non-malicious/Get-PasswordExpiredUser.ps1 | Get-PasswordExpiredUser.ps1 | $filter = "(&(objectCategory=user)(userAccountControl:1.2.840.113556.1.4.803:=65536))"
$ds = new-object directoryservices.directorysearcher([adsi]"",$filter)
$users = $ds.findall()
$users | format-table @{l="User";e={$_.properties.item('cn')}},
@{l="sAMAccountName";e={$_.properties.item('sAMAc... |
combined_dataset/train/non-malicious/sample_25_45.ps1 | sample_25_45.ps1 | #
# Module manifest for module 'OCI.PSModules.Streaming'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Streaming.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/1240.ps1 | 1240.ps1 |
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,Position=0)]
[string]
$Name,
[Parameter(Mandatory=$true,Position=1)]
[string]
$Value,
[Parameter(Position=2)]
[string]
$ProviderName
)
Set-StrictMode -Version 'Latest'
$Name = [Text.Encoding]::Unicode.GetString( [C... |
combined_dataset/train/non-malicious/397.ps1 | 397.ps1 |
$PSF_OnRemoveScript = {
if ([runspace]::DefaultRunspace.Id -eq 1)
{
Wait-PSFMessage -Timeout 30s -Terminate
Get-PSFRunspace | Stop-PSFRunspace
[PSFramework.PSFCore.PSFCoreHost]::Uninitialize()
}
$psframework_pssessions.Values | Remove-PSSession
[PSFramework.FlowControl.CallbackHost]::RemoveRunspaceO... |
combined_dataset/train/non-malicious/4463.ps1 | 4463.ps1 |
function Save-PSResource {
[OutputType([void])]
[cmdletbinding(SupportsShouldProcess = $true)]
Param
(
[Parameter(Mandatory = $true,
ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true,
Position = 0,
ParameterSetName = 'Nam... |
combined_dataset/train/non-malicious/3192.ps1 | 3192.ps1 | function Join-Object
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true,
ValueFromPipeLine = $true)]
[object[]] $Left,
[Parameter(Mandatory=$true)]
[object[]] $Right,
[Parameter(Mandatory = $true)]
[string] $LeftJoinPrope... |
combined_dataset/train/non-malicious/sample_34_67.ps1 | sample_34_67.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 = '77.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/Test-BufferBox 2.0.ps1 | Test-BufferBox 2.0.ps1 | ## Test-BufferBox 2.0
####################################################################################################
## This script is just a demonstration of some of the things you can do with the buffer
## in the default PowerShell host... it serves as a reminder of how much work remains on
## PoshConsole, ... |
combined_dataset/train/non-malicious/2715.ps1 | 2715.ps1 |
[CmdletBinding()]
Param(
[Parameter(Mandatory=$False,Position=0)]
[ValidateSet("MD5","SHA1","SHA256","SHA384","SHA512","RIPEMD160")]
[string]$HashType = "SHA256",
[Parameter(Mandatory=$False,Position=1)]
[String]$BasePaths,
[Parameter(Mandatory=$False,Position=2)]
[String]$... |
combined_dataset/train/non-malicious/sample_54_92.ps1 | sample_54_92.ps1 | <#
.SYNOPSIS
Scenario module for collecting Microsoft Remote Desktop Profiles related data
.DESCRIPTION
Collect Profiles related troubleshooting data (incl. FSLogix, OneDrive)
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedb... |
combined_dataset/train/non-malicious/sample_10_10.ps1 | sample_10_10.ps1 | #************************************************
# TS_DetectLowPathMTU.ps1
# Version 1.0
# Date: 02/06/2014
# Author: BBenson
# Description:
# Rule number: 262755
# Rule ID: d2aaab92-c906-4b3e-a4e5-67244c49c422
# Rule URL: https://kse.microsoft.com/Contribute/Idea/de6654f5-8b05-4f97-b67b-f9ad51bc78ab
# P... |
combined_dataset/train/non-malicious/4041.ps1 | 4041.ps1 |
function Test-EndpointCrudAndAction
{
$profileName = getAssetName
$resourceGroup = TestSetup-CreateResourceGroup
$resourceLocation = "EastUS"
$profileSku = "Standard_Microsoft"
$createdProfile = New-AzCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroup... |
combined_dataset/train/non-malicious/sample_19_72.ps1 | sample_19_72.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Get-Token {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding()]
[OutputType([System.Management.Automation.Language.Token])]
[System.Diagnostics.CodeAnalysis.SuppressMessage... |
combined_dataset/train/non-malicious/1195.ps1 | 1195.ps1 |
$userDomain = $env:USERDNSDOMAIN
$computerDomain = Get-WmiObject 'Win32_ComputerSystem' | Select-Object -ExpandProperty Domain
if( (Get-Service -Name MSMQ -ErrorAction SilentlyContinue) -and $userDomain -eq $computerDomain )
{
$publicQueueName = 'CarbonTestGetQueue-Public'
$privateQueueName = 'Ca... |
combined_dataset/train/non-malicious/sample_37_84.ps1 | sample_37_84.ps1 | #
# Module manifest for module 'OCI.PSModules.Cims'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cims.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_8_29.ps1 | sample_8_29.ps1 | #
# Module manifest for module 'OCI.PSModules.Aivision'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aivision.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported PSEditions
Comp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.