full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/New-Eicar.ps1 | New-Eicar.ps1 | function New-Eicar {
<#
.SYNOPSIS
New-Eicar
Author: Chris Campbell (@obscuresec)
License: BSD 3-Clause
.DESCRIPTION
A function that generates the EICAR string to test ondemand scanning of antivirus products.
.PARAMETER $Path
Specifies the path to write the eicar file... |
combined_dataset/train/non-malicious/Get-Films (From Netflix).ps1 | Get-Films (From Netflix).ps1 | function Get-Films {
param($Name)
$proxy = New-ODataServiceProxy http://odata.netflix.com/Catalog/
if($Name -match "\\*") {
$sName = $Name -replace "\\*"
$Global:Films = $proxy.Titles.AddQueryOption('$filter',"substringof('$sName',Name)") | Where { $_.Name -like $Name }
} else {
$Glob... |
combined_dataset/train/non-malicious/427.ps1 | 427.ps1 | Register-PSFTeppScriptblock -Name 'PSFramework-tepp-scriptblockname' -ScriptBlock {
[PSFramework.TabExpansion.TabExpansionHost]::Scripts.Keys
}
Register-PSFTeppScriptblock -Name 'PSFramework-tepp-parametername' -ScriptBlock {
if ($fakeBoundParameter.Command)
{
$common = 'Verbose', 'Debug', 'ErrorAction', 'Warning... |
combined_dataset/train/non-malicious/Reverse filename sequenc_5.ps1 | Reverse filename sequenc_5.ps1 | # Reverse filename sequence v 0.9
# Author: Sean Wendt
#
# This script will rename a sequenced set of files in a directory.
# For example, you have foobar01.jpg, foobar02.jpg, foobar03.jpg
# -- it will reverse the order, so the last file is now 01, the second to last 02, etc..
#
# Limitations: -You cannot us... |
combined_dataset/train/non-malicious/464.ps1 | 464.ps1 |
Set-PSFConfig -Module PSFramework -Name 'System.Unattended' -Value $false -Initialize -Validation "bool" -Handler { [PSFramework.PSFCore.PSFCoreHost]::Unattended = $args[0] } -Description "Central setting, showing whether the current execution is unattended or not. This allows scripts/modules to react to whether there... |
combined_dataset/train/non-malicious/ISE-Lines_1.ps1 | ISE-Lines_1.ps1 | #requires -version 2.0
## ISE-Lines module v 1.1
## DEVELOPED FOR CTP3
## See comments for each function for changes ...
##############################################################################################################
## Provides Line cmdlets for working with ISE
## Duplicate-Line - Duplicates curr... |
combined_dataset/train/non-malicious/sample_67_75.ps1 | sample_67_75.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplace'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplace.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/3264.ps1 | 3264.ps1 |
enum AccessRight {
Allow
Deny
}
enum ConnectionStatus {
Connected
Disconnected
}
enum TriggerType {
Command
Event
Regex
}
enum Severity {
Success
Warning
Error
None
}
enum LogLevel {
Info = 1
Verbose = 2
Debug = 4
}
enum LogSeverity {
Normal
Warning... |
combined_dataset/train/non-malicious/Custom Accelerators.ps1 | Custom Accelerators.ps1 | #requires -version 2.0
## Custom Accelerators for PowerShell 2
####################################################################################################
## A script module for PowerShell 2 which allows the user to create their own custom type accelerators.
## Thanks to "Oisin Grehan for the discovery":h... |
combined_dataset/train/non-malicious/2215.ps1 | 2215.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true,HelpMessage="Site server where the SMS Provider is installed")]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[string]$SiteServer,
[parameter(Mandatory=$true,HelpMessage="Name of the Software Update Gr... |
combined_dataset/train/non-malicious/84.ps1 | 84.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 ($A... |
combined_dataset/train/non-malicious/sample_4_95.ps1 | sample_4_95.ps1 | ConvertFrom-StringData @'
id_regsetupperfrecoverydebuginfo=Recovery/Debug related keys
id_regsetupperfistartupinfo=Startup information
id_regsetupperfilocalprintkey=Local Print Key
id_regsetupperfipolicies=Policies System
id_regsetupperfregtimezoneinfo=Time Zone keys
id_regsetupperfregts=Terminal Services
ID_Reg... |
combined_dataset/train/non-malicious/sample_53_92.ps1 | sample_53_92.ps1 | <# File tss_Perf-Collect.ps1 [Folderpath]
#>
param(
[string]$Folderpath = (Split-Path $MyInvocation.MyCommand.Path -Parent)
)
#region ::::: Configruation parameters ----------------------------------------------#
$VerDate = "2021.04.30.0"
#endregion ::::: Configruation parameters --------------------------... |
combined_dataset/train/non-malicious/197.ps1 | 197.ps1 | Function Add-SRComment
{
[CmdletBinding()]
PARAM (
[Alias("SRObject")]
[parameter(Mandatory = $true)]
[System.WorkItem.ServiceRequest]$ServiceRequestObject,
[parameter(Mandatory = $True)]
[String]$Comment,
[ValidateSet("User", "Analyst")]
[parameter(Ma... |
combined_dataset/train/non-malicious/Add _ Get-Help -Full.ps1 | Add _ Get-Help -Full.ps1 | $executionContext.SessionState.InvokeCommand.PreCommandLookupAction = {
param($CommandName, $CommandLookupEventArgs)
if($CommandName.StartsWith("?")) {
$RealCommandName = $CommandName.TrimStart("?")
$CommandLookupEventArgs.CommandScriptBlock = {
Get-Help $RealCommandName -Full... |
combined_dataset/train/non-malicious/1106.ps1 | 1106.ps1 |
$siteName = 'Carbon-Set-IisWebsiteSslCertificate'
$cert = $null
$appID = '990ae75d-b1c3-4c4e-93f2-9b22dfbfe0ca'
$ipAddress = '43.27.98.0'
$port = '443'
$allPort = '8013'
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
I... |
combined_dataset/train/non-malicious/sample_34_13.ps1 | sample_34_13.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 = '79.0.0'
# S... |
combined_dataset/train/non-malicious/4059.ps1 | 4059.ps1 |
[CmdletBinding()]
param ()
function Get-Architecture {
[CmdletBinding()][OutputType([string])]
param ()
$OSArchitecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture
$OSArchitecture = $OSArchitecture.OSArchitecture
Return $OSArchitecture
}
function Get-RelativePath {
[C... |
combined_dataset/train/non-malicious/3303.ps1 | 3303.ps1 |
function Get-PoshBotConfiguration {
[cmdletbinding(DefaultParameterSetName = 'Path')]
param(
[parameter(
Mandatory,
ParameterSetName = 'Path',
Position = 0,
ValueFromPipeline,
ValueFromPipelineByPropertyName
)]
[ValidateN... |
combined_dataset/train/non-malicious/Convert-PowerPack2Ps1.ps1 | Convert-PowerPack2Ps1.ps1 | #######################################################################
# Convert-PowerPack2Ps1
#
# Converts PowerGUI .PowerPack files to ps1 PowerShell script library
# v1 - raw conversion, no name changes, only script elements converted
######################################################################
# E... |
combined_dataset/train/non-malicious/sample_28_10.ps1 | sample_28_10.ps1 | @{
ModuleVersion = '7.0.1'
GUID = '3859ddf6-1713-4701-adf3-477aeaa06333'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Microsoft® Corporation. All rights reserved."
NestedModules="Newtonsoft.Json.dll"
}
# SIG # Begin signature block
# MIInzgYJKoZIhvcNAQcCoIInvzCCJ7sCAQExDz... |
combined_dataset/train/non-malicious/sample_6_2.ps1 | sample_6_2.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 = '92.1.0'
# Sup... |
combined_dataset/train/non-malicious/sample_41_43.ps1 | sample_41_43.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 = '81.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/1671.ps1 | 1671.ps1 |
function Create-Shortcut {
param (
[string]$Source,
[string]$DestinationLnk,
[string]$Arguments
)
begin {
$WshShell = New-Object -ComObject WScript.Shell
}
process {
if (!$Source) {Throw 'No Source'}
if (!$DestinationLnk) {Throw 'No D... |
combined_dataset/train/non-malicious/SQLParser.ps1 | SQLParser.ps1 | #requires -version 2
#Uses Visual Studio Database Edition classes Microsoft.Data.Schema.ScriptDom and Microsoft.Data.Schema.Script.Sql to parse T-SQL
#Chad Miller
#http://chadwickmiller.spaces.live.com/
$PSScriptRoot = (Split-Path $MyInvocation.MyCommand.Path -Parent)
Add-Type -Path "$PSScriptRoot\\Microso... |
combined_dataset/train/non-malicious/4277.ps1 | 4277.ps1 | function Out-Minidump
{
[CmdletBinding()]
Param (
[Parameter(Position = 0, Mandatory = $True, ValueFromPipeline = $True)]
[System.Diagnostics.Process]
$Process,
[Parameter(Position = 1)]
[ValidateScript({ Test-Path $_ })]
[String]
$DumpFilePath = $PWD
... |
combined_dataset/train/non-malicious/sample_60_9.ps1 | sample_60_9.ps1 | #
# Module manifest for module 'OCI.PSModules.Objectstorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Objectstorage.dll'
# Version number of this module.
ModuleVersion = '90.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/174.ps1 | 174.ps1 |
Start-Job -Name "UpdateHelp" -ScriptBlock { Update-Help -Force } | Out-null
Write-Host "Updating Help in background (Get-Help to check)" -ForegroundColor Yellow
Write-host "PowerShell Version: $($psversiontable.psversion) - ExecutionPolicy: $(Get-ExecutionPolicy)" -ForegroundColor yellow
Set-Location $home\o... |
combined_dataset/train/non-malicious/3956.ps1 | 3956.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.","") ... |
combined_dataset/train/non-malicious/1904.ps1 | 1904.ps1 |
Describe "Debug-Runspace" -tag "CI" {
BeforeAll {
$rs1 = [runspacefactory]::CreateRunspace()
$rs1.Open()
$rs1.Name = "MyRunspace1"
$rs2 = [runspacefactory]::CreateRunspace()
$rs2.Open()
$rs2.Name = "MyRunspace2"
}
AfterAll {
if ( $rs1 ) { $rs1.Dispos... |
combined_dataset/train/non-malicious/sample_55_93.ps1 | sample_55_93.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudguard'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudguard.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/01fef1f2-03fd-4b4d-bed8-aa3c4999fedc.ps1 | 01fef1f2-03fd-4b4d-bed8-aa3c4999fedc.ps1 | Connect-VIServer <vCenter server>
# Uncomment the next line to test this script
# $WhatIfPreference = $true
if (-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) {
Add-PSSnapin VMware.VimAutomation.Core
}
if (-not (Get-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContin... |
combined_dataset/train/non-malicious/sample_10_87.ps1 | sample_10_87.ps1 | #************************************************
# TS_4KDriveInfo.ps1
# Version 1.0.2
# Date: 03-21-2011
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script detects 4KB/ 512e drive informaiton
#************************************************
# 2023-02-20 WalterE mod Trap #we#
trap [Exce... |
combined_dataset/train/non-malicious/sample_50_13.ps1 | sample_50_13.ps1 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apa... |
combined_dataset/train/non-malicious/sample_41_72.ps1 | sample_41_72.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module $PSScriptRoot\Tracer.psm1
$Ba... |
combined_dataset/train/non-malicious/sample_25_96.ps1 | sample_25_96.ps1 | #
# Module manifest for module 'OCI.PSModules.Adm'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Adm.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/VM Performance Report_1.ps1 | VM Performance Report_1.ps1 | <#
.SYNOPSIS
The script creates an HTML report for given vSphere VM's, that contains VM performance data over a given period. The script then emails the report to a given address.
.DESCRIPTION
The script requires an input file, supplied as an argument to the script. The first line of this file contains an e... |
combined_dataset/train/non-malicious/sample_3_56.ps1 | sample_3_56.ps1 | ConvertFrom-StringData @'
id_surfacepro3detectfirmwareversions=Detect Surface Pro 3 Firmware Versions
id_surfacepro3detectfirmwareversionsdesc=Detected Surface Pro 3 Firmware Versions Update Needed
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEE... |
combined_dataset/train/non-malicious/sample_48_47.ps1 | sample_48_47.ps1 | /*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
define("vs/languages/typescript/project/projectResolver.nls.keys",[],{});
// SIG // Begin signature block
// SIG // MIIkXAYJKoZIhvcNA... |
combined_dataset/train/non-malicious/ISEFun_1.psm1.ps1 | ISEFun_1.psm1.ps1 | # Module version 0.2
# Author: Bartek Bielawski (@bielawb on twitter)
# Purpose: Add functionality to PowerShell ISE
# Description: Adds Add-ons menu 'ISEFun' with all functions included.
# User can add any action there using Add-MyMenuItem function
# One of functions (Copy item from history) was build using... |
combined_dataset/train/non-malicious/sample_34_69.ps1 | sample_34_69.ps1 | export function scrollToPrevious(horizontalScrollElement) {
horizontalScrollElement.scrollToPrevious();
}
export function scrollToNext(horizontalScrollElement) {
horizontalScrollElement.scrollToNext();
}
export function scrollInView(horizontalScrollElement, viewIndex) {
horizontalScrollElement.sc... |
combined_dataset/train/non-malicious/Start-ComputerJobs_2.ps1 | Start-ComputerJobs_2.ps1 | #requires -version 2.0
function Start-ComputerJobs{
<#
.NOTES
Name: Start-ComputerJobs
Author: Tome Tanasovski
Created: 6/25/2010
Modified: 6/25/2010
Version: 1.2
Website: http://powertoe.wordpress.com
.SYNOPSIS
Multithreads a scriptblock with jobs
... |
combined_dataset/train/non-malicious/sample_46_42.ps1 | sample_46_42.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydomains'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydomains.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_67_47.ps1 | sample_67_47.ps1 | @{
GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Start-Transcript", "Stop-Transcript"
AliasesTo... |
combined_dataset/train/non-malicious/sample_12_13.ps1 | sample_12_13.ps1 | #************************************************
# DC_RDSRDWeb.ps1
# Version 1.0.1
# Date: 21-01-2012
# Author: Daniel Grund - dgrund@microsoft.com
# Description:
# This script gets the IIS config
# 1.0.0 Beta release
# 1.0.1 Release
# TODO get windows\web\rdweb dir
#****************************************... |
combined_dataset/train/non-malicious/sample_58_18.ps1 | sample_58_18.ps1 | import{W as s}from"./index-BIaDS2NQ.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
* Released under the MIT license
* https://github.com/microsoft/monaco-edit... |
combined_dataset/train/non-malicious/sample_30_58.ps1 | sample_30_58.ps1 | #
# Module manifest for module 'OCI.PSModules.Datasafe'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datasafe.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_54_10.ps1 | sample_54_10.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.PostgreSql.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.PostgreSql.internal.psm1'
if(Test-Path $internalModulePath) {
... |
combined_dataset/train/non-malicious/sample_37_87.ps1 | sample_37_87.ps1 | /*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-------------... |
combined_dataset/train/non-malicious/2654.ps1 | 2654.ps1 | Try {
If (([System.Diagnostics.Process]::GetCurrentProcess() | Select "SessionID" -ExpandProperty "SessionID") -eq 0) {
Exit 1
}
Else {
Exit 0
}
}
Catch {
Exit 2
} |
combined_dataset/train/non-malicious/archive.ps1 | archive.ps1 | $rootDir = 'C:\\Documents and Settings\\buddyl\\My Documents\\Powershell Scripts\\';
$temp = $rootDir + 'temp'
mkdir $temp
$tempDir = $temp + '\\'
$targetFolder1 = $rootDir + 'test'
$zip1 = $tempDir + 'test1.zip'
gi $targetFolder1 | out-zip $zip1 $_
$targetFolder2 = $rootDir + 'test2'
$zip2 = $tempDir + '... |
combined_dataset/train/non-malicious/1146.ps1 | 1146.ps1 |
$cert = $null
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
$cert = Install-Certificate (Join-Path $TestDir CarbonTestCertificate.cer -Resolve) -StoreLocation LocalMachine -StoreName My
}
function Stop-Tes... |
combined_dataset/train/non-malicious/sample_48_12.ps1 | sample_48_12.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 License... |
combined_dataset/train/non-malicious/Get-QADGroupNesting_1.ps1 | Get-QADGroupNesting_1.ps1 | Param (
[Parameter(Mandatory=$true,
Position=0,
ValueFromPipeline=$true,
HelpMessage="DN or ObjectGUID of the AD Group."
)]
[string]$groupIdentity,
[switch]$showTree
)
#Validate Quest PSSnapin is loaded
Add-PSSnapin -Name Quest.ActiveRoles.ADManagement -ErrorAction ... |
combined_dataset/train/non-malicious/sample_58_64.ps1 | sample_58_64.ps1 | # Localized 06/27/2024 06:02 AM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Ano
PromptNoString=&Ne
BundleFound=Nalezený svazek: {0}
PackageFound=Nalezený balíček: {0}
EncryptedBundleFound=Nalezena zašifrovaná sada prostředků: {0}
Encrypted... |
combined_dataset/train/non-malicious/Remove local profiles.ps1 | Remove local profiles.ps1 | <#
.SYNOPSIS
This is a powershell script form to remove a users local profile from a workstation and
and gives the option to remove the users profile fromt he network.
.DESCRIPTION
This script askes for a machine name.
It displays all of the roaming profiles on that machine.
The administrator sele... |
combined_dataset/train/non-malicious/2681.ps1 | 2681.ps1 |
Param(
[string]$SourceEnvironment,
[string]$DestinationEnvironment
)
begin
{
Clear-Host
}
process
{
$path = Split-Path -parent $MyInvocation.MyCommand.Definition
if ($env:PSModulePath -notlike "*$path\Modules\TriadModules\Modules*")
{
"Adding ;$path\Modules\TriadModules\Modules to PSModule... |
combined_dataset/train/non-malicious/sample_22_4.ps1 | sample_22_4.ps1 | <#
.SYNOPSIS Launch Developer PowerShell
.DESCRIPTION
Locates and imports a Developer PowerShell module and calls the Enter-VsDevShell cmdlet. The Developer PowerShell module
is located in one of several ways:
1) From a path in a Visual Studio installation
2) From the latest installation of Visual Studio (hig... |
combined_dataset/train/non-malicious/Set-FileWriteable.ps1 | Set-FileWriteable.ps1 | function Set-FileWriteable {
#.Example
# $s = New-PSSession $ComputerName
# C:\\PS>$files = Invoke-Command $s { ls }
# ....
# C:\\PS>Set-FileWriteable $files
#
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
$File
,
[switch]$Passthru
)
process {
foreach($path in @($file)) {
... |
combined_dataset/train/non-malicious/2649.ps1 | 2649.ps1 |
param([parameter(Mandatory=$true)][string] $dir,
[parameter(Mandatory=$true)][string] $server)
Add-PSSnapin SqlServerCmdletSnapin100
Add-PSSnapin SqlServerProviderSnapin100
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null
[System.Reflection.Assembly]::LoadWithPartialName("M... |
combined_dataset/train/non-malicious/1616.ps1 | 1616.ps1 | function Get-ShaHash {
param (
[Parameter(ValueFromPipeline=$true)]
[string]$file,
[ValidateSet(1, 256, 384, 512)]
[int]$bit = 512
)
begin {
function Resolve-FullPath ([string]$Path) {
if ( -not ([IO.Path]::IsPathRooted($Path)) ) {
$Path = Join-Pa... |
combined_dataset/train/non-malicious/sample_57_67.ps1 | sample_57_67.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 = '85.2.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/3370.ps1 | 3370.ps1 |
param(
[Parameter(Mandatory = $false, Position = 0)]
[ValidateSet("Release", "Debug")]
[string] $BuildConfig,
[Parameter(Mandatory = $false, Position = 1)]
[ValidateSet("All", "Latest", "Stack", "NetCore", "ServiceManagement", "AzureStorage")]
[string] $Scope
)
function New-Mod... |
combined_dataset/train/non-malicious/2882.ps1 | 2882.ps1 | task default -depends Test
task Test -depends Compile, Clean -PreAction {"Pre-Test"} -Action {
"Test"
} -PostAction {"Post-Test"}
task Compile -depends Clean {
"Compile"
}
task Clean {
"Clean"
}
|
combined_dataset/train/non-malicious/sample_66_30.ps1 | sample_66_30.ps1 | <##############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
###########################################################... |
combined_dataset/train/non-malicious/DirToday Extended.ps1 | DirToday Extended.ps1 | ## NAME: Get-Dirty.ps1
## AUTHOR: Barry Morrison
## LASTEDIT: 07/05/2011 16:18:33
<#
.Synopsis
Get's files from today's date. Will also return narrowed results based on keyword
.Description
Get's files from today's date. Will also return narrowed results based on keyword
.Parameter... |
combined_dataset/train/non-malicious/Get-ADGroupMembers_5.ps1 | Get-ADGroupMembers_5.ps1 | Function Get-ADGroupMembers
{
<#
.SYNOPSIS
Return a collection of users in an ActiveDirectory group.
.DESCRIPTION
This function returns an object that contains all the properties of a user object. This function
works for small groups as well as groups in ex... |
combined_dataset/train/non-malicious/sample_8_73.ps1 | sample_8_73.ps1 | ConvertFrom-StringData @'
id_wsftpsiexplorercrashcheck_st=Wsftpsi.dll version 12.3.0.1 was detected in this machine. This version is known to cause consistent Explorer crashes
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE... |
combined_dataset/train/non-malicious/get-kbinfo.ps1 | get-kbinfo.ps1 | # -==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Author: Kris Cieslak (defaultset.blogspot.com)
# Date: 2010-05-26
# Description: Identifying knowledge base article by id number taken from
# string or filename.
#
# Parameters: filename / kno... |
combined_dataset/train/non-malicious/ServicePWChgReset.ps1 | ServicePWChgReset.ps1 | # ==============================================================================================
#
# NAME: ServicePWChgReset.ps1
#
# AUTHOR: Saehrig, Steven
# DATE : 8/26/2008
#
@@# COMMENT: Please read comments on each section!
# 1st - Search Domain computers for matching name and import into array.
# ... |
combined_dataset/train/non-malicious/sample_50_43.ps1 | sample_50_43.ps1 | #
# Module manifest for module 'PowerShellProTools'
#
# Generated by: Ironman Software, LLC
#
# Generated on: 1/17/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'PowerShellProTools.psm1'
# Version number of this module.
ModuleVersion = '2023.12.0'
# Supp... |
combined_dataset/train/non-malicious/sample_14_40.ps1 | sample_14_40.ps1 | #************************************************
# TS_HPZ12ServiceCheck.ps1
# Version 1.0
# Date: 1-11-2011
# Author: v-anecho
# Description: Checks if 'Net Driver HPZ12' or 'Pml Driver HPZ12' is one of the installed services and startup type is something different than Disabled
#********************************... |
combined_dataset/train/non-malicious/3810.ps1 | 3810.ps1 |
function Test-VirtualMachineGetRunCommand
{
$loc = Get-ComputeVMLocation;
$loc = $loc.Replace(" ", "")
$commandId = "RunPowerShellScript"
$result = Get-AzVMRunCommandDocument -Location $loc -CommandId $commandId
Assert-AreEqual $commandId $result.Id
Assert-AreEqual "Window... |
combined_dataset/train/non-malicious/776.ps1 | 776.ps1 | param([switch]$Serve, [switch]$Clean, [switch]$Publish)
$toolsPath = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\tools")
$docfxZipPath = [System.IO.Path]::GetFullPath("$toolsPath\docfx.zip")
$docfxBinPath = [System.IO.Path]::GetFullPath("$toolsPath\docfx\")
$docfxExePath = [System.IO.Path]::GetFullPath("$docfxBinP... |
combined_dataset/train/non-malicious/sample_35_20.ps1 | sample_35_20.ps1 | # Copyright (C) 2024 Alejandro Santoyo <alejandro.santoyo@canonical.com>
#
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU G... |
combined_dataset/train/non-malicious/chkhash_30.ps1 | chkhash_30.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/Test-Prompt_3.ps1 | Test-Prompt_3.ps1 | $choices = [System.Management.Automation.Host.ChoiceDescription[]](
(New-Object System.Management.Automation.Host.ChoiceDescription "&Yes","Choose me!"),
(New-Object System.Management.Automation.Host.ChoiceDescription "&No","Pick me!"))
$Answer = $host.ui.PromptForChoice('Caption',"Message",$choices,(1))
Write-... |
combined_dataset/train/non-malicious/55.ps1 | 55.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/push-module function .ps1 | push-module function .ps1 | function Push-Module {
param(
[parameter(position=0, mandatory=$true)]
[validatenotnullorempty()]
[string]$ModuleName
)
# find out what this module exports (and therefore what it overwrites)
$metadata = new-module -ascustomobject {
param([string]$ModuleName)... |
combined_dataset/train/non-malicious/2541.ps1 | 2541.ps1 |
Param
(
[parameter(Mandatory=$true, Position=0, HelpMessage="Define valdation type: All, Domain, Zone, ZoneAging, ZoneDelegation, Forwarder, RootHints")]
[Alias("Type")]
[String[]] $ValidationType,
[parameter(Mandatory=$false, Position=1, HelpMessage="Full path of cache files.")]
... |
combined_dataset/train/non-malicious/Get-TranscriptFilePath.ps1 | Get-TranscriptFilePath.ps1 | #requires -version 2.0
function Get-TranscriptFilePath {
try {
$externalHost = $host.gettype().getproperty("ExternalHost",
[reflection.bindingflags]"nonpublic,instance").getvalue($host, @())
$externalhost.gettype().getfield("transcriptFileName", "nonpublic,instance").getvalue($externalhos... |
combined_dataset/train/non-malicious/sample_22_98.ps1 | sample_22_98.ps1 | ConvertFrom-StringData @'
###PSLOC
DeployRole = Deploy '{0:RoleName}' role on '{1:MachineName}' machine.
DeployRoleFailed = Deployment of '{0:RoleName}' role failed on '{1:MachineName}' machine with Error: {2:ErrorMessage}.
CheckLogs = Check logs at '{0:FilePath}' on '{1:MachineName}' machine.
ConfigureRole = Conf... |
combined_dataset/train/non-malicious/sample_17_60.ps1 | sample_17_60.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 = '73.1.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/1965.ps1 | 1965.ps1 |
Describe "Update-FormatData" -Tags "CI" {
BeforeEach {
$ps = [PowerShell]::Create()
}
Context "Validate Update-FormatData update correctly" {
It "Should not throw upon reloading previous formatting file" {
{ Update-FormatData } | Should -Not -throw
}
It "Sho... |
combined_dataset/train/non-malicious/156.ps1 | 156.ps1 |
function Get-DistributionGroupMemberRecursive
{
[CmdletBinding()]
PARAM ($Group)
BEGIN
{
TRY
{
Write-Verbose -Message "[BEGIN] Retrieving members of $Group"
$GroupMembers = Get-DistributionGroupMember -Identity $Group -ErrorAction Stop -ErrorVariabl... |
combined_dataset/train/non-malicious/sample_32_22.ps1 | sample_32_22.ps1 | @{
RootModule = 'PSReadLine.psm1'
NestedModules = @("Microsoft.PowerShell.PSReadLine2.dll")
ModuleVersion = '2.1.0'
GUID = '5714753b-2afd-4492-a5fd-01d9e2cff8b5'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = '(c) Microsoft Corporation. All rights reserved.'
Description = 'Gr... |
combined_dataset/train/non-malicious/3007.ps1 | 3007.ps1 | $Script:ReportStrings = DATA {
@{
HeaderMessage = @'
____ __
/ __ \___ _____/ /____ _____
/ /_/ / _ \/ ___/ __/ _ \/ ___/
/ ____/ __(__ ) /_/ __/ /
/_/ \___/____/\__/\___/_/
Pester v{0}
'@
StartMessage = "Executing all tests in '{0}'"
FilterMessage =... |
combined_dataset/train/non-malicious/sample_62_94.ps1 | sample_62_94.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/874.ps1 | 874.ps1 | function add-pythonfiles {
$ErrorActionPreference = "Stop"
$sub = Get-AzSubscription -ErrorAction SilentlyContinue
if(-not($sub))
{
Connect-AzAccount
}
$pathToStreamingFile = ".\hiveudf.py"
$clusterName = Read-Host -Prompt "Enter the HDInsight cluster name... |
combined_dataset/train/non-malicious/2486.ps1 | 2486.ps1 |
Read-Host -AsSecureString | ConvertFrom-SecureString | Out-File encrypted_password.txt
$vpn_profile = 'Profile name'
$username = 'username'
$enc_password = (gc .\encrypted_password.txt | ConvertTo-SecureString)
$credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $username,... |
combined_dataset/train/non-malicious/sample_62_69.ps1 | sample_62_69.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudmigrations'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudmigrations.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported P... |
combined_dataset/train/non-malicious/Get-FSMORoleOwner.ps1 | Get-FSMORoleOwner.ps1 | Function Get-FSMORoleOwner {
<#
.SYNOPSIS
Retrieves the list of FSMO role owners of a forest and domain
.DESCRIPTION
Retrieves the list of FSMO role owners of a forest and domain
.NOTES
Name: Get-FSMORoleOwner
Author: Boe Prox
DateCreated: 06/9/2011
.EXAMPLE
... |
combined_dataset/train/non-malicious/2156.ps1 | 2156.ps1 |
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()]
[string] $Path = $PSScriptRoot
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
function Test-Elevated
{
[CmdletBinding()]
[OutputType([bool])]
Param()
return (([Security.Principal.WindowsIdentity]::GetCurr... |
combined_dataset/train/non-malicious/3959.ps1 | 3959.ps1 |
function Test-LocalNetworkGatewayCRUD
{
$rgname = Get-ResourceGroupName
$rname = Get-ResourceName
$rglocation = Get-ProviderLocation ResourceManagement
$resourceTypeParent = "Microsoft.Network/localNetworkGateways"
$location = Get-ProviderLocation $resourceTypeParent
try
... |
combined_dataset/train/non-malicious/sample_48_54.ps1 | sample_48_54.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\rollup@4.9.6\node_modules\rollup\dist\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\rollup... |
combined_dataset/train/non-malicious/Start-Timer.ps1 | Start-Timer.ps1 | ## Start-Timer.ps1
## A kitchen timer script with visible countdown and customizable audio alert and messages
####################################################################################################
param( $seconds=0, $reason="The Timer", $SoundFile="$env:SystemRoot\\Media\\notify.wav",
$minutes... |
combined_dataset/train/non-malicious/3248.ps1 | 3248.ps1 |
class PluginManager : BaseLogger {
[hashtable]$Plugins = @{}
[hashtable]$Commands = @{}
hidden [string]$_PoshBotModuleDir
[RoleManager]$RoleManager
[StorageProvider]$_Storage
PluginManager([RoleManager]$RoleManager, [StorageProvider]$Storage, [Logger]$Logger, [string]$PoshBotModuleDir) {
... |
combined_dataset/train/non-malicious/New-Zip_3.ps1 | New-Zip_3.ps1 | Function New-Zip
{
<#
.SYNOPSIS
Create a Zip File from any files piped in.
.DESCRIPTION
Requires that you have the SharpZipLib installed, which is available from
http://www.icsharpcode.net/OpenSource/SharpZipLib/
.NOTES
File Name : PowerZip.psm1
Author : Christophe CREMON (uxone) - http://powershel... |
combined_dataset/train/non-malicious/sample_59_74.ps1 | sample_59_74.ps1 | @{
GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Get-WinEvent", "New-WinEvent", "Get-C... |
combined_dataset/train/non-malicious/78.ps1 | 78.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.