full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/2192.ps1 | 2192.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[string]$SiteServer,
[parameter(Mandatory=$false, HelpMessa... |
combined_dataset/train/non-malicious/248.ps1 | 248.ps1 | $scripts = Get-ChildItem -Path $PSScriptRoot -Recurse -Filter *.ps1 |
Where-Object FullName -NotMatch '.Tests.'
[regex]$regex = "(^[A-Z\-]+-)"
Describe -Tag 'Help' 'Help' {
foreach ($script in $scripts) {
Context "[$($script.BaseName)] Validate Comment Based Help" {
... |
combined_dataset/train/non-malicious/mGet-DatastoreList.ps1 | mGet-DatastoreList.ps1 | Function mGet-DatastoreList {
#Parameter- Name of the VMware cluster to choose a datastore from.
param($Cluster)
#get alphabetically last ESX host in the VMware cluster (it's likely the last host added to the cluster, so this might smoke out any problems)
$VMH = get-vmhost -Location $cluster | Where-Object { ($_.... |
combined_dataset/train/non-malicious/2998.ps1 | 2998.ps1 | function In {
[CmdletBinding()]
param(
$path,
[ScriptBlock] $execute
)
Assert-DescribeInProgress -CommandName In
$old_pwd = $pwd
& $SafeCommands['Push-Location'] $path
$pwd = $path
try {
Write-ScriptBlockInvocationHint -Hint "In" -ScriptBlock $execute
... |
combined_dataset/train/non-malicious/sample_8_11.ps1 | sample_8_11.ps1 | # diag_api.psm1
# by tdimli
# March 2020
# API/helper functions
# errors reported by these diagnostics won't be shown on screen to user
# only saved to xray_ISSUES-FOUND_*.txt report file
$Global:BETA_DIAGS = "
net_802dot1x_KB4556307,
net_firewall_KB4561854,
net_wlan_KB4557342,
net_dnscli_KB4562541,
net_da... |
combined_dataset/train/non-malicious/VMtoolsUpgrade-disable.ps1 | VMtoolsUpgrade-disable.ps1 | #####################################################################
# TIAA-CREF VMWare Standard Scripts - PowerCLI
#
# Purpose: "Check and upgrade Tools during power cycling"
# Author: David Chung
# Support: IT Infrastructure
# Docs: N/A
#
# Instruction: 1. Create CSV file with list of servers
# ... |
combined_dataset/train/non-malicious/4271.ps1 | 4271.ps1 | function Invoke-DCSync
{
[CmdletBinding(DefaultParameterSetName="DumpCreds")]
Param(
[Parameter(Position = 0,ValueFromPipeline=$true)]
[Array[]]
$Users,
[String]
$GroupName,
[String]
$UserFilter,
[Switch]
$GetComputers = $false,
[Switch]
$OnlyActive = $true,
[Switc... |
combined_dataset/train/non-malicious/3446.ps1 | 3446.ps1 |
function Test-Table
{
$dfname = Get-DataFactoryName
$rgname = Get-ResourceGroupName
$rglocation = Get-ProviderLocation ResourceManagement
$dflocation = Get-ProviderLocation DataFactoryManagement
New-AzResourceGroup -Name $rgname -Location $rglocation -Force
try
{
... |
combined_dataset/train/non-malicious/sample_39_26.ps1 | sample_39_26.ps1 | #
# Module manifest for module 'OCI.PSModules.Genericartifactscontent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Genericartifactscontent.dll'
# Version number of this module.
ModuleVersion = '80.0.0... |
combined_dataset/train/non-malicious/sample_13_72.ps1 | sample_13_72.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al... |
combined_dataset/train/non-malicious/sample_66_11.ps1 | sample_66_11.ps1 | #
# Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker'
#
# Generated by: Microsoft Corporation
#
# Generated on: 19/01/2022
#
@{
# Script module or binary module file associated with this manifest.
RootModule = ''
# Version number of this module.
ModuleVersion = '1.2100.26... |
combined_dataset/train/non-malicious/sample_34_14.ps1 | sample_34_14.ps1 | function Get-Project-Definition {
try {
$projectRoot = Get-Project-Root
$projectJsonFile = Join-Path -Path $projectRoot -ChildPath "Custom/devops/project.json"
return Get-Content $projectJsonFile -ErrorAction Stop | Out-String | ConvertFrom-Json
} catch {
return @{}
}
}
func... |
combined_dataset/train/non-malicious/1154.ps1 | 1154.ps1 |
$username = 'CarbonRemoveUser'
$password = 'IM33tRequ!rem$'
function Start-Test
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
net user $username $password /add
}
function Stop-Test
{
if( Test-User -Username $username )
{
... |
combined_dataset/train/non-malicious/sample_33_17.ps1 | sample_33_17.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_56_93.ps1 | sample_56_93.ps1 | param([int]$Count=50, [int]$DelayMilliseconds=200)
function Write-Item($itemCount) {
$i = 1
while ($i -le $itemCount) {
$str = "Output $i"
Write-Output $str
# In the gutter on the left, right click and select "Add Conditional Breakpoint"
# on the next line. Use the c... |
combined_dataset/train/non-malicious/Test-UserCredential.ps1 | Test-UserCredential.ps1 | function Test-UserCredential {
[CmdletBinding()] [OutputType([System.Boolean])]
param(
[Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()]
[System.String] $Username,
[Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()]
[System.String] $Password,
[Parameter()]
[Switch] $Domain
)
... |
combined_dataset/train/non-malicious/ImaginaryFriendFeed_1.ps1 | ImaginaryFriendFeed_1.ps1 | #.SYNOPSIS
# A few functions for working with FriendFeed and Twitter
#.DESCRIPTION
# Allows you to copy your users from Twitter to imaginary FriendFeed users...
#.EXAMPLE
# ## Get any twitter friends who aren't on friendfeed
# ## Make sure you use FriendFeed's built in "add all your twitter friends" first
# $t... |
combined_dataset/train/non-malicious/sample_5_92.ps1 | sample_5_92.ps1 | <# Script name: tss_WorkFoldersDiag.ps1
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# THIS SAMPLE CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
# WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FO... |
combined_dataset/train/non-malicious/sample_12_40.ps1 | sample_12_40.ps1 | ConvertFrom-StringData @'
id_dcdiag=Directory Server Diagnosis (DCDiag)
id_dcdiagobtaining=Running DCDIAG.EXE tool to gather domain controller status information.
id_dcdiagdnsobtaining=Running DCDIAG.EXE tool to gather domain controller DNS health information.
id_dcdiagtopologyobtaining=Running DCDIAG.EXE tool to g... |
combined_dataset/train/non-malicious/sample_41_24.ps1 | sample_41_24.ps1 | #
# Module manifest for module 'OCI.PSModules.Core'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Core.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_51_41.ps1 | sample_51_41.ps1 | # Localized 06/28/2023 07:58 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Solución de problemas
Troubleshoot_DetectDVDDevice=Comprobando dispositivo de DVD...
Troubleshoot_DetectDVDvideoDecoder=Comprobando descodificador de vídeo para la reproducción de DVD... |
combined_dataset/train/non-malicious/sample_35_54.ps1 | sample_35_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Appmgmtcontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Appmgmtcontrol.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSE... |
combined_dataset/train/non-malicious/sample_14_43.ps1 | sample_14_43.ps1 | [CmdletBinding()]
param
(
[Parameter(Mandatory=$true, ValueFromPipeline=$true)]
[string]$Path
)
Import-Module $(Join-Path $PSSCriptRoot Helpers.psm1)
$created = $(git log -1 --format="format:%ci" --diff-filter=A -- $Path)
try
{
[datetime]::Parse($created)
}
catch
{
""
}
# SIG # Begin si... |
combined_dataset/train/non-malicious/sample_22_93.ps1 | sample_22_93.ps1 | #
# Module manifest for module 'OCI.PSModules.Secrets'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Secrets.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/1578.ps1 | 1578.ps1 |
function Test-MrURL {
[CmdletBinding()]
param (
[string]$Uri,
[switch]$Detailed
)
$CurrentErrorAction = $ErrorActionPreference
$ErrorActionPreference = 'SilentlyContinue'
$Result = Invoke-WebRequest -Uri $Uri -TimeoutSec 30
$ErrorActionPreference = $CurrentErrorAction
... |
combined_dataset/train/non-malicious/1822.ps1 | 1822.ps1 |
function Assert-ListsSame
{
param([object[]] $expected, [object[]] $observed )
$compResult = Compare-Object $observed $expected | Select-Object -ExpandProperty InputObject
if ($compResult)
{
$observedList = ([string]::Join("|",$observed))
$expectedList = ([string]::Join("|",$expecte... |
combined_dataset/train/non-malicious/sample_52_98.ps1 | sample_52_98.ps1 | #
# Module manifest for module 'OCI.PSModules.Jmsjavadownloads'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported... |
combined_dataset/train/non-malicious/Ping-Host.ps1 | Ping-Host.ps1 | function Ping-Host {param( [string]$HostName,
[int32]$Requests = 3)
for ($i = 1; $i -le $Requests; $i++) {
$Result = Get-WmiObject -Class Win32_PingStatus -ComputerName . -Filter "Address='$HostName'"
Start-Sleep -Seconds 1
if ($Result.StatusCode -ne 0) {return $FALSE}
}
return $TRUE
}
|
combined_dataset/train/non-malicious/sample_26_77.ps1 | sample_26_77.ps1 | # <copyright>
# INTEL CONFIDENTIAL
#
# Copyright 2022 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you ("License").
# Unless the License provides otherwise, you may not us... |
combined_dataset/train/non-malicious/2851.ps1 | 2851.ps1 | function Framework {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$framework
)
$psake.context.Peek().config.framework = $framework
ConfigureBuildEnvironment
}
|
combined_dataset/train/non-malicious/sample_40_60.ps1 | sample_40_60.ps1 | #
# Module manifest for module 'OCI.PSModules.Blockchain'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Blockchain.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_22_36.ps1 | sample_22_36.ps1 |
///////////////////////////////////////////////////////////////////////////////
// Helper to set a designer prop
///////////////////////////////////////////////////////////////////////////////
function setDesignerProp(tname, ttype, tvalue) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)... |
combined_dataset/train/non-malicious/DriveSpace.format.ps1xml.ps1 | DriveSpace.format.ps1xml.ps1 | <?xml version="1.0" encoding="utf-8" ?>
<Configuration>
<Controls>
<Control>
<Name>DriveSpaceChart</Name>
<CustomControl>
<CustomEntries>
<CustomEntry>
<CustomItem>
<Frame>
<CustomItem>
... |
combined_dataset/train/non-malicious/sample_36_75.ps1 | sample_36_75.ps1 | #
# Module manifest for module 'OCI.PSModules.Dns'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dns.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_62_48.ps1 | sample_62_48.ps1 | <##############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
##############################################################>... |
combined_dataset/train/non-malicious/sample_36_74.ps1 | sample_36_74.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 = '75.1.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_25_21.ps1 | sample_25_21.ps1 | #
# PowerConsole profile
#
<#
.SYNOPSIS
Clear the host content.
.DESCRIPTION
This function replaces the standard Clear-Host and is aliased by "cls".
#>
function Clear-Host
{
$host.PrivateData.ClearHost()
}
<#
.SYNOPSIS
Simple path completion function for PowerConsole.
#>
funct... |
combined_dataset/train/non-malicious/Get-CryptoBytes.ps1 | Get-CryptoBytes.ps1 | function Get-CryptoBytes {
#.Synopsis
# Generate Cryptographically Random Bytes
#.Description
# Uses RNGCryptoServiceProvider to generate arrays of random bytes
#.Parameter Count
# How many bytes to generate
#.Parameter AsString
# Output hex-formatted strings instead of byte arrays
param(
[Parameter(Va... |
combined_dataset/train/non-malicious/DataStoreBalancer.ps1 | DataStoreBalancer.ps1 | #======================================================================================
# File Name : DataStoreBalancer.ps1
# Original Author : Kenneth C. Mazie
# Description : Scans VM datastores and moves a single VM from the most heavily
# : loaded to the... |
combined_dataset/train/non-malicious/AD_bulk_new_OU_1.ps1 | AD_bulk_new_OU_1.ps1 | param(
$searchBase = "OU=Organisation,DC=uza,DC=local",
$NewOUs = @(Import-csv -Path "d:\\projects\\AD\\departments.csv" -Delimiter ";"),
$SubOUs = @("Computers","Users"),
[switch]$ProtectOU
)
$Protect = $false
If ($ProtectOU){$Protect = $true}
foreach ($NewOU in $NewOUs){
New-ADOrganizationalUnit -Name $New... |
combined_dataset/train/non-malicious/3323.ps1 | 3323.ps1 |
function Disable-Plugin {
[PoshBot.BotCommand(
Aliases = ('dp', 'disableplugin'),
Permissions = 'manage-plugins'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string]$Name,
[parameter(Positio... |
combined_dataset/train/non-malicious/sample_46_54.ps1 | sample_46_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Vulnerabilityscanning'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vulnerabilityscanning.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
#... |
combined_dataset/train/non-malicious/sample_9_75.ps1 | sample_9_75.ps1 | #************************************************
# TS_DellPowerEdgeBiosCheck.ps1
# Version 1.0.1
# Date: 5/9/2012
# Author: v-alyao
# Description: [Idea ID 2842] [Windows] Alert Engineers if they are working on a Dell machine models R910, R810 and M910
# Rule number: 2842
# Rule URL: //sharepoint/sites/rules... |
combined_dataset/train/non-malicious/sample_0_21.ps1 | sample_0_21.ps1 | ConvertFrom-StringData @'
id_sccm_activity_collectconfigmgrlogs=Obtaining Configuration Manager Logs
id_sccm_ccm_collectconfigmgrlogs=Copying CCM Logs...
id_sccm_sms_collectconfigmgrlogs=Copying SMS Logs...
id_sccm_crashdumps_collectconfigmgrlogs=Copying most recent copy of SMS CrashDumps...
id_sccm_adminui_collec... |
combined_dataset/train/non-malicious/sample_9_90.ps1 | sample_9_90.ps1 | <#
.SYNOPSIS
MSRD-Collect graphical user interface (Lite version)
.DESCRIPTION
Module for the MSRD-Collect graphical user interface (Lite version)
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedback : https://aka.ms/MSRD-C... |
combined_dataset/train/non-malicious/sample_7_80.ps1 | sample_7_80.ps1 | #************************************************
# DC_UEXCollect.ps1
# Version 1.0
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects Windows Explorer DAT files and TWinUI Eventlogs
# Called from: TS_AutoAddCommands_Apps.ps1
#*************************************************... |
combined_dataset/train/non-malicious/sample_18_40.ps1 | sample_18_40.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplacepublisher'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplacepublisher.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# S... |
combined_dataset/train/non-malicious/ConvertTo-ASCII.ps1 | ConvertTo-ASCII.ps1 | #requires –version 2.0
#region Help
<#
.SYNOPSIS
Automation script for file character set format convertion to ASCII encoding.
.DESCRIPTION
Script for automating the convertion of files to ASCII format. Good for if you've used Out-File without specifying the
encoding. Which would make a Unicode formatted... |
combined_dataset/train/non-malicious/3326.ps1 | 3326.ps1 |
function New-Role {
[PoshBot.BotCommand(
Aliases = ('nr', 'newrole'),
Permissions = 'manage-roles'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string[]]$Name,
[parameter(Position = 1)]
... |
combined_dataset/train/non-malicious/Start-Process.ps1 | Start-Process.ps1 | function Start($app,$param) {
if($param) {
[Diagnostics.Process]::Start( $app, $param )
} else {
[Diagnostics.Process]::Start( $app )
}
}
|
combined_dataset/train/non-malicious/1359.ps1 | 1359.ps1 |
function Install-CIisWebsite
{
[CmdletBinding()]
[OutputType([Microsoft.Web.Administration.Site])]
param(
[Parameter(Position=0,Mandatory=$true)]
[string]
$Name,
[Parameter(Position=1,Mandatory=$true)]
[Alias('Path')]
[string]
... |
combined_dataset/train/non-malicious/sample_28_43.ps1 | sample_28_43.ps1 | #
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ... |
combined_dataset/train/non-malicious/sample_35_10.ps1 | sample_35_10.ps1 |
function Edit-AzDataProtectionPolicyRetentionRuleClientObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBackupPolicy')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Adds or removes Retention Rule to e... |
combined_dataset/train/non-malicious/613.ps1 | 613.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://winscp.net/download/files/20140928102737e06fdcc6e29eab780afd57975c84fa/winscp555setup.exe"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ForEach-Objec... |
combined_dataset/train/non-malicious/sample_59_47.ps1 | sample_59_47.ps1 | function EnsureAdminPrivileges([String]$mesageOnError)
{
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = new-object Security.Principal.WindowsPrincipal $identity
if (!($principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)))
{
Write-Error $m... |
combined_dataset/train/non-malicious/Script-Object_2.ps1 | Script-Object_2.ps1 | #Copyright (c) 2011 Justin Dearing
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, dist... |
combined_dataset/train/non-malicious/3975.ps1 | 3975.ps1 |
function DeleteIfExistsNetworkWatcher($location)
{
$nwlist = Get-AzNetworkWatcher
foreach ($i in $nwlist)
{
if($i.Location -eq "$location")
{
$nw=$i
}
}
if ($nw)
{
$job = Remove-AzNetworkWatcher -NetworkWatcher $nw -AsJob
$job | Wait-Job
}
}
function Test-NetworkWatcherCRUD
{... |
combined_dataset/train/non-malicious/Open-ISEFile.ps1 | Open-ISEFile.ps1 | #Requires -Version 2.0
function Open-ISEFile {
<#
.NOTES
Name: Open-ISEFile
Author: Tome Tanasovski
Created: 6/20/2010
Version: 1.0
.SYNOPSIS
Open a new file in ISE
.DESCRIPTION
This cmdlet allows you to open a file in a new file tab w... |
combined_dataset/train/non-malicious/sample_19_47.ps1 | sample_19_47.ps1 | function Get-RoleAndCloudWatchS3Policy
{
<#
.SYNOPSIS
Creates a S3 Policy for GuardDuty based on specified bucket name, role ARN, and Kms ARN
.PARAMETER RoleArn
Specifies the Role ARN
.PARAMETER BucketName
Specifies the S3 Bucket
.PARAMETER KmsArn
Specifies the KMS ARN
... |
combined_dataset/train/non-malicious/sample_46_37.ps1 | sample_46_37.ps1 |
function getWorldMatrix(element) {
return element.getTrait("WorldTransform").value;
}
var isOrtho = false;
function getCameraElement() {
var camera = document.elements.findElementByTypeId("Microsoft.VisualStudio.3D.PerspectiveCamera");
if (camera == null) {
isOrtho = true;
came... |
combined_dataset/train/non-malicious/1894.ps1 | 1894.ps1 |
Describe "Remove-Event" -Tags "CI" {
BeforeEach {
New-Event -sourceidentifier PesterTimer -sender Windows.timer -messagedata "PesterTestMessage"
}
AfterEach {
Remove-Event -sourceidentifier PesterTimer -ErrorAction SilentlyContinue
}
Context "Check Remove-Event can validly remove events" {
... |
combined_dataset/train/non-malicious/sample_16_30.ps1 | sample_16_30.ps1 | #
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ... |
combined_dataset/train/non-malicious/510.ps1 | 510.ps1 |
function Sync-ADGroupMember{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
$ADGroup,
[Parameter(Mandatory=$true)]
[Array]
$Member,
[Parameter(Mandatory=$false)]
[ScriptBlock]
$LogScriptBlock,
[switch]
$OnlyAdd,
... |
combined_dataset/train/non-malicious/3600.ps1 | 3600.ps1 |
function Test-AzSecurityAdvancedThreatProtection-ResourceId
{
$testPrefix = "psstorage"
$testParams = Get-AdvancedThreatProtectionTestEnvironmentParameters $testPrefix
$resourceId = "/subscriptions/" + $testParams.subscriptionId + "/resourceGroups/" + $testParams.rgName + "/providers/Microsoft.Stora... |
combined_dataset/train/non-malicious/sample_67_20.ps1 | sample_67_20.ps1 | (window.webpackJsonpTypeScriptModule=window.webpackJsonpTypeScriptModule||[]).push([[196],{3443:function(i){i.exports=JSON.parse('{"copilot-ext-auth-sdk.pluginAuthErrorWithAppNameText":"Để kiểm tra kết quả trong {0}, vui lòng đăng nhập và sau đó gửi lại yêu cầu của bạn.","copilot-ext-auth-sdk.pluginAuthErrorWithoutAppN... |
combined_dataset/train/non-malicious/PowerShellServer Cmdlet _1.ps1 | PowerShellServer Cmdlet _1.ps1 | \n#Global Hashtable to Control all Powershell Server Runspace\nSet-Variable -name '__PSRUNSPACES__' -scope 'global' -value @{} -force\n\nfunction global:New-PowerShellServerRunspace\n{\n param(\n $Credential,\n $ErrorAction='Stop',\n [switch]$Force,\n $Password,\n $Port=22,\n $Server='127.0.0.1',\n $SSHAccept,\n... |
combined_dataset/train/non-malicious/sample_62_2.ps1 | sample_62_2.ps1 | #
# Argument initialization
#
$nextarg = "none"
$DebugPort = "unassigned"
$targetcomputer = "."
$VMName = ""
$VMGuid = ""
$AutoAssign = "false"
$DebugOff = "false"
function funHelp()
{
$helpText=@"
DESCRIPTION:
NAME: kdnetdebugvm.ps1
Displays (and optionally sets) the port used to network debug a V... |
combined_dataset/train/non-malicious/sample_52_74.ps1 | sample_52_74.ps1 | #
# Module manifest for module 'OCI.PSModules.Emaildataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emaildataplane.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSE... |
combined_dataset/train/non-malicious/sample_45_50.ps1 | sample_45_50.ps1 | #
# Module manifest for module 'OCI.PSModules.Identity'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identity.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_39_45.ps1 | sample_39_45.ps1 | import{m as s}from"./index.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/m... |
combined_dataset/train/non-malicious/sample_41_64.ps1 | sample_41_64.ps1 | function Search-AzDataProtectionJobInAzGraph
{
[OutputType('PSObject')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Searches for Backup Jobs in Azure Resource Graph and retrieves the expected entries')]
param (
[Parameter(Man... |
combined_dataset/train/non-malicious/sample_53_96.ps1 | sample_53_96.ps1 | param (
[string]$WorkDir,
# [bool]$ModifyAllCaptions = $true
[string]$strModifyAllCaptions = "false"
)
if ($strModifyAllCaptions -eq "true") {
$ModifyAllCaptions = $true
}
else {
$ModifyAllCaptions = $false
}
$CreateJson = $PSScriptRoot + "\Create-Json.ps1"
$WorkDir = $WorkDir... |
combined_dataset/train/non-malicious/sample_38_83.ps1 | sample_38_83.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerinstances'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerinstances.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Suppo... |
combined_dataset/train/non-malicious/test.ps1 | test.ps1 | function Write-EventDetail {
param(
$id
)
$id | Write-Host
$Event | Write-Host
$EventSubscriber | Write-Host
$Sender | Write-Host
$SourceEventArgs | Write-Host
$SourceArgs | Write-Host
}
'test'
|
combined_dataset/train/non-malicious/Am I a purist_.ps1 | Am I a purist_.ps1 | ###########
# PS1 script to launch gpupdate on all computers in domain, without some stupid QAD cmdlets, just pure PS1 and WMI
# Made by pan_2@LJ (gunkan@yandex.ru)
# Note: if by some reason RPC host was unavaible - there will be exception throwed, I didn't use trap so I can see real reason.
###########
function P... |
combined_dataset/train/non-malicious/Get-Parameter 2.1.ps1 | Get-Parameter 2.1.ps1 | #Requires -version 2.0
#.Synopsis
# Enumerates the parameters of one or more commands
#.Notes
# With many thanks to Hal Rottenberg, Oisin Grehan and Shay Levy
# Version 0.80 - April 2008 - By Hal Rottenberg http://poshcode.org/186
# Version 0.81 - May 2008 - By Hal Rottenberg http://poshcode.org/255
# Ver... |
combined_dataset/train/non-malicious/sample_65_23.ps1 | sample_65_23.ps1 | $url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise.msi';
if ([Environment]::Is64BitProcess) {
$url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi'
}
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\google-chrome.msi"
Write-Host ... |
combined_dataset/train/non-malicious/sample_53_3.ps1 | sample_53_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Database'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Database.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_67_29.ps1 | sample_67_29.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/TSRemoteApp.ps1 | TSRemoteApp.ps1 | function New-TSRemoteApp {
<#
.SYNOPSIS
Creates a new RemoteApp on Windows Server 2008 Terminal Server.
.DESCRIPTION
Creates a new RemoteApp using the supplied parameters.
.PARAMETER Alias
Alias for the new RemoteApp. Accepts ValueFromPipeline and ValueFromPipelineByPropertyName.
.PARAMETER Applicationpath
Pat... |
combined_dataset/train/non-malicious/Format-Hex.ps1 | Format-Hex.ps1 | ##############################################################################\n##\n## Format-Hex\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nOutputs a fil... |
combined_dataset/train/non-malicious/sample_28_20.ps1 | sample_28_20.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ElasticSan.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ElasticSan.internal.psm1'
if(Test-Path $internalModulePath) {
... |
combined_dataset/train/non-malicious/SQLite Read _ Write.ps1 | SQLite Read _ Write.ps1 | # Make sure SQLite.Interop.dll is in the same directory as System.Data.SQLite.dll
$scriptDir = "Path to your SQLite DLL"
Add-Type -Path "$scriptDir\\System.Data.SQLite.dll"
############### SAMPLE USAGE ###################
### Querying:
###
### $readQuery = "SELECT * FROM TABLE"
### $dataArray = $SQLite.q... |
combined_dataset/train/non-malicious/sample_55_17.ps1 | sample_55_17.ps1 | #
# Module manifest for module 'OCI.PSModules.Stackmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Stackmonitoring.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported P... |
combined_dataset/train/non-malicious/Invoke-JQuery.ps1 | Invoke-JQuery.ps1 | function Invoke-JQuery
{
<#
.SYNOPSIS
Function to Invoke JQuery commands via IE COM
.DESCRIPTION
Invokes JQuery (or plain Javascript) commands via InternetExplorer.Application COM object,
after initial injection of JQuery reference in header section.
Useful to utilize JQuery selec... |
combined_dataset/train/non-malicious/4092.ps1 | 4092.ps1 |
[CmdletBinding()]
param
(
[switch]
$Balanced,
[string]
$ConsoleTitle = 'PowerScheme',
[string]
$Custom,
[switch]
$HighPerformance,
[string]
$ImportPowerSchemeFile,
[switch]
$PowerSaver,
[string]
$PowerSchemeName,
[switch]
$Report,
[ValidateSet('MonitorTimeoutAC', 'MonitorTimeoutDC', 'DiskTimeoutAC', '... |
combined_dataset/train/non-malicious/498.ps1 | 498.ps1 |
function Report-FileSystemPermissions{
param(
[parameter(Mandatory=$true)]
[String]$Path,
[parameter(Mandatory=$true)]
[int]$Levels
)
$FileSystemPermissionReport = @()
$FSfolders = Get-ChildItemRecurse -Path $Path -Levels $Levels -OnlyDi... |
combined_dataset/train/non-malicious/340.ps1 | 340.ps1 | function Export-PSFConfig
{
[CmdletBinding(DefaultParameterSetName = 'FullName', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Export-PSFConfig')]
Param (
[Parameter(ParameterSetName = "FullName", Position = 0, Mandatory = $true)]
[string]
$FullName,
[Parameter(ParameterSetName = "... |
combined_dataset/train/non-malicious/sample_6_11.ps1 | sample_6_11.ps1 | #pragma namespace("\\\\.\\Root\\CIMV2")
#pragma deleteinstance
("__Namespace.Name='dcim'", FAIL)
#pragma include("DCIM_iSMService.mof")
/* SIG # Begin signature block */
/* MIItDQYJKoZIhvcNAQcCoIIs/jCCLPoCAQExDzANBglghkgBZQMEAgEFADB5Bgor */
/* BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JN... |
combined_dataset/train/non-malicious/sample_33_87.ps1 | sample_33_87.ps1 | #
# Module manifest for module 'OCI.PSModules.Vnmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vnmonitoring.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_32_13.ps1 | sample_32_13.ps1 | #
# Module manifest for module 'OCI.PSModules.Stackmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Stackmonitoring.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_44_46.ps1 | sample_44_46.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 = '81.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_56_69.ps1 | sample_56_69.ps1 | #
# Module manifest for module 'OCI.PSModules.Jmsjavadownloads'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported... |
combined_dataset/train/non-malicious/Add-ExcelAddins.ps1 | Add-ExcelAddins.ps1 | ###########################################################################"
#
# NAME: Add-ExcelAddins.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jan.egil.ring@powershell.no
#
# COMMENT: This script will check if the specified Microsoft Office Excel Addins are loaded, and if not load them.
# Tested with Po... |
combined_dataset/train/non-malicious/sample_2_99.ps1 | sample_2_99.ps1 | ConvertFrom-StringData @'
id_ctsnlb=Network Load Balancing (NLB)
id_ctsnlbdescription=Collects information about Network Load Balancing (NLB).
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
#... |
combined_dataset/train/non-malicious/sample_39_59.ps1 | sample_39_59.ps1 | # This is a sample script to get complete user's cred roam data (both locally and from AD)
# The script must be executed in the context of the target user on the affected machine and the user must have local admin rights to get all the data
# Replace Win2019DC2.contoso2016.com with the fqdn of the DC
# Output files ... |
combined_dataset/train/non-malicious/sample_14_33.ps1 | sample_14_33.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'https://aka... |
combined_dataset/train/non-malicious/Get-DesktopResolution.ps.ps1 | Get-DesktopResolution.ps.ps1 | <#
.SYNOPSIS
Displays Desktop Size
.DESCRIPTION
This script is a re-write of an MSDN sample. It uses
the Win32_Desktop Monitor WMI class to obtain the
screen dimensions.
.NOTES
File Name : Get-DesktopResolution.ps1
Author : Thomas Lee - tfl@psp.co.uk
Requires : PowerShell V2 CTP3... |
combined_dataset/train/non-malicious/sample_49_98.ps1 | sample_49_98.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 = '73.1.0'
# Sup... |
combined_dataset/train/non-malicious/520.ps1 | 520.ps1 |
function Import-SPList{
param(
[Parameter(Mandatory=$true)]
[String]
$WebUrl,
[Parameter(Mandatory=$true)]
[String]
$Path,
[Switch]
$NoFileCompression
)
if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Mic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.