full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/514.ps1 | 514.ps1 |
function Set-SPADGroupPermission{
param(
[Parameter(Mandatory=$true)]
$Identity,
[Parameter(Mandatory=$true)]
[string]$ADGroup,
[Parameter(Mandatory=$true)]
[string]$Role,
[Parameter(Mandatory=$false)]
[string[]]$Exclude,
[switch]$Recursive,
[sw... |
combined_dataset/train/non-malicious/sample_3_39.ps1 | sample_3_39.ps1 | if($Debug)
{
if($global:OffCommRun -eq $true) {return}
}
$global:OffCommRun = $true
Import-LocalizedData -BindingVariable LocalsOfficeCommon -UICulture en-us -FileName OfficeCommon -ErrorAction SilentlyContinue
Function Add-AsArray{
param($parentArrayObj, $valueToAdd)
if($parentArrayObj -is [array])
{
... |
combined_dataset/train/non-malicious/1679.ps1 | 1679.ps1 |
if (gcm Set-Clipboard -ea 0) {
return
}
function Set-Clipboard {
[cmdletbinding()]
param (
[parameter(Position=0,Mandatory=$true,ValueFromPipeline=$true)]$InputObject,
[switch] $File
)
... |
combined_dataset/train/non-malicious/829.ps1 | 829.ps1 |
$mySubscriptionId = (Get-AzSubscription)[0].Id
$myResourceGroup = "myResourceGroup"
$myScaleSet = "myScaleSet"
$myLocation = "East US"
$cred = Get-Credential
New-AzVmss `
-ResourceGroupName $myResourceGroup `
-VMScaleSetName $myScaleSet `
-Location $myLocation `
-VirtualNetworkName "myVnet" `
-SubnetNa... |
combined_dataset/train/non-malicious/3122.ps1 | 3122.ps1 |
function Test-IsFileBinary
{
[CmdletBinding()]
[OutputType('System.Boolean')]
Param(
[Parameter(
Position=0,
Mandatory=$true,
HelpMessage="Path to file which should be checked")]
[ValidateScript({
if(Test-Path -Path $_ -PathType Leaf)
{
return $true
}
else
{
throw "Ente... |
combined_dataset/train/non-malicious/sample_45_45.ps1 | sample_45_45.ps1 | #
# Module manifest for module 'OCI.PSModules.Redis'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Redis.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_33_14.ps1 | sample_33_14.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 = '83.1.0'
#... |
combined_dataset/train/non-malicious/Get-ADGroupModifications.ps1 | Get-ADGroupModifications.ps1 | ###########################################################################"
#
# NAME: Get-ADGroupModificationsReport.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jan.egil.ring@powershell.no
#
# COMMENT: Generates a HTML-report of Active Directory group membership modifications (addings and deletions).
# Sp... |
combined_dataset/train/non-malicious/sample_35_47.ps1 | sample_35_47.ps1 | // <auto-generated />
namespace IronJS.Tests.UnitTests.IE9.chapter15._15_2._15_2_3
{
using System;
using NUnit.Framework;
[TestFixture]
public class _15_2_3_5_Tests : IE9TestFixture
{
public _15_2_3_5_Tests() : base(@"chapter15\15.2\15.2.3\15.2.3.5") { }
[Test(Descriptio... |
combined_dataset/train/non-malicious/sample_9_71.ps1 | sample_9_71.ps1 | # 2023-02-24 WalterE mod Trap #we#
$startTime_AutoAdd = Get-Date
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_"
}
Write-Host -Background... |
combined_dataset/train/non-malicious/sample_44_86.ps1 | sample_44_86.ps1 | #
# Module manifest for module 'OCI.PSModules.Waa'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waa.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/Find-Command.ps1 | Find-Command.ps1 | function Find-Command{
param([Parameter($Mandatory=$true)]$question)
Get-Command -Verb ($question.Split() | Where {Get-Verb $_ }) -Noun $question.Split()
}
|
combined_dataset/train/non-malicious/sample_58_79.ps1 | sample_58_79.ps1 | #
# Module manifest for module 'OCI.PSModules.Loadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loadbalancer.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/2806.ps1 | 2806.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
UserAcct,
UserPath,
Subkey,
KeyLastWriteTime,
Value,
Count,
PSComputerName
FROM
*LogUserAssist.tsv
ORDER BY
KeyLastWriteTime DESC
"@
& logparser -stats:off -i:csv -dtline... |
combined_dataset/train/non-malicious/sample_1_82.ps1 | sample_1_82.ps1 | #************************************************
# DC_RDSSession.ps1
# Version 1.0.1
# Date: 29-01-2012
# Author: Daniel Grund - dgrund@microsoft.com
# Description:
# This script gets the RDP Session Broker info
# and checks vital signs to inform user.
# 1.0.0 Beta release
#********************************... |
combined_dataset/train/non-malicious/Import-Delimited 2.3.ps1 | Import-Delimited 2.3.ps1 | ################################################################################
## Convert-Delimiter - A function to convert between different delimiters.
## E.g.: commas to tabs, tabs to spaces, spaces to commas, etc.
################################################################################
## Written pri... |
combined_dataset/train/non-malicious/Delete-LocalAccount.ps1 | Delete-LocalAccount.ps1 | <#
.SYNOPSIS
A script that removes a local user account
.DESCRIPTION
This script searches ActiveDirectory for computer accounts, for each
computer account it removes the specified user account.
.PARAMETER ADSPath
The ActiveDirectory namespace to search for computers
... |
combined_dataset/train/non-malicious/sample_57_54.ps1 | sample_57_54.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_31_6.ps1 | sample_31_6.ps1 | #
# Module manifest for module 'OCI.PSModules.Databasetools'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Databasetools.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_11_78.ps1 | sample_11_78.ps1 | ConvertFrom-StringData @'
id_sandev=Computer Storage Information
id_sanstorageinfooutput=SAN utility output
id_sanstorageinfooutputdesc=Storage Information
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7Y... |
combined_dataset/train/non-malicious/4352.ps1 | 4352.ps1 | function Copy-Module
{
[CmdletBinding(PositionalBinding=$false)]
Param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$SourcePath,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$DestinationPath,
... |
combined_dataset/train/non-malicious/sample_53_39.ps1 | sample_53_39.ps1 | #
# Module manifest for module 'OCI.PSModules.Loadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loadbalancer.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/3085.ps1 | 3085.ps1 | Given "step_001" {
}
When "step_002" {
}
Then "step_003" {
}
Given "step_101" {
}
Given "and_101" {
}
When "step_102" {
}
When "and_102" {
}
Then "step_103" {
throw "An example error in the then clause"
}
Then "and_103" {
}
Given "step_201" {
}
Given "and_201" {
}
When "step_202" {
}
When "and_202" {
}
... |
combined_dataset/train/non-malicious/Import-NmapXML_1.ps1 | Import-NmapXML_1.ps1 | #Requires -Version 2.0
function Import-NmapXML
{
####################################################################################
#.Synopsis
# Parse XML output files of the nmap port scanner (www.nmap.org).
#
#.Description
# Parse XML output files of the nmap port scanner (www.nmap.org) and ... |
combined_dataset/train/non-malicious/sample_28_29.ps1 | sample_28_29.ps1 |
function New-AzDataProtectionRestoreConfigurationClientObject{
[OutputType('PSObject')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates new restore configuration object')]
param(
[Parameter(Mandatory, HelpMessage='Datasource... |
combined_dataset/train/non-malicious/3368.ps1 | 3368.ps1 |
param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[System.String]$RPName,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[System.String]$Location,
[ValidateNotNullOrEmpty()]
[System.String]$PSSwaggerLocation = $null,
[switch]$Admin,
[switch]... |
combined_dataset/train/non-malicious/Get-UcsServerVlan_1.ps1 | Get-UcsServerVlan_1.ps1 | function Get-UcsServerVlan {
Get-UcsServiceProfile | Foreach-Object {
$sp = $_
$sp | Get-UcsVnic | Foreach-Object {
$vn = $_
$vn | Get-UcsVnicInterface | Foreach-Object {
$output = New-Object psobject –property @{
Server = $sp.Name
... |
combined_dataset/train/non-malicious/sample_17_87.ps1 | sample_17_87.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_26_44.ps1 | sample_26_44.ps1 | # region Generated
# ----------------------------------------------------------------------------------
# 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 obt... |
combined_dataset/train/non-malicious/IsoDates.psm1.ps1 | IsoDates.psm1.ps1 | #requires -version 1.0
# or version 2.0, obviously
## ISO 8601 Dates
########################################################################
## Copyright (c) Joel Bennett, 2009
## Free for use under GPL, MS-RL, MS-PL, or BSD license. Your choice.
function Get-ISODate {
#.Synopsis
# Get the components of an IS... |
combined_dataset/train/non-malicious/Set-LocalPassword_1.ps1 | Set-LocalPassword_1.ps1 | param(
[switch]$Help
, [string] $User
, [string] $Password
, [string[]] $ComputerNames = @()
)
$usage = @'
Get-OUComputerNames
usage : [computerName1,computerName2,... | ] ./Set-LocalPassword.ps1 [-user] <userName> [-password] <password> [[-computers] computerName1,computerName2,...]
returns : Sets lo... |
combined_dataset/train/non-malicious/sample_22_9.ps1 | sample_22_9.ps1 | image: mcr.microsoft.com/dotnet/sdk:6.0
pipelines:
branches:
master:
- step:
name: Build
runs-on:
- 'self.hosted'
- 'windows'
artifacts:
- src/function-app/publish.zip
script:
- cd ./src/function-app
... |
combined_dataset/train/non-malicious/sample_6_26.ps1 | sample_6_26.ps1 | import{m as a}from"./diff-view-Svm69wu4.js";import"./index-D0FXXVpG.js";import"./onboarding-workspace-model-v8QT9oED.js";import"./index-CT5gJz09.js";import"./ChatSuggestionItem-C9ss3EjM.js";import"./observe-theme-SXiRRH3N.js";var s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,d=O... |
combined_dataset/train/non-malicious/EnvStacks Module 1.0.ps1 | EnvStacks Module 1.0.ps1 | ## EnvStacks.psm1 module
## NOTE: If you "download" this, make sure it's a psm1 extension before you Add-Module
## NOTE: this will work as a regular v1.0 script if you dot-source it, but it *will* pollute your variable space a bit
## you'll need to comment out the Export-ModuleMember line at the bottom ...
##... |
combined_dataset/train/non-malicious/Set-Computername_6.ps1 | Set-Computername_6.ps1 | function Set-ComputerName {
param( [switch]$help,
[string]$originalPCName=$(read-host "Please specify the current name of the computer"),
[string]$computerName=$(read-host "Please specify the new name of the computer"))
$usage = "set-ComputerName -originalPCname CurrentName -computername AnewName"
if (... |
combined_dataset/train/non-malicious/Get-FileEncoding.ps1 | Get-FileEncoding.ps1 | <#
.SYNOPSIS
Gets file encoding.
.DESCRIPTION
The Get-FileEncoding function determines encoding by looking at Byte Order Mark (BOM).
Based on port of C# code from http://www.west-wind.com/Weblog/posts/197245.aspx
.EXAMPLE
Get-ChildItem *.ps1 | select FullName, @{n='Encoding';e={Get-FileEncoding $_.FullName}} | ... |
combined_dataset/train/non-malicious/SharePoint build script_2.ps1 | SharePoint build script_2.ps1 | @@#BASEPATH variable should be explicitly set in every
@@#build script. It represents the "root"
@@#of the project folder, underneath which all tools, source, config settings,
@@#and deployment folder lie.
@@$global:basepath = (resolve-path ..).path
@@function Set-BasePath([string]$path)
@@{
@@ $global:basepath... |
combined_dataset/train/non-malicious/sample_18_69.ps1 | sample_18_69.ps1 | @{
RootModule = 'PSReadLine.psm1'
NestedModules = @("Microsoft.PowerShell.PSReadLine2.dll")
ModuleVersion = '2.4.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/sample_54_89.ps1 | sample_54_89.ps1 | #
# Module manifest for module 'OCI.PSModules.Datacatalog'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datacatalog.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_24_65.ps1 | sample_24_65.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Get-AMTSystemDefense {
<#
.Synopsis
Returns status of Intel Active Management Technology System Defense policies
.Description
This CmdLet returns status of Intel Active Management Technology (AMT) System Defense network ac... |
combined_dataset/train/non-malicious/Get-ExpiredCert.ps1 | Get-ExpiredCert.ps1 | Function Get-ExpiredCert {
<#
.SYNOPSIS
Reports the number of expired certificates published to a user account
in Active Directory.
.DESCRIPTION
This will give you a total count of expired certs for each user account.
.PARAMETER InputObject
Specifies the user object. This would be one or more Di... |
combined_dataset/train/non-malicious/sample_60_3.ps1 | sample_60_3.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_8_61.ps1 | sample_8_61.ps1 | ConvertFrom-StringData @'
id_ctsdnsclient=DNS Client
id_ctsdnsclientdescription=Collects information about DNS Client.
id_ctstcpip=TCPIP
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7z... |
combined_dataset/train/non-malicious/sample_48_4.ps1 | sample_48_4.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
# RemoveMDS.ps1
# Kill all Monitoring processes and clean up tra... |
combined_dataset/train/non-malicious/3387.ps1 | 3387.ps1 |
function Assert-Throws
{
param([ScriptBlock] $script, [string] $message)
try
{
&$script
}
catch
{
if ($message -ne "")
{
$actualMessage = $_.Exception.Message
Write-Output ("Caught exception: '$actualMessage'")
if ($actualMessage -eq $message)
{
... |
combined_dataset/train/non-malicious/3987.ps1 | 3987.ps1 |
function ServiceBusPaginationTests {
$location = Get-Location
$resourceGroupName = getAssetName "RGName-"
$namespaceName = getAssetName "Namespace1-"
$nameQueue = getAssetName "Queue-"
$nameTopic = getAssetName "Topic-"
$subName = getAssetName "Subscription-"
$ruleName = ... |
combined_dataset/train/non-malicious/Show-ADGroupMembership.ps1 | Show-ADGroupMembership.ps1 | # Author: Steven Murawski http://www.mindofroot.com
# This script requires the Show-NetMap script from Doug Finke and the NetMap files
# These can be found at http://dougfinke.com/blog/?p=465
#
# Also required are the Quest AD Cmdlets.
#requires -pssnapin Quest.ActiveRoles.ADManagement
param([string]$Search... |
combined_dataset/train/non-malicious/Server Inventory.ps1 | Server Inventory.ps1 | #This script requires:
#Windows Powershell 1.0 = http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx
#PowerGui = http://www.powergui.org/downloads.jspa
#Quest ActiveRoles Management Shell for Active Directory = http://www.quest.com/powershell/activeroles-server.aspx
#VMware I... |
combined_dataset/train/non-malicious/sample_50_37.ps1 | sample_50_37.ps1 | # Localized 04/14/2024 08:54 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Sí
PromptNoString=&No
BundleFound=Agrupación encontrada: {0}
PackageFound=Paquete encontrado: {0}
EncryptedBundleFound=Se ha encontrado un conjunto cifrado: {0}
En... |
combined_dataset/train/non-malicious/sample_22_88.ps1 | sample_22_88.ps1 | $global:VerbosePreference = 'Continue'
Function Write-Custom-Output
{
Param([string]$message)
$date = Get-Date
$newMessage = '[{0}] {1}' -f $date, $message
Write-Output $newMessage
}
trap [Exception]
{
Write-Custom-Output "WARN: Terminating error encountered on line $($_.Invoc... |
combined_dataset/train/non-malicious/Logger.psm1 0.6.ps1 | Logger.psm1 0.6.ps1 | <#
Name : Universal NLog Logging Module (NLog.psm1)
Version : 0.6 2010-05-17
Author : Joel Bennett (MVP)
Site : http://www.HuddledMasses.org/
Version History:
0.6 - Removed a few references to Log4Net that had been left behind (oops).
0.5 - Port to NLog from Log4Net ( http:... |
combined_dataset/train/non-malicious/Invoke-SqlCmd2.ps1 | Invoke-SqlCmd2.ps1 | function Invoke-Sqlcmd2
{
param(
[string]$ServerInstance,
[string]$Database,
[string]$Query,
[Int32]$QueryTimeout=30
)
$conn=new-object System.Data.SqlClient.SQLConnection
$conn.ConnectionString="Server={0};Database={1};Integrated Security=True" -f $ServerInstance,$Database
... |
combined_dataset/train/non-malicious/sample_42_78.ps1 | sample_42_78.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Microsoft.PowerShell.Utility\Import-LocalizedData -BindingVariable Strings -FileName Strings -ErrorAction Ignore
Microsoft.PowerShell.Management\Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 | ForEach-Object {
. $PSItem.FullName
}
... |
combined_dataset/train/non-malicious/Findup_27.ps1 | Findup_27.ps1 | using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.IO;
using System.Text.RegularExpressions;
namespace Findup
{
public class FileLengthComparer : I... |
combined_dataset/train/non-malicious/sample_32_68.ps1 | sample_32_68.ps1 | #
# Module manifest for module 'OCI.PSModules.Queue'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Queue.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_21_56.ps1 | sample_21_56.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 = '80.0.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/replace-regexgroup.ps1 | replace-regexgroup.ps1 | #region @3
## Function to do a regex replace of all matches with an expression per match that has local variables
##created automatically for the named groups so that you can use those varibles in your expression
function replace-regexgroup ([regex]$regex, [string]$text ,[scriptblock] $replaceexpression)
{
$regex.... |
combined_dataset/train/non-malicious/sample_66_60.ps1 | sample_66_60.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 at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
combined_dataset/train/non-malicious/8014f3e2-68e3-4145-bd77-badc10360e30.ps1 | 8014f3e2-68e3-4145-bd77-badc10360e30.ps1 | param([Parameter(Mandatory=$true)][string]$Path,[Parameter(Mandatory=$true)][string]$Destination)
Get-ChildItem -Path $Path | Where-Object { !$_.PSIsContainer } | foreach {
$Target = Join-Path -Path $Destination -ChildPath (Split-Path -Leaf $_)
if ( Test-Path -Path $Target -PathType Leaf ) {
Rename-Item -Path... |
combined_dataset/train/non-malicious/Create SP2010 Farm V03.ps1 | Create SP2010 Farm V03.ps1 | ############################################################################
## Create-SPFarm
## V 0.3
## Jos.Verlinde
############################################################################
Param ( [String] $Farm = "SP2010",
[String] $SQLServer = $env:COMPUTERNAME,
[String] $Passphrase = "pass@word1"... |
combined_dataset/train/non-malicious/sample_9_29.ps1 | sample_9_29.ps1 | #************************************************
# TS_SymantecIPSCheck.ps1
# Version 1.0.0
# Date: 10-17-2012
# Author: Brian Prince - brianpr@microsoft.com
# Description: This script checks if Symantec Intrusion Prevention System (IPS) is installed.
# IPS is not recommended on high traffic (300+ Mbps of net... |
combined_dataset/train/non-malicious/1604.ps1 | 1604.ps1 |
function Get-Shortcut {
param (
[parameter(mandatory=$true)]
[string]$Path
)
begin {
$WshShell = New-Object -ComObject WScript.Shell
}
process {
if (!$Path) {Throw 'No Source'}
$Shortcut = $WshShell.CreateShortcut($Path)
$Shortcut | sele... |
combined_dataset/train/non-malicious/sample_32_98.ps1 | sample_32_98.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Переменная среды с этим именем и типом уже существует.
EnvironmentErrorDoesNotExists=Переменной среды с этим именем и типом не существует.
'@
# SIG # Begin signature block
# MIInwgYJKoZIhvcNAQcCoIInszCCJ68CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGs... |
combined_dataset/train/non-malicious/2440.ps1 | 2440.ps1 | $hyperVHost = 'HYPERVSRV'
$vmUptimes = Get-VM -ComputerName $hyperVHost | select name, uptime, @{ n = 'Type'; e= { 'VM' } }
$wmiParams = @{
'ComputerName' = $hyperVHost
'Class' = 'Win32_OperatingSystem'
}
$hostUptime = Get-WmiObject @wmiParams | select @{ n = 'Uptime'; e = { (Get-Date) - ($_.ConvertToDateTime($_.Las... |
combined_dataset/train/non-malicious/sample_3_18.ps1 | sample_3_18.ps1 | If ($OSVersion.Major -ge 6)
{
Import-LocalizedData -BindingVariable SLMGRStrings
Write-DiagProgress -Activity $SLMGRStrings.ID_KMSActivation -Status $SLMGRStrings.ID_KMSActivationObtaining
Function Runslmgr ([string]$ScriptOption="")
{
$CommandToExecuteLenght = $ScriptOption.Length + 10
"-" * ($Com... |
combined_dataset/train/non-malicious/3506.ps1 | 3506.ps1 |
function Test-GetApplicationInsightsPricingPlan
{
$rgname = Get-ApplicationInsightsTestResourceName;
try
{
$appName = "app" + $rgname;
$loc = Get-ProviderLocation ResourceManagement;
$kind = "web";
New-AzResourceGroup -Name $rgname -Location $loc;
Ne... |
combined_dataset/train/non-malicious/sample_61_41.ps1 | sample_61_41.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'https://aka... |
combined_dataset/train/non-malicious/sample_40_17.ps1 | sample_40_17.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Eine Umgebungsvariable mit diesem Namen und Typ ist bereits vorhanden.
EnvironmentErrorDoesNotExists=Eine Umgebungsvariable mit diesem Namen und Typ ist nicht vorhanden.
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQME... |
combined_dataset/train/non-malicious/CertMgmt pack.ps1 | CertMgmt pack.ps1 | #####################################################################
# CertMgmtPack.ps1
# Version 0.51
#
# Digital certificate management pack
#
# Vadims Podans (c) 2009
# http://www.sysadmins.lv/
#####################################################################
#requires -Version 2.0
function Import-C... |
combined_dataset/train/non-malicious/4400.ps1 | 4400.ps1 | function Install-PackageUtility
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$FastPackageReference,
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]
$Location,
[Parameter(Mandatory=$tru... |
combined_dataset/train/non-malicious/sample_1_16.ps1 | sample_1_16.ps1 | Get-ChildItem -Path $PSScriptRoot\*.ps1 | Foreach-Object{ . $_.FullName }
# SIG # Begin signature block
# MIItDQYJKoZIhvcNAQcCoIIs/jCCLPoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDfA60pZ8m/WODa
# 6KPKEwub... |
combined_dataset/train/non-malicious/egg_timer_2.ps1 | egg_timer_2.ps1 | function GenerateForm {
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
$form_main = New-Object System.Windows.Forms.Form
$reset_button = New-Object System.Windows.Forms.Button
$label1 = New-Object Sys... |
combined_dataset/train/non-malicious/sample_33_16.ps1 | sample_33_16.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\esbuild@0.19.12\node_modules\esbuild\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\esbuild... |
combined_dataset/train/non-malicious/4196.ps1 | 4196.ps1 |
param
(
[string]$ApplicationName = 'quicktime',
[string]$WindowTitle = 'Uninstall Apple Quicktime',
[string]$MSI_Switches = '/qb- /norestart'
)
function Set-ConsoleTitle {
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true)][String]$Title
)
$host.ui.RawUI.WindowTitle = $Title
}
Function Initi... |
combined_dataset/train/non-malicious/3057.ps1 | 3057.ps1 | function Should-BeLike($ActualValue, $ExpectedValue, [switch] $Negate, [String] $Because) {
[bool] $succeeded = $ActualValue -like $ExpectedValue
if ($Negate) {
$succeeded = -not $succeeded
}
if (-not $succeeded) {
if ($Negate) {
return New-Object psobject -Property @{
... |
combined_dataset/train/non-malicious/h20 -Hashtables 2 object_2.ps1 | h20 -Hashtables 2 object_2.ps1 | #hashtable to object function.
#used to be able to make custom objects with math inside the pipeline
#e.g. 1..10 | h20 { @{karl = $_;dude = $_+1} }
#gps | h20 { @{name = $_.processname; mem = $_.workingset / 1MB} }
function h20([scriptblock]$sb )
{
begin {}
process{ if ($sb -ne $null)
{
... |
combined_dataset/train/non-malicious/sample_41_57.ps1 | sample_41_57.ps1 | @{
RootModule = 'PSReadLine.psm1'
NestedModules = @("Microsoft.PowerShell.PSReadLine2.dll")
ModuleVersion = '2.3.5'
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/3395.ps1 | 3395.ps1 |
function Test-SetChefExtensionBasic
{
$rgname = Get-ComputeTestResourceName
$loc = Get-ComputeVMLocation
$TestOutputRoot = [System.AppDomain]::CurrentDomain.BaseDirectory;
try
{
New-AzureRmResourceGroup -Name $rgname -Location $loc -Force;
$vmsize = 'S... |
combined_dataset/train/non-malicious/sample_62_47.ps1 | sample_62_47.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 = '87.0.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_58_74.ps1 | sample_58_74.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmsynthetics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmsynthetics.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/Get-NaVolumeLatency.ps1 | Get-NaVolumeLatency.ps1 | <#
.SYNOPSIS
Get the different protocol latencies for a specified volume.
.DESCRIPTION
Get the different protocol latencies for a specified volume.
.PARAMETER Volume
Volume to retrieve the latency.
.PARAMETER Protocol
Protocol to collect latency for valid values are 'all','nfs','cifs','san','fcp... |
combined_dataset/train/non-malicious/sample_28_52.ps1 | sample_28_52.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\which@2.0.2\node_modules\which\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\which@2.0.2\n... |
combined_dataset/train/non-malicious/sample_44_0.ps1 | sample_44_0.ps1 | #
# Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker'
#
# Generated by: Microsoft Corporation
#
# Generated on: 19/01/2022
#
@{
# Script module or binary module file associated with this manifest.
RootModule = ''
# Version number of this module.
ModuleVersion = '1.2100.25... |
combined_dataset/train/non-malicious/610.ps1 | 610.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://www.winpcap.org/install/bin/WinPcap_4_1_3.exe"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ForEach-Object{
try{
$_.Result = $null
... |
combined_dataset/train/non-malicious/2682.ps1 | 2682.ps1 |
Param(
[string]$Environment
)
begin
{
Clear-Host
$path = Split-Path -parent $MyInvocation.MyCommand.Definition
if ($env:PSModulePath -notlike "*$path\Modules\TriadModules\Modules*")
{
"Adding ;$path\Modules\TriadModules\Modules to PSModulePath" | Write-Debug
$env:PSModulePath += ";$path\Modules\TriadModu... |
combined_dataset/train/non-malicious/sample_14_42.ps1 | sample_14_42.ps1 | ConvertFrom-StringData @'
id_virtualization=Virtualization Information
id_virtualizationobtaining=Obtaining Information about Virtualization Environment
id_virtualizationoutput=Virtualization Information Output
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
... |
combined_dataset/train/non-malicious/sample_40_66.ps1 | sample_40_66.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 = '75.1.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_34_1.ps1 | sample_34_1.ps1 | <#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
function Stop-Process2 {
[CmdletBinding(SupportsShouldProcess = $true)]
[Alias()]
[OutputType([int])]
param(
# Param1 help description
... |
combined_dataset/train/non-malicious/4438.ps1 | 4438.ps1 | function Uninstall-Module
{
[CmdletBinding(DefaultParameterSetName='NameParameterSet',
SupportsShouldProcess=$true,
HelpUri='https://go.microsoft.com/fwlink/?LinkId=526864')]
Param
(
[Parameter(ValueFromPipelineByPropertyName=$true,
Manda... |
combined_dataset/train/non-malicious/1417.ps1 | 1417.ps1 |
function Get-CIisHttpHeader
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$SiteName,
[Alias('Path')]
[string]
$VirtualPath = '',
[string]
$Name = '*'
)
Set-StrictMode -V... |
combined_dataset/train/non-malicious/Manage ASP_4.NET Providers.ps1 | Manage ASP_4.NET Providers.ps1 | # Manage_ASP_NET_Providers.ps1
# by Chistian Glessner
# http://iLoveSharePoint.com
# have to be initialized. If you want to change the app config you have to restart PowerShell
param($appConfigPath=$null)
# App config path have to be set before loading System.Web.dll
[System.AppDomain]::CurrentDomain.SetData(... |
combined_dataset/train/non-malicious/3789.ps1 | 3789.ps1 | Param(
[Parameter(Mandatory = $false,
HelpMessage="Identifier of the Azure subscription to be used. Default subscription will be used if not specified.")]
[ValidateNotNullOrEmpty()]
[string]$subscriptionId,
[Parameter(Mandatory = $true,
HelpMessage="Name of the resource group to whic... |
combined_dataset/train/non-malicious/sample_63_92.ps1 | sample_63_92.ps1 | #
# Module manifest for module 'Az.RedisCache'
#
# Generated by: Microsoft Corporation
#
# Generated on: 7/31/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.RedisCache.psm1'
# Version number of this module.
ModuleVersion = '1.10.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_2_26.ps1 | sample_2_26.ps1 | #This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER #EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABI... |
combined_dataset/train/non-malicious/Invoke-ExecuteTSQL _1.ps1 | Invoke-ExecuteTSQL _1.ps1 | #######################
<#
.SYNOPSIS
Execute T-SQL Statments and return messages from SQL Server (print).
.DESCRIPTION
Execute T-SQL Statments and return messages from SQL Server (print).
.INPUTS
None
You cannot pipe objects to Invoke-ExecuteTSQL
.OUTPUTS
PSObject :
Boolean Exitcode = $True or $False in... |
combined_dataset/train/non-malicious/sample_66_91.ps1 | sample_66_91.ps1 | #
# Module manifest for module 'OCI.PSModules.Vault'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vault.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_60_22.ps1 | sample_60_22.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... |
combined_dataset/train/non-malicious/sample_56_94.ps1 | sample_56_94.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
function Publish-UpgradedServ... |
combined_dataset/train/non-malicious/1490.ps1 | 1490.ps1 |
function Assert-FileExists
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[string]
$Path,
[Parameter(Position=1)]
[string]
$Message
)
Set-StrictMode -Version 'Latest'
Write-Debug -Message "Testing if file '$P... |
combined_dataset/train/non-malicious/Get-SiSReport.ps1 | Get-SiSReport.ps1 | Function New-LocalUser
{
<#
.SYNOPSIS
Create a new user account on the local computer.
.DESCRIPTION
This function will create a user account on the local computer.
.PARAMETER Computer
The NetBIOS name of the computer that you will create the account on.
.PARAMETER User
The user ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.