full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/2856.ps1 | 2856.ps1 | function Exec {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[scriptblock]$cmd,
[string]$errorMessage = ($msgs.error_bad_command -f $cmd),
[int]$maxRetries = 0,
[string]$retryTriggerErrorPattern = $null,
[string]$workingDirectory = $null
)
... |
combined_dataset/train/non-malicious/04180226-a26b-47be-abbd-9eb998596807.ps1 | 04180226-a26b-47be-abbd-9eb998596807.ps1 | <#=====================================================
SYNOPSIS
Create an Excel workbook for a teacher.
The workbook contains a worksheet for each class.
=====================================================#>
<#=====================================================
RETRIEVE CURRENT USER'S LOGON
Prefer API to ... |
combined_dataset/train/non-malicious/1517.ps1 | 1517.ps1 |
function Assert-DirectoryDoesNotExist
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[string]
$Path,
[Parameter(Position=1)]
[string]
$Message
)
Set-StrictMode -Version 'Latest'
if( Test-Path -Path $Path -Pat... |
combined_dataset/train/non-malicious/sample_43_74.ps1 | sample_43_74.ps1 | var state = command.getTrait("state");
var manipData = services.manipulators.getManipulatorData("CameraManipulator");
var mode = null;
if (manipData != null) {
mode = manipData.getTrait("CameraManipulationMode");
}
var tool = new Object();
tool.activate = function () {
state.value = 2;
if... |
combined_dataset/train/non-malicious/Test-Certificate_1.ps1 | Test-Certificate_1.ps1 | #####################################################################
# Test-Certificate.ps1
# Version 0.9
#
# Tests specified certificate for certificate chain and revocation
#
# Vadims Podans (c) 2009
# http://www.sysadmins.lv/
#####################################################################
#requires -... |
combined_dataset/train/non-malicious/sample_31_63.ps1 | sample_31_63.ps1 | #
# Module manifest for module 'OCI.PSModules.Healthchecks'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/249.ps1 | 249.ps1 | function Get-ImageInformation
{
PARAM (
[System.String[]]$FilePath
)
Foreach ($Image in $FilePath)
{
Add-type -AssemblyName System.Drawing
New-Object -TypeName System.Drawing.Bitmap -ArgumentList $Image
}
} |
combined_dataset/train/non-malicious/sample_53_28.ps1 | sample_53_28.ps1 | #
# Module manifest for module 'OCI.PSModules.Threatintelligence'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Threatintelligence.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Suppo... |
combined_dataset/train/non-malicious/sample_45_33.ps1 | sample_45_33.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeai'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeai.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/vSphere Resultant Privs_1.ps1 | vSphere Resultant Privs_1.ps1 | # Need the Quest ActiveRoles cmdlets for this one.
Add-PSSnapin Quest.ActiveRoles* -ea SilentlyContinue
function Get-Groups {
param($principal)
# Start with this principal's base set of groups.
Write-Verbose "Checking principal $principal"
$groups = Get-QADUser $principal | Get-QADMemberOf
# Groups ca... |
combined_dataset/train/non-malicious/Get MOSS User Profile_2.ps1 | Get MOSS User Profile_2.ps1 | function Get-UserProfile($accountName)
{
[reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server") | out-null
$upm =[Microsoft.Office.Server.UserProfiles.UserProfileManager](
[Microsoft.Office.Server.ServerContext]::D... |
combined_dataset/train/non-malicious/sample_22_99.ps1 | sample_22_99.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... |
combined_dataset/train/non-malicious/sample_67_51.ps1 | sample_67_51.ps1 | import{Z as s}from"./index-Dc-kSG0m.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_43_16.ps1 | sample_43_16.ps1 | <##############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
###########################################################... |
combined_dataset/train/non-malicious/4283.ps1 | 4283.ps1 | function Get-GPPAutologon
{
[CmdletBinding()]
Param ()
Set-StrictMode -Version 2
[System.Reflection.Assembly]::LoadWithPartialName("System.Core") |Out-Null
function Get-GPPInnerFields
{
[CmdletBinding()]
Param (
$File
)
try
... |
combined_dataset/train/non-malicious/sample_55_84.ps1 | sample_55_84.ps1 | #
# Module manifest for module 'OCI.PSModules.Capacitymanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Capacitymanagement.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Suppo... |
combined_dataset/train/non-malicious/3402.ps1 | 3402.ps1 |
function Test-AvailabilitySet
{
$rgname = Get-ComputeTestResourceName
try
{
$loc = Get-ComputeVMLocation;
New-AzureRmResourceGroup -Name $rgname -Location $loc -Force;
$asetName = 'avs' + $rgname;
$nonDefaultUD = 2;
$nonDefaultFD = 3;
... |
combined_dataset/train/non-malicious/1281.ps1 | 1281.ps1 |
function Test-CGroupMember
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[string]
$GroupName,
[Parameter(Mandatory=$true)]
[string]
$Member
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdl... |
combined_dataset/train/non-malicious/sample_2_0.ps1 | sample_2_0.ps1 | #jc jclauzel edited as part of SDP to TSS migration 17/02/2023
# Last Modified: 2023-02-24 by #we#
$debug = $false
# Load Common Library:
. ./utils_cts.ps1
. ./utils_MBS.ps1
. ./utils_CRM.ps1
$CRMServerNotInstalledTitle="Microsoft Dynamics CRM Server Not Installed."
$CRMServerNotInstalledDescription = "Th... |
combined_dataset/train/non-malicious/sample_47_40.ps1 | sample_47_40.ps1 | @{
GUID="c61d6278-02a3-4618-ae37-a524d40a7f44 "
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
ModuleToProcess="PSDiagnostics.psm1"
Func... |
combined_dataset/train/non-malicious/4310.ps1 | 4310.ps1 | function Get-FindModuleParameterSets {
$manifestData = Get-FindModuleParameterTestManifest
$variations = $manifestData.testcasemanifest.Parameters.Variations
$testParameterSets = @()
$variations | Foreach-Object {
$FindModuleInputParameters = [ordered]@{}
if($_.Name) {$FindModuleInp... |
combined_dataset/train/non-malicious/sample_64_76.ps1 | sample_64_76.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
#
# ModifyProxySettings.ps1 - To be used by the installer - Mo... |
combined_dataset/train/non-malicious/sample_3_52.ps1 | sample_3_52.ps1 | #************************************************
# TS_RemoteDesktopLServerKB2512845.ps1
# Version 1.0.1
# Date: 5/15/2012
# Author: v-kaw
# Description: [Idea ID 2285] [Windows] Windows Server 2003 TS Licensing server does not renew new versions of TS Per Device CALs
# Rule number: 2285
# Rule URL: //sharepo... |
combined_dataset/train/non-malicious/sample_12_45.ps1 | sample_12_45.ps1 | # ***********************************************************************************************
# File: utils_ConfigMgr12-ps1
# Version 1.0
# Date: 02-17-2012 - Last edit 2022-06-01
# Author: Vinay Pamnani - vinpa@microsoft.com
# Description: Utility Script to load common variables/functions. View utils_ConfigM... |
combined_dataset/train/non-malicious/4227.ps1 | 4227.ps1 | function Invoke-PsUACme
{
[CmdletBinding()] Param(
[Parameter(Position = 0, Mandatory = $False)]
[String]
$Payload = 'powershell.exe -noexit -c "if ([bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match ''S-1-5-32-544'')) {Write-Output ''You hav... |
combined_dataset/train/non-malicious/16.ps1 | 16.ps1 | try {
$poshgitPath = join-path (Get-ToolsLocation) 'poshgit'
try {
if (test-path($poshgitPath)) {
Write-Host "Attempting to remove existing `'$poshgitPath`'."
remove-item $poshgitPath -recurse -force
}
} catch {
Write-Host "Could not remove `'$poshgitPath`'"
}
$ve... |
combined_dataset/train/non-malicious/SharpSsh Functions_1.ps1 | SharpSsh Functions_1.ps1 | ## USING the binaries from:
## http://downloads.sourceforge.net/sharpssh/SharpSSH-1.1.1.13.bin.zip
[void][reflection.assembly]::LoadFrom( (Resolve-Path "~\\Documents\\WindowsPowerShell\\Libraries\\Tamir.SharpSSH.dll") )
## NOTE: These are bare minimum functions, and only cover ssh, not scp or sftp
## also, ... |
combined_dataset/train/non-malicious/3354.ps1 | 3354.ps1 |
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True, Position=0)]
[String]$Version,
[Parameter(Mandatory=$True, Position=1)]
[String]$Release,
[Parameter(Mandatory=$False, Position=2)]
[String]$Folder,
[Parameter(ParameterSetName="Major")]
[Switch]$Major,
[Parameter(ParameterSetName="Minor")]
[Switch]$Minor,
[Paramet... |
combined_dataset/train/non-malicious/2610.ps1 | 2610.ps1 | param([ValidateSet('Dev','Stage','QA','Prod')][string] $Environment)
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Management.IntegrationServices") | Out-Null;
$IspacPath = switch($Environment){
'Dev'{'C:\TFS2013\Dev\SSIS\TestDev.ispac'}
'Stage'{'C:\TFS2013\Dev\SSIS\TestStage.ispac... |
combined_dataset/train/non-malicious/1059.ps1 | 1059.ps1 |
$TestCertPath = JOin-Path -Path $PSScriptRoot -ChildPath 'Certificates\CarbonTestCertificate.cer' -Resolve
$TestCert = New-Object Security.Cryptography.X509Certificates.X509Certificate2 $TestCertPath
$testCertificateThumbprint = '7D5CE4A8A5EC059B829ED135E9AD8607977691CC'
$testCertFriendlyName = 'Pup Test Ce... |
combined_dataset/train/non-malicious/sample_16_98.ps1 | sample_16_98.ps1 | ConvertFrom-StringData @'
id_adapterkb980486check=Checking 6to4 and physical adapters
id_adapterkb980486checkdesc=Checking the number of 6to4 and physical adapters (KB 980486)
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3Ag... |
combined_dataset/train/non-malicious/4034.ps1 | 4034.ps1 |
function Test-ManagedApplicationCRUD
{
$rgname = Get-ResourceGroupName
$managedrgname = Get-ResourceGroupName
$appDefName = Get-ResourceName
$appName = Get-ResourceName
$rglocation = "EastUS2EUAP"
$display = "myAppDefPoSH"
New-AzResourceGroup -Name $rgname -Location $rglocation
$appDef = Ne... |
combined_dataset/train/non-malicious/sample_33_21.ps1 | sample_33_21.ps1 | #
# Script module for module 'Az.ContainerInstance' that is executed when 'Az.ContainerInstance' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:40
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
... |
combined_dataset/train/non-malicious/1040.ps1 | 1040.ps1 |
[CmdletBinding()]
param(
)
Set-StrictMode -Version Latest
& (Join-Path $PSSCriptRoot ..\Import-Carbon.ps1 -Resolve)
$deploymentWritersGroupName = 'DeploymentWriters'
$deploymnetReadersGroupName = 'DeploymentReaders'
$ccnetServiceUser = 'example.com\CCServiceUser'
Install-Group -Name $deploymentWritersG... |
combined_dataset/train/non-malicious/1640.ps1 | 1640.ps1 |
function Get-LocalAdmin {
param (
$comp = $env:COMPUTERNAME,
[ValidateSet('AccountManagement', 'ADSI', 'WMI')]
$method = 'ADSI',
[ValidateSet('Administrators', 'Remote Desktop Users')]
$groupname = 'Administrators'
)
if ($method -eq 'Accou... |
combined_dataset/train/non-malicious/repr_2.ps1 | repr_2.ps1 | function repr {
[CmdletBinding()]
[OutputType([string])]
Param(
[Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]
$InputObject)
process {
if($null -eq $InputObject) {
$PSCmdlet.WriteObject('$null')
}
elseif($InputObject -is ... |
combined_dataset/train/non-malicious/sample_15_15.ps1 | sample_15_15.ps1 | #
# Module manifest for module 'OCI.PSModules.Managementdashboard'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Managementdashboard.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Sup... |
combined_dataset/train/non-malicious/sample_52_44.ps1 | sample_52_44.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Join-ScriptExtent {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding()]
[OutputType([System.Management.Automation.Language.IScriptExtent])]
param(
[Parameter(Value... |
combined_dataset/train/non-malicious/1796.ps1 | 1796.ps1 |
$restartTesthookName = "TestStopComputer"
$restartTesthookResultName = "TestStopComputerResults"
$DefaultResultValue = 0
try
{
$PSDefaultParameterValues["it:skip"] = ! $IsWindows
Enable-Testhook -testhookName $restartTesthookName
Describe "Restart-Computer" -Tag Feature,RequireAdminOnWindows {
... |
combined_dataset/train/non-malicious/sample_53_77.ps1 | sample_53_77.ps1 | <#
.SYNOPSIS
KeePassXC Release Tool
.DESCRIPTION
Commands:
merge Merge release branch into main branch and create release tags
build Build and package binary release from sources
sign Sign previously compiled release packages
.NOTES
The following are descriptions of certain parameters:
-Vcpkg ... |
combined_dataset/train/non-malicious/sample_19_42.ps1 | sample_19_42.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 = '77.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_30_89.ps1 | sample_30_89.ps1 | #
# Module manifest for module 'OCI.PSModules.Globallydistributeddatabase'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Globallydistributeddatabase.dll'
# Version number of this module.
ModuleVersion =... |
combined_dataset/train/non-malicious/sample_21_60.ps1 | sample_21_60.ps1 | # Localized 12/03/2020 06:20 PM (GMT) 303:4.80.0411 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=是(&Y)
PromptNoString=否(&N)
BundleFound=找到下列資源存放區: {0}
PackageFound=找到封裝: {0}
EncryptedBundleFound=找到加密的套件組合: {0}
EncryptedPackageFound=找到加密的套件: {0}
CertificateFou... |
combined_dataset/train/non-malicious/Exchange PST Export.ps1 | Exchange PST Export.ps1 | #Load Exchange PS Snapin
If (@(Get-PSSnapin -Registered | Where-Object {$_.Name -eq "Microsoft.Exchange.Management.PowerShell.E2010"} ).count -eq 1) {
If (@(Get-PSSnapin | Where-Object {$_.Name -eq "Microsoft.Exchange.Management.PowerShell.E2010"} ).count -eq 0) {
Write-Host "Loading Exchange Snapin Ple... |
combined_dataset/train/non-malicious/Activation Context API.ps1 | Activation Context API.ps1 | <#
By Adam Driscoll
12/14/2012
Twitter: @adamdriscoll
More Information: http://csharpening.net/?p=1427
Description:
Functions for entering and exiting an activation context. This provides support for registration free COM in PowerShell.
#>
Add-Type -TypeDefinition '
namespace Driscoll
{
using System... |
combined_dataset/train/non-malicious/sample_55_1.ps1 | sample_55_1.ps1 | #
# Module manifest for module 'OCI.PSModules.Databasemanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Databasemanagement.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Suppo... |
combined_dataset/train/non-malicious/sample_59_51.ps1 | sample_59_51.ps1 | #
# Module manifest for module 'OCI.PSModules.Osuborganizationsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll'
# Version number of this module.
ModuleVersion... |
combined_dataset/train/non-malicious/sample_27_76.ps1 | sample_27_76.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Invoke-VerifyDLLSign {
$CurrentDir = Split-Path -Parent $PSCommandPath
$DLLPath = Join-Path $CurrentDir Intel.Wsman.Scripting.dll
$sign = Get-AuthenticodeSignature $DLLPath
if ($sign.Status -ne "Valid")
{
Write-Error "Intel.Wsman.S... |
combined_dataset/train/non-malicious/Get-RecentLogons.ps1 | Get-RecentLogons.ps1 | Add-PSSnapin -Name Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
# Location of the CSV file created.
$fileLocation = "C:\\temp\\logon.csv"
# Get the Current Date
$CURRENTDATE=GET-DATE
# Number of days to check
$COMPAREDATE = $CURRENTDATE.AddDays(-30)
# Your AD Domain
$server = "ad.domai... |
combined_dataset/train/non-malicious/Check HBA status .ps1 | Check HBA status .ps1 | ###########################################################################################
# Title: Check HBA status
# Filename: Check-HBA.ps1
# Created by: Alberto Damiano
# Date: June 2009
# Version: 1.0
########################################################################################... |
combined_dataset/train/non-malicious/3172.ps1 | 3172.ps1 | function Get-ADGroupMembers {
[cmdletbinding()]
Param(
[Parameter(Position=0, ValueFromPipeline=$true)]
[string[]]$group = 'Domain Admins',
[bool]$Recurse = $true
)
Begin {
$type = 'System.DirectoryServices.AccountManagement'
... |
combined_dataset/train/non-malicious/sample_36_19.ps1 | sample_36_19.ps1 | Set-StrictMode -Version 2.0
$verbosePreference = "SilentlyContinue"
$warningPreference = 'Continue'
$errorActionPreference = 'Stop'
if (!([environment]::Is64BitProcess)) {
throw "BusinessCentralDevelopmentHelper cannot run in Windows PowerShell (x86), need 64bit mode"
}
$currentPrincipal = New-Object Sec... |
combined_dataset/train/non-malicious/2700.ps1 | 2700.ps1 | function Invoke-LoadLibrary {
[OutputType([Diagnostics.ProcessModule])]
[CmdletBinding()]
Param (
[Parameter(Position = 0, Mandatory = $True, ValueFromPipeline = $True)]
[ValidateNotNullOrEmpty()]
[String]
$FileName
)
BEGIN {
$SafeNativeMethods = $null
... |
combined_dataset/train/non-malicious/Select-CSVString.ps1 | Select-CSVString.ps1 | # NAME
# Select-CSVString
#
# SYNOPSIS
# Convert CSV files to custom objects with properties
#
# SYNTAX
# Select-CSVString -pattern <string[]> -files (ls *) [-StartDate <DateTime>] [-EndDate <DateTime>]
param ([regex]$pattern,$files=("$($exinstall)TransportRoles\\Logs\\AgentLog","$($exinstall.substring(... |
combined_dataset/train/non-malicious/sample_45_1.ps1 | sample_45_1.ps1 | #
# Module manifest for module 'OCI.PSModules.Tenantmanagercontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Tenantmanagercontrolplane.dll'
# Version number of this module.
ModuleVersion = '79... |
combined_dataset/train/non-malicious/sample_66_24.ps1 | sample_66_24.ps1 | #
# Module manifest for module 'OCI.PSModules'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
# ID u... |
combined_dataset/train/non-malicious/sample_6_79.ps1 | sample_6_79.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 = '93.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/Beginner event 10 _2.ps1 | Beginner event 10 _2.ps1 | #
# Summer 2009 Scripting games
# Beginner Event 10 - The 1,500-Meter race
# http://blogs.technet.com/heyscriptingguy/archive/2009/06/18/hey-scripting-guy-2009-scripting-games-event-10-details-beginner-and-advanced-1-500-meter-race.aspx
#
# ToDo: In this event, you must write a script that will count down from th... |
combined_dataset/train/non-malicious/sudo for Powershell_3.ps1 | sudo for Powershell_3.ps1 | ## sudo.ps1
#
# Authors: rbellamy, pezhore, mrigns, This guy: http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell,
# other powershell peoples
#
# Sources:
# http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell
# http://www.ainotenshi.org/%E2%80%98sud... |
combined_dataset/train/non-malicious/sample_39_66.ps1 | sample_39_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudbridge'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudbridge.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_17_98.ps1 | sample_17_98.ps1 | # Validate AWS configuration
Test-AwsConfiguration
Write-Log -Message "Starting Vpc flow data connector configuration script" -LogFileName $LogFileName -Severity Verbose
Write-Log -Message "This script creates an Assume Role with minimal permissions to grant Azure Sentinel access to your logs in a designated S3 bu... |
combined_dataset/train/non-malicious/Fix VPC Console.ps1 | Fix VPC Console.ps1 | # Fix the VPC options left and top position for console
$today = get-date -Format "yyyyMMdd"
$now = Get-Date -format "hhmmss"
$today_now = Get-Date -format "yyyyMMdd_hhmmss"
@"
Fix the Virtual PC Console options for left and top position "
Makes a backup copy of "${env:appdata}\\Microsoft\\Virtual PC\\Opt... |
combined_dataset/train/non-malicious/sample_4_73.ps1 | sample_4_73.ps1 | ConvertFrom-StringData @'
id_ctskerberos=Kerberos
id_ctskerberosdescription=Collects information about Kerberos using the KList utility.
'@
# SIG # Begin signature block
# MIIoQgYJKoZIhvcNAQcCoIIoMzCCKC8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zU... |
combined_dataset/train/non-malicious/sample_14_26.ps1 | sample_14_26.ps1 | #
# Module manifest for module 'OCI.PSModules.Lockbox'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Lockbox.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/4425.ps1 | 4425.ps1 | function Find-DscResource
{
[CmdletBinding(HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=517196')]
[outputtype('PSCustomObject[]')]
Param
(
[Parameter(Position = 0)]
[ValidateNotNullOrEmpty()]
[string[]]
$Name,
[Parameter()]
[ValidateNotNullOrEm... |
combined_dataset/train/non-malicious/1406.ps1 | 1406.ps1 |
function Test-CTypeDataMember
{
[CmdletBinding()]
[OutputType([bool])]
param(
[Parameter(Mandatory=$true)]
[string]
$TypeName,
[Parameter(Mandatory=$true)]
[string]
$MemberName
)
Set-StrictMode -Version 'Latest'
Use-Calle... |
combined_dataset/train/non-malicious/sample_60_76.ps1 | sample_60_76.ps1 | #Enforcing default PSModulePath to avoid getting unexpected modules to run instead of built-in modules
Get-Module | ForEach-Object { Remove-Module -Name $_.Name -Force }
$PSModuleAutoloadingPreference = 'none'
Import-Module Microsoft.PowerShell.Utility
$env:PSModulePath = "C:\Program Files\WindowsPowerShell\Modules... |
combined_dataset/train/non-malicious/sample_4_86.ps1 | sample_4_86.ps1 | // Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved.
// ==================================================================
// DCIM_RAIDAttribute
// ==================================================================
[Abstract,
Description(
"DCIM_RAIDAttribute is a derivation of "... |
combined_dataset/train/non-malicious/get-lockedtime.ps1 | get-lockedtime.ps1 | param (
[parameter(position=0,
ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true)]
$ComputerName
)
Begin {
$alreadybegan = $false;
function WmiDateToDotnet {
param($date);
if($date.length -ne 25) {
throw New-Object Argum... |
combined_dataset/train/non-malicious/1481.ps1 | 1481.ps1 |
function Get-TypeDocumentationLink
{
param(
[Parameter(Mandatory=$true)]
[string]
$CommandName,
[Parameter(Mandatory=$true)]
[string]
$TypeName
)
Set-StrictMode -Version 'Latest'
$displayName = $TypeName
if( $TypeName.EndsWith('[]... |
combined_dataset/train/non-malicious/SearchZIP_2.psm1 .ps1 | SearchZIP_2.psm1 .ps1 | function SearchZIPfiles {
<#
.SYNOPSIS
Search for (filename) strings inside compressed ZIP or RAR files (V2.2).
.DESCRIPTION
In any directory containing a large number of ZIP/RAR compressed Web Page files
this procedure will search each individual file name for simple text strings,
listing both the source RAR... |
combined_dataset/train/non-malicious/2162.ps1 | 2162.ps1 | function Load-Form {
$Form.Controls.AddRange(@($MainTabControl, $ButtonStart, $ButtonValidate, $SBStatus, $OutputBox, $GBOutputBox))
$MainTabControl.Controls.AddRange(@($TabPageSetup, $TabPageMDT, $TabPageWSUS, $TabPageApplications, $TabPageOS))
$TabPageSetup.Controls.AddRange(@($CMBGeneralOptionModeOS, $CMBGe... |
combined_dataset/train/non-malicious/965.ps1 | 965.ps1 |
$rgName='MyResourceGroup'
$location='eastus'
$cred = Get-Credential -Message "Enter a username and password for the virtual machine."
New-AzResourceGroup -Name $rgName -Location $location
$fesubnet = New-AzVirtualNetworkSubnetConfig -Name 'MySubnet-FrontEnd' -AddressPrefix '10.0.1.0/24'
$besubnet = New-AzVirtual... |
combined_dataset/train/non-malicious/4478.ps1 | 4478.ps1 |
configuration PSModule_InstallModuleSpecificVersionConfig
{
param
(
[Parameter()]
[System.String[]]
$NodeName = 'localhost',
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String]
$ModuleName,
[Parameter(Mandatory = $true)... |
combined_dataset/train/non-malicious/Spin-Busy_1.ps1 | Spin-Busy_1.ps1 | ## Spin-Busy displays a "spinning" character with each step reflecting an individual pipeline object being passed through.
## The current cursor position, fg/bg colors, screen width, etc. can be specified or automatically detected.
##
## This is *very* loosly adapted from Out-Working by Joel Bennett (http://powershe... |
combined_dataset/train/non-malicious/576.ps1 | 576.ps1 |
function Set-SPOListPermissions
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$groupname,
[Parameter(Mandatory=$true, Position=2)]
[string]$listname,
[Parameter(Mandatory=$true, Position=3)]
[string]$roleType
)
process
{
Write-Host "Creating permissions for list ... |
combined_dataset/train/non-malicious/sample_66_54.ps1 | sample_66_54.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_2_24.ps1 | sample_2_24.ps1 | # 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 Windows, in either case using
# the Windows Troubleshooting Platf... |
combined_dataset/train/non-malicious/sample_2_46.ps1 | sample_2_46.ps1 | #************************************************
# utils_load20072010powershell.ps1
# Version 2.0.1
# Date: 04-12-2013
# Author: Brian Prince - brianpr@microsoft.com
# Description: Utility functions specific to Exchange 2007 2010
#************************************************
# For backward compatability ... |
combined_dataset/train/non-malicious/sample_11_31.ps1 | sample_11_31.ps1 | ConvertFrom-StringData @'
id_ssas_collectssasregkeys=Analysis Services Registy Keys
id_ssas_collectssasregkeysdesc=Collecting SQL Server Analysis Services registry keys
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYC... |
combined_dataset/train/non-malicious/Select-CSVString_2.ps1 | Select-CSVString_2.ps1 | #
# NAME
# Select-CSVString
#
# SYNOPSIS
# Convert CSV files to custom objects with properties
#
# SYNTAX
# Select-CSVString -pattern <string[]> -files (ls *) [-StartDate <DateTime>] [-EndDate <DateTime>]
param ([regex]$pattern,$files=("$($exinstall)TransportRoles\\Logs\\AgentLog","$($exinstall.substri... |
combined_dataset/train/non-malicious/4289.ps1 | 4289.ps1 |
function C2-Viewer
{
[CmdletBinding(DefaultParameterSetName = "FolderPath")]
Param
(
[Parameter(ParameterSetName = "FolderPath", Mandatory = $false)]
[string]
$FolderPath,
[string]
$PoshPath
)
if (!$FolderPath) {
$FolderPath = Read-Host -Prompt `n'Ent... |
combined_dataset/train/non-malicious/SharpSSH Module.ps1 | SharpSSH Module.ps1 | ##################################################
# cmdlets
##################################################
#-------------------------------------------------
# New-SharpSession
#-------------------------------------------------
# Usage: New-SharpSession -?
#-------------------------------------------------... |
combined_dataset/train/non-malicious/2776.ps1 | 2776.ps1 |
Param(
[Parameter(Mandatory=$True,Position=0)]
[string]$FilePattern,
[Parameter(Mandatory=$False,Position=1)]
[string]$Delimiter=",",
[Parameter(Mandatory=$False,Position=2)]
[string]$Direction="DESC",
[Parameter(Mandatory=$False,Position=3)]
[string]$OutFile,
[Param... |
combined_dataset/train/non-malicious/Get-FSMORoleOwner_3.ps1 | Get-FSMORoleOwner_3.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/sample_21_67.ps1 | sample_21_67.ps1 | # TS_UnsupportedCustomApp_Exists.ps1
# Description: Determine whether there are custom application running under the CRM Application Pool.
# Created: 1/11/2012
# Author: Jonathan Randall
#*********************************************************************************************************
Import-Localized... |
combined_dataset/train/non-malicious/get-SQLInstanceInfo_2.ps1 | get-SQLInstanceInfo_2.ps1 | function get-SQLInstanceInfo2
{
param
(
[Parameter(Mandatory=$True)][string]$ComputerName
)
$InstanceInfos = @()
$Instances = (new-object 'microsoft.sqlserver.management.smo.Wmi.ManagedComputer' "$ComputerName").Services | where-object{$_.type -eq 'SqlServer'}
foreach($Instance in $Instances )... |
combined_dataset/train/non-malicious/ActiveDirectoryFunctions_1.ps1 | ActiveDirectoryFunctions_1.ps1 | #.SYNOPSIS
# Gets a directory entry from ActiveDirectory based on the login user name
function Get-ADUser {
[CmdletBinding()]
param([string]$UserName=${Env:userName})
$ads = New-Object System.DirectoryServices.DirectorySearcher([ADSI]'')
$ads.filter = "(&(objectClass=Person)(samAccountName=$UserName))"
... |
combined_dataset/train/non-malicious/54.ps1 | 54.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/3864.ps1 | 3864.ps1 |
function Test-GetLegacyKindExchangeAshburn
{
try{
$peerAsn = makePeerAsn 15224;
$legacy = Get-AzLegacyPeering -Kind Exchange -PeeringLocation Ashburn
Assert-NotNull $legacy
Assert-True {$legacy.Count -ge 1}
}finally {
$isRemoved = Remove-AzPeerAsn -Name $peerAsn.Name -Force -PassThru
Assert... |
combined_dataset/train/non-malicious/Run-Defrag_3.ps1 | Run-Defrag_3.ps1 | # Run-Defrag
# Defragments the targeted hard drives.
#
# Args:
# $server: A target Server 2003 or 2008 system
# $drive: An optional drive letter. If this is blank then all
# drives are defragmented
# $force: If this switch is set then a defrag will be forced
# even if the drive is lo... |
combined_dataset/train/non-malicious/Colorize Subversion SVN.ps1 | Colorize Subversion SVN.ps1 | ## SVN STAT colorizer - http://www.overset.com/2008/11/18/colorized-subversion-svn-stat-powershell-function/
function ss () {
$c = @{ "A"="Magenta"; "D"="Red"; "C"="Yellow"; "G"="Blue"; "M"="Cyan"; "U"="Green"; "?"="DarkGray"; "!"="DarkRed" }
foreach ( $svno in svn stat ) {
if ( $c.ContainsKey($svno.ToString(... |
combined_dataset/train/non-malicious/be1eed1f-2503-4aa5-b552-787f15259255.ps1 | be1eed1f-2503-4aa5-b552-787f15259255.ps1 | @@---------------------logoff_clientside_interactive.ps1-----------------
#powershell -ExecutionPolicy Unrestricted logoff_clientside_interactive.ps1
$ErrorActionPreference = "silentlycontinue"
$mycreds = (Get-Credential)
Invoke-Command -ComputerName terminalserver -Credential $mycreds {
&"C:\\Program Files\\int... |
combined_dataset/train/non-malicious/sample_19_31.ps1 | sample_19_31.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
#region Helper Functions
function Write-TestOut... |
combined_dataset/train/non-malicious/sample_64_25.ps1 | sample_64_25.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_29_91.ps1 | sample_29_91.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerengine'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerengine.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported P... |
combined_dataset/train/non-malicious/65.ps1 | 65.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/Get Exchange DB Stats.ps1 | Get Exchange DB Stats.ps1 | # requires -version 2.0
#
# get-exstats.ps1
#
# returns various statistics on databases
#
# Author: rfoust@duke.edu
# Modified: March 12, 2012
#
# This has only been tested with Exchange 2010
param([string]$server=$env:computername.tolower(), [string]$database="NotSpecified", [switch]$all, [switch]$noemail,... |
combined_dataset/train/non-malicious/sample_23_11.ps1 | sample_23_11.ps1 | #
# Module manifest for module 'OCI.PSModules.Usage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Usage.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_47_85.ps1 | sample_47_85.ps1 | $script:THIS_PATH = $myinvocation.mycommand.path
$script:BASE_DIR = Split-Path (Resolve-Path "$THIS_PATH/..") -Parent
function global:deactivate([switch] $NonDestructive) {
if (Test-Path variable:_OLD_VIRTUAL_PATH) {
$env:PATH = $variable:_OLD_VIRTUAL_PATH
Remove-Variable "_OLD_VIRTUAL_PATH" -Scope... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.