full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_17_51.ps1 | sample_17_51.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 = '75.1.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_55_98.ps1 | sample_55_98.ps1 | #
# Module manifest for module 'OCI.PSModules.Filestorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Filestorage.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/vmrc remote connector.ps1 | vmrc remote connector.ps1 | #region Global var
$script:viserver = "esx.local"
$script:vmrc = "C:\\Program Files\\VMwareVMRC\\vmware-vmrc.exe"
$script:vm = ""
$script:vmt = ""
$script:vmcon = ""
$script:selectvm = ""
$script:multiple = $FALSE #Set to TRUE for multiple VMRC Instances
#endregion
$vmcon = Connect-VIServer -Server $script:v... |
combined_dataset/train/non-malicious/sample_57_39.ps1 | sample_57_39.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 = '85.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/4a37ac19-31f0-4d25-80a3-98a05980e63e.ps1 | 4a37ac19-31f0-4d25-80a3-98a05980e63e.ps1 | #requires -version 2.0\nAdd-Type @"\npublic class Shift {\n public static int Right(int x, int count) { return x >> count; }\n public static uint Right(uint x, int count) { return x >> count; }\n public static long Right(long x, int count) { return x >> count; }\n public static ulong Right(ulong x, int ... |
combined_dataset/train/non-malicious/3409.ps1 | 3409.ps1 |
$rgname = "webappsslbindingrb"
$appname = "webappsslbindingtest"
$slot = "testslot"
$prodHostname = "www.webappsslbindingtests.com"
$slotHostname = "testslot.webappsslbindingtests.com"
$thumbprint = "40D6600B0B8740C41BA4B3D13B967DDEF6ED1918"
function Test-CreateNewWebAppSSLBinding
{
try
{
$cre... |
combined_dataset/train/non-malicious/1158.ps1 | 1158.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldResolveBuiltinIdentity
{
$identity = Resolve-IdentityName -Name 'Administrators'
Assert-Equal 'BUILTIN\Administrators' $identity
}
function Test-ShouldResolve... |
combined_dataset/train/non-malicious/Get-FileEncoding_6.ps1 | Get-FileEncoding_6.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/sample_41_85.ps1 | sample_41_85.ps1 | ###########################################################
# #
# Copyright (C) Microsoft. All rights reserved. #
# #
###########################################################
Write-Host "T... |
combined_dataset/train/non-malicious/2267.ps1 | 2267.ps1 |
function Load-Form {
$Form.Controls.Add($TabControl)
$TabControl.Controls.AddRange(@(
$TabPageGeneral,
$TabPageCAS,
$TabPagePrimary,
$TabPageSecondary,
$TabPageSiteRoles,
$TabPageOther
))
$TabPageGeneral.Controls.AddRange(@(
$OutputB... |
combined_dataset/train/non-malicious/Add Voice to Powershell_1.ps1 | Add Voice to Powershell_1.ps1 | ###
# Description: Add Voice to Powershell
# Version: 1.1 (11 Nov 2008)
# Mike Hays / www.mike-hays.net / blog.mike-hays.net
# Virtualization, Powershell, and more...
###
# This is the actual speaking part. I cheat by adding spaces
# (This makes the word sound right).
$spokenText = "Super ca li fragilistic e... |
combined_dataset/train/non-malicious/sample_17_61.ps1 | sample_17_61.ps1 | #************************************************
# DC_RDSRDWeb.ps1
# Version 1.0.1
# Date: 21-01-2012
# Author: Daniel Grund - dgrund@microsoft.com
# Description:
# This script gets the IIS config
# 1.0.0 Beta release
# 1.0.1 Release
# TODO get windows\web\rdweb dir
#****************************************... |
combined_dataset/train/non-malicious/854.ps1 | 854.ps1 |
$resourceGroup = "bloblisttestrg"
$storageAccountName = "contosobloblisttest"
$containerName = "listtestblobs"
$storageAccount = Get-AzStorageAccount `
-ResourceGroupName $resourceGroup `
-Name $storageAccountName
$ctx = $storageAccount.Context
$listOfBLobs = Get-AzStorageBlob -Container $ContainerNam... |
combined_dataset/train/non-malicious/492.ps1 | 492.ps1 |
function Set-EnvironmentVariableValue{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[String]
$Name,
[Parameter(Mandatory=$true)]
[String]
$Value,
[Parameter(Mandatory=$true)]
[String]
$Target,
[Switch]
$Add
)
[Environment]::... |
combined_dataset/train/non-malicious/3053.ps1 | 3053.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Should -FileContentMatch" {
Context "when testing file contents" {
Setup -File "test.txt" "this is line 1$([System.Environment]::NewLine)rush is awesome$([System.Environment]::NewLine)And this is Unicode: ☺"
It "return... |
combined_dataset/train/non-malicious/Test-Port_7.ps1 | Test-Port_7.ps1 | Param([string]$srv,$port=135,$timeout=3000,[switch]$verbose)
# Test-Port.ps1
# Does a TCP connection on specified port (135 by default)
$ErrorActionPreference = "SilentlyContinue"
# Create TCP Client
$tcpclient = new-Object system.Net.Sockets.TcpClient
# Tell TCP Client to connect to machine on Port
... |
combined_dataset/train/non-malicious/sample_36_76.ps1 | sample_36_76.ps1 | #
# Module manifest for module 'OCI.PSModules.Networkfirewall'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Networkfirewall.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported P... |
combined_dataset/train/non-malicious/LetterDiamondOneliner v2.ps1 | LetterDiamondOneliner v2.ps1 | &{param([char]$c)[int]$s=65;$p=$c-$s;$r=,(' '*$p+[char]$s);$r+=@(do{"{0,$p} {1}{0}"-f([char]++$s),(' '*$f++)}until(!--$p));$r;$r[-2..-99]}Z
|
combined_dataset/train/non-malicious/sample_55_43.ps1 | sample_55_43.ps1 | #
# Module manifest for module 'OCI.PSModules.Datasafe'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datasafe.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/1024.ps1 | 1024.ps1 |
$endpoint = 'mysftestcluster.southcentralus.cloudapp.azure.com:19000'
$thumbprint = '2779F0BB9A969FB88E04915FFE7955D0389DA7AF'
$packagepath="C:\Users\sfuser\Documents\Visual Studio 2017\Projects\MyApplication\MyApplication\pkg\Release"
Connect-ServiceFabricCluster -ConnectionEndpoint $endpoint `
-KeepAlive... |
combined_dataset/train/non-malicious/sample_65_33.ps1 | sample_65_33.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/898.ps1 | 898.ps1 |
$Random=(New-Guid).ToString().Substring(0,8)
$ResourceGroupName="myResourceGroup$Random"
$App1Name="AppServiceTM1$Random"
$App2Name="AppServiceTM2$Random"
$Location1="WestUS"
$Location2="EastUS"
New-AzResourceGroup -Name $ResourceGroupName -Location $Location1
New-AzTrafficManagerProfile -Name "$ResourceGroupNa... |
combined_dataset/train/non-malicious/FindNewVirtualMachines.ps1 | FindNewVirtualMachines.ps1 | #requires -pssnapin VMware.Vimautomation.Core
Param(
[int]
$LastDays
)
Process
{
$EventFilterSpecByTime = New-Object VMware.Vim.EventFilterSpecByTime
If ($LastDays)
{
$EventFilterSpecByTime.BeginTime = (get-date).AddDays(-$($LastDays))
}
$EventFilterSpec = New-Object VMwa... |
combined_dataset/train/non-malicious/sample_5_66.ps1 | sample_5_66.ps1 | ConvertFrom-StringData @'
id_dcpromologs=DCPromo
id_dcpromologsobtaining=Obtaining DCPromo log files
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlA... |
combined_dataset/train/non-malicious/New-TiedVariable.ps1 | New-TiedVariable.ps1 | function New-TiedVariable {
#.Synopsis
# Creates a ReadOnly variable that recalculates it's value each time it's read
#.Description
# Create a variable tied to a scriptblock by using a breakpoint ;-)
#.Notes
# New-TiedVariable uses breakpoints to trigger the automatic recalculation of the variables, so the ... |
combined_dataset/train/non-malicious/sample_63_37.ps1 | sample_63_37.ps1 | #
# Module manifest for module 'OCI.PSModules.Clusterplacementgroups'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Clusterplacementgroups.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
... |
combined_dataset/train/non-malicious/1432.ps1 | 1432.ps1 |
function Set-CIisWebsiteID
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$SiteName,
[Parameter(Mandatory=$true)]
[int]
$ID
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference ... |
combined_dataset/train/non-malicious/1818.ps1 | 1818.ps1 |
Describe "Split-Path" -Tags "CI" {
It "Should return a string object when invoked" {
$result = Split-Path .
$result | Should -BeOfType String
$result = Split-Path . -Leaf
$result | Should -BeOfType String
$result = Split-Path . -Resolve
$result | Should -BeOfType... |
combined_dataset/train/non-malicious/sample_38_57.ps1 | sample_38_57.ps1 | #
# Module manifest for module 'OCI.PSModules.Onesubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported P... |
combined_dataset/train/non-malicious/Unlock & Password Reset_1.ps1 | Unlock & Password Reset_1.ps1 | <#
Author: Matt Schmitt
Date: 12/4/12
Version: 2.0
From: USA
Email: ithink2020@gmail.com
Website: http://about.me/schmittmatt
Twitter: @MatthewASchmitt
Description
A script checking for Locked Account, checking where a user is locked out, unlocking the user's account a... |
combined_dataset/train/non-malicious/2748.ps1 | 2748.ps1 |
if (Get-Command Get-NetNeighbor -ErrorAction SilentlyContinue) {
Get-NetNeighbor
} else {
$IpPattern = "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"
foreach ($line in (& $env:windir\system32\arp.exe -a)) {
$line = $line.Trim()
if ($line.Length -gt 0) {
if ($line -match 'Interface:\s(?<I... |
combined_dataset/train/non-malicious/sample_51_14.ps1 | sample_51_14.ps1 | ###########################################################
#
# 'GCArcService' module
#
###########################################################
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
Import-Module "$PSScriptRoot\ServiceHelper.psm1"
$script:GCInstallPath = "$PSScriptRoot\..\..\... |
combined_dataset/train/non-malicious/sample_34_3.ps1 | sample_34_3.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Clear-AMT3PDS {
<#
.Synopsis
Deletes data from the Intel Active Management Technology Third Party Data Storage
.Description
This CmdLet deletes data from the Intel Active Management Technology (AMT) Third Party Data Storag... |
combined_dataset/train/non-malicious/3177.ps1 | 3177.ps1 | Function Get-GPPFile
{
[cmdletbinding(DefaultParameterSetName='Name')]
param(
[Parameter( Position=0,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
ParameterSetName='Name'
)]
[string[]]$Name = $null,
... |
combined_dataset/train/non-malicious/hex2dec_4.ps1 | hex2dec_4.ps1 | @echo off
::interactive mode
if "%1" equ "" (
if not defined run goto:interactive
goto:error
)
::null results
for %%i in ("0" "x0" "0x0") do if "%1" equ "%%~i" goto:null
::parsing argument(s)
setlocal enabledelayedexpansion
::checking number of arguments
set "arg=0"
for %%i... |
combined_dataset/train/non-malicious/sample_48_69.ps1 | sample_48_69.ps1 | # <copyright>
# INTEL CONFIDENTIAL
#
# Copyright 2024 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/TabExpansion_11.ps1 | TabExpansion_11.ps1 | ## Tab-Completion
#################
## For V2CTP3.
## This won't work on V1 and V2CTP and V2CTP2.
## Please dot souce this script file.
## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list.
##
## What this can do is:
##
## [datetime]::n<tab>
## [datetime]::now.d... |
combined_dataset/train/non-malicious/4047.ps1 | 4047.ps1 |
param([string]$outputDir = $(throw "You must specify the output path to emit the generated file"),
[string]$localizedHelpPath = $(throw "You must specify the path to the localized help dir"),
[string]$configuration = $(throw "You must specify the build configuration"))
$ScriptDir = Split-Pa... |
combined_dataset/train/non-malicious/sample_52_13.ps1 | sample_52_13.ps1 | # Localized 05/07/2022 03:58 AM (GMT) 303:7.0.30723 RunAsHelper.strings.psd1
# Localized resources for RunAsHelper
ConvertFrom-StringData @'
###PSLOC
ErrorInvalidUserName=UserName {0} is not valid.
UserCouldNotBeLoggedError=The user could not be logged on. Ensure that the user has an existing profile on the mac... |
combined_dataset/train/non-malicious/sample_52_81.ps1 | sample_52_81.ps1 |
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
Register-ArgumentCompleter -Native -CommandName 'fd' -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
$commandElements = $commandAst.CommandElements
$command = @(
'fd'
for... |
combined_dataset/train/non-malicious/sample_22_66.ps1 | sample_22_66.ps1 | # Localized ArchiveResources.psd1
ConvertFrom-StringData @'
###PSLOC
PathNotFoundError=The path '{0}' either does not exist or is not a valid file system path.
ExpandArchiveInValidDestinationPath=The path '{0}' is not a valid file system directory path.
InvalidZipFileExtensionError={0} is not a supported archive... |
combined_dataset/train/non-malicious/sample_5_21.ps1 | sample_5_21.ps1 | ConvertFrom-StringData @'
id_ctsnps=Network Policy Server (NPS)
id_ctsnpsdescription=Collects information about Network Policy Server (NPS) [RADIUS/IAS].
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlL... |
combined_dataset/train/non-malicious/New-ODataServiceProxy_1.ps1 | New-ODataServiceProxy_1.ps1 | function New-ODataServiceProxy {
#.Synopsis
# Creates a proxy class for an odata web service
# YOU NEED TO BE VERY CAREFUL NOT TO OUTPUT THE PROXY OBJECT TO THE POWERSHELL HOST!
#.Description
# Uses the data service client utility (DataSvcUtil.exe) to generate a proxy class (and types for all objects) for an O... |
combined_dataset/train/non-malicious/sample_52_91.ps1 | sample_52_91.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/53.ps1 | 53.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/1093.ps1 | 1093.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldEscapeADSpecialCharacters
{
$specialCharacters = "*()\`0/"
$escapedCharacters = Format-ADSearchFilterValue -String $specialCharacters
Assert-Equal '\2a\28\... |
combined_dataset/train/non-malicious/sample_22_77.ps1 | sample_22_77.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydomains'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydomains.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_24_25.ps1 | sample_24_25.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/sample_20_18.ps1 | sample_20_18.ps1 | #
# Module manifest for module 'ThreadJob'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = '.\Microsoft.PowerShell.ThreadJob.dll'
# Version number of this module.
ModuleVersion = '2.0.3'
# ID used to uniquely identify this module
GUID = '0e7b895d-2fec-43f7-8cae-11... |
combined_dataset/train/non-malicious/sample_44_21.ps1 | sample_44_21.ps1 | ###########################################################
#
# 'GCArcService' module
#
###########################################################
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
Import-Module "$PSScriptRoot\ServiceHelper.psm1"
$script:GCInstallPath = "$PSScriptRoot\..\..\... |
combined_dataset/train/non-malicious/sample_51_32.ps1 | sample_51_32.ps1 | #
# Module manifest for module 'OCI.PSModules.Aidocument'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aidocument.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/Get Twitter RSS Feed_6.ps1 | Get Twitter RSS Feed_6.ps1 | param ([String] $ScreenName)
$client = New-Object System.Net.WebClient
$idUrl = "https://api.twitter.com/1/users/show.json?screen_name=$ScreenName"
$data = $client.DownloadString($idUrl)
$start = 0
$findStr = '"id":'
do {
$start = $data.IndexOf($findStr, $start + 1)
if ($start -gt 0) {
$s... |
combined_dataset/train/non-malicious/sample_65_66.ps1 | sample_65_66.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 = '86.2.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/h20 -Hashtables 2 object_3.ps1 | h20 -Hashtables 2 object_3.ps1 | #hashtable to object function.
#used to be able to make custom objects with math inside the pipeline
#examples
# 1..10 | h20 { @{karl = $_;dude = $_+1} }
#modify the incoming data with an expression
# gps | h20 { @{name = $_.processname; mem = $_.workingset / 1MB} }
#easily flatten data with subexpressions... |
combined_dataset/train/non-malicious/3211.ps1 | 3211.ps1 | using namespace System.Management.Automation
using namespace System.Management.Automation.Language
Import-Module PSReadLine
Set-PSReadLineOption -EditMode Emacs
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandle... |
combined_dataset/train/non-malicious/sample_30_67.ps1 | sample_30_67.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/Get-ADMapObject.ps1 | Get-ADMapObject.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
function Write-Help... |
combined_dataset/train/non-malicious/3823.ps1 | 3823.ps1 |
function Test-VirtualMachineProfile
{
Get-AzVmss -ResourceGroupName "fakeresource" -VMScaleSetName "fakevmss" -ErrorAction SilentlyContinue
$vmsize = 'Standard_A2';
$vmname = 'pstestvm' + ((Get-Random) % 10000);
$vmssID = "/subscriptions/00000000-0000-0000-0000-000000000000/resourc... |
combined_dataset/train/non-malicious/1646.ps1 | 1646.ps1 |
function Release-Ref ($ref) {
([System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$ref) -gt 0)
[System.GC]::Collect()
[System.GC]::WaitForPendingFinalizers()
}
function Remove-InvalidFileNameChars ([String]$Name, [switch]$IncludeSpace) {
if ($IncludeSpace) {
[... |
combined_dataset/train/non-malicious/sample_59_48.ps1 | sample_59_48.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
#
# ModifyProxySettings.ps1 - To be used by the installer - Mo... |
combined_dataset/train/non-malicious/sample_23_16.ps1 | sample_23_16.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/1452.ps1 | 1452.ps1 |
function Set-CIisWindowsAuthentication
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$SiteName,
[Alias('Path')]
[string]
$VirtualPath = '',
[Switch]
$D... |
combined_dataset/train/non-malicious/sample_14_0.ps1 | sample_14_0.ps1 | #
# Module manifest for module 'Microsoft.Online.SharePoint.PowerShell'
#
# Generated by: Microsoft Corportation
#
# Generated on: 8/29/2011
#
@{
# Script module or binary module file associated with this manifest
ModuleToProcess = 'Microsoft.Online.SharePoint.PowerShell.dll'
# Version number of this modu... |
combined_dataset/train/non-malicious/sample_26_3.ps1 | sample_26_3.ps1 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
@{
RootModule = './Microsoft.PowerShell.PSResourceGet.dll'
NestedModules = @('./Microsoft.PowerShell.PSResourceGet.psm1')
ModuleVersion = '1.0.5'
CompatiblePSEditions = @... |
combined_dataset/train/non-malicious/Get-ImageMetaData.ps1 | Get-ImageMetaData.ps1 | ## Get-ImageMetaData -- pull EXIF, XMP, and other data from images using the BitmapMetaData
## Usage: ls *.jpg | Get-ImageMetaData | ft Length, LastWriteTime, Name, "36867"
## Note that '36867' is the decimal value of (0x9003) the EXIF tag for DateTimeOriginal
## For more information see: http://owl.phy.queen... |
combined_dataset/train/non-malicious/Object ProxyAddress Scan.ps1 | Object ProxyAddress Scan.ps1 | Param (
[Parameter(Mandatory=$true,
Position=0,
ValueFromPipeline=$true,
HelpMessage="Enter SMTP address to search for in Active-Directory."
)]
[string]$objSMTP
)
Function Get-ProxyAddresses ([string]$Address){
$objAD = $null
$objAD = Get-QADObject -LdapFilter "(proxyAddre... |
combined_dataset/train/non-malicious/sample_65_2.ps1 | sample_65_2.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
# RemoveMDS.ps1
# Kill all Monitoring processes and clean up tra... |
combined_dataset/train/non-malicious/561.ps1 | 561.ps1 |
function Connect-SPO
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$siteURL,
[Parameter(Mandatory=$false, Position=2)]
[bool]$online,
[Parameter(Mandatory=$false, Position=3)]
[string]$username,
[Parameter(Mandatory=$false, Position=4)]
[string]... |
combined_dataset/train/non-malicious/517.ps1 | 517.ps1 |
function Get-SPList{
param(
[Parameter(Mandatory=$true)]
[String[]]$Url
)
if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Microsoft.SharePoint.PowerShell"}
$Url | %{
Get-SPUrl $_ | %{
... |
combined_dataset/train/non-malicious/sample_45_25.ps1 | sample_45_25.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_68.ps1 | sample_8_68.ps1 | #************************************************
# DC_Certificates-Component.ps1
# Version 1.1: Added the -silent switch. 11/2012
# Version 1.2: Added table of contents to output
# Version 1.3.08.22.14: The overview heading was missing from output file _Certificates-userstore.TXT. Corrected by moving $OutputFile d... |
combined_dataset/train/non-malicious/sample_58_75.ps1 | sample_58_75.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 = '87.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_60_27.ps1 | sample_60_27.ps1 | #
# Module manifest for module 'GCArcService'
#
# Generated by: Microsoft
#
# Generated on: 08/09/2020
#
@{
# Script module or binary module file associated with this manifest.
ModuleToProcess = 'GCArcService.psm1'
# Version number of this module.
ModuleVersion = '1.0'
# ID used to uniquely identify... |
combined_dataset/train/non-malicious/sample_58_86.ps1 | sample_58_86.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/RDC RemoteApp PassMan.ps1 | RDC RemoteApp PassMan.ps1 | ##################################################
# ENV Setup
##################################################
#-------------------------------------------------
# Initialize-ENV
#-------------------------------------------------
# Usage: Used to build the execution ENV.
# **Function is not for interactive ex... |
combined_dataset/train/non-malicious/set-localpwd_1.ps1 | set-localpwd_1.ps1 | # Sets local account passwords on one or more computers
# usage [computerName1,computerName2,... | ] ./set-localpwd.ps1 [-user] <userName> [-password] <password> [[-computers] computerName1,computerName2,...]
param(
[string] $User
, [string] $Password
, [string[]] $ComputerNames = @()
)
$ComputerNames ... |
combined_dataset/train/non-malicious/12.ps1 | 12.ps1 |
$poshGitModule = Get-Module posh-git -ListAvailable | Sort-Object Version -Descending | Select-Object -First 1
if ($poshGitModule) {
$poshGitModule | Import-Module
}
elseif (Test-Path -LiteralPath ($modulePath = Join-Path (Split-Path $MyInvocation.MyCommand.Path -Parent) (Join-Path src 'posh-git.psd1'))) {
Im... |
combined_dataset/train/non-malicious/Test-WebDAV_1.ps1 | Test-WebDAV_1.ps1 | function Test-WebDav ()
{
param ( $Url = "$( throw 'URL parameter is required.')" )
$xhttp = New-Object -ComObject msxml2.xmlhttp
$xhttp.open("OPTIONS", $url, $false)
$xhttp.send()
if ( $xhttp.getResponseHeader("DAV") ) { $true }
else { $false }
}
|
combined_dataset/train/non-malicious/sample_23_49.ps1 | sample_23_49.ps1 | #
# Module manifest for module 'OCI.PSModules.Usageapi'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Usageapi.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_47_33.ps1 | sample_47_33.ps1 | @{
GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Get-Acl", "Set-Acl", "Get-PfxCertific... |
combined_dataset/train/non-malicious/sample_10_42.ps1 | sample_10_42.ps1 | #************************************************
# TS_WMIHandleLeakKB2639077.ps1
# Version 1.0.1
# Date: 7/19/2013
# Author: v-kaw
# Description: [KSE Rule] [ Windows V3] Handle leak in Svchost.exe when a WMI query is triggered by using the Win32_PowerSettingCapabilities
# Rule number: 5c139a00-370c-4d1c-a929-... |
combined_dataset/train/non-malicious/Find Local Group Members_3.ps1 | Find Local Group Members_3.ps1 | # Author: Hal Rottenberg
# Purpose: Find matching members in a local group
# Used tip from RichS here: http://powershellcommunity.org/Forums/tabid/54/view/topic/postid/1528/Default.aspx
# Change these two to suit your needs
$ChildGroups = "Domain Admins", "group two"
$LocalGroup = "Administrators"
$error.clear(... |
combined_dataset/train/non-malicious/2482.ps1 | 2482.ps1 |
[CmdletBinding()]
[OutputType()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$Class,
[Parameter()]
[ValidateNotNullOrEmpty()]
[string[]]$ComputerName = $env:COMPUTERNAME,
[Parameter()]
[ValidateNotNullOrEmpty()]
[pscredential]$Credential,
[Parameter()]
[ValidateNotNullOrEmpty()... |
combined_dataset/train/non-malicious/Get-WebVideoFile.ps1 | Get-WebVideoFile.ps1 | <#
.SYNOPSIS
Download video-files from the specified RSS-feed URL, based on HTML scraping and a regular expression.
.DESCRIPTION
Download video-files from the specified RSS-feed URL, based on HTML scraping and a regular expression for finding the download URL.
Joel Bennett`s Get-WebFile function from poshcode.or... |
combined_dataset/train/non-malicious/278.ps1 | 278.ps1 | function Get-NetworkLevelAuthentication
{
[CmdletBinding()]
PARAM (
[Parameter(ValueFromPipeline)]
[String[]]$ComputerName = $env:ComputerName,
[Alias("RunAs")]
[System.Management.Automation.Credential()]
$Credential = [System.Management.Automation.PSCredential]::Empty
)
BEGIN
{
TRY
{
IF (-not... |
combined_dataset/train/non-malicious/sample_33_91.ps1 | sample_33_91.ps1 | function PSConsoleHostReadLine
{
[System.Diagnostics.DebuggerHidden()]
param()
## Get the execution status of the last accepted user input.
## This needs to be done as the first thing because any script run will flush $?.
$lastRunStatus = $?
Microsoft.PowerShell.Core\Set-StrictMode -Off... |
combined_dataset/train/non-malicious/1622.ps1 | 1622.ps1 |
function Out-Menu {
param (
[Parameter(
Mandatory=$true,
ValueFromPipeline=$True,
ValueFromPipelinebyPropertyName=$True)]
[object[]]$Object,
[string]$Header,
[string]$Footer,
[switch]$AllowCancel,
[switch]$AllowMulti... |
combined_dataset/train/non-malicious/1451.ps1 | 1451.ps1 |
function Test-CIdentity
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[Switch]
$PassThru
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionSt... |
combined_dataset/train/non-malicious/455.ps1 | 455.ps1 | Register-PSFConfigValidation -Name "double" -ScriptBlock {
Param (
$Value
)
$Result = New-Object PSOBject -Property @{
Success = $True
Value = $null
Message = ""
}
try { [double]$number = $Value }
catch
{
$Result.Message = "Not a double: $Value"
$Result.Success = $False
return $Result
}
$... |
combined_dataset/train/non-malicious/sample_19_50.ps1 | sample_19_50.ps1 | #
# Module manifest for module 'OCI.PSModules.Filestorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Filestorage.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/SetDefaultPrinter_2.ps1 | SetDefaultPrinter_2.ps1 | <#
.SYNOPSIS
Sets the Default Printer for any user on any machine in active directory.
.DESCRIPTION
Search AD for Computername; Select User Account and Printer and make that printer the default
printer for that user on that computer.
.PARAMETER Hostnme
This parameter is required and should reflect the ... |
combined_dataset/train/non-malicious/sample_47_75.ps1 | sample_47_75.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Stop-AMTUserConsent {
<#
.Synopsis
Stops the Intel Active Management Technology user consent process
.Description
This CmdLet stops the user consent process on clients that have Intel Active Management Technology (AMT) fir... |
combined_dataset/train/non-malicious/2378.ps1 | 2378.ps1 |
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline,
ValueFromPipelineByPropertyName)]
[string]$Computername = 'localhost'
)
begin {
Set-StrictMode -Version Latest
}
process {
try {
$WmiResult = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $ComputerName
$LastBoot = $WmiResult.ConvertToDateTi... |
combined_dataset/train/non-malicious/3445.ps1 | 3445.ps1 | [CmdletBinding()]
Param
(
[Parameter()]
[string]$FilesChanged
)
$PathsToCheck = @("src")
$PathStringsToIgnore = @(
"Test",
".sln",
"Nuget.config",
".psd1",
"Netcore",
"Stack"
)
Write-Host "Files changed: $FilesChanged"
$FilesChangedList = @()
while ($true)
{
$Idx = $FilesChanged.In... |
combined_dataset/train/non-malicious/sample_16_66.ps1 | sample_16_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Accessgovernancecp'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Accessgovernancecp.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Suppo... |
combined_dataset/train/non-malicious/3411.ps1 | 3411.ps1 |
function Get-RandomLetters
{
return -join ((97..122) | Get-Random -Count 5 | % {[char]$_})
}
function Get-WebsiteName
{
return "someuniqueWebsite$(Get-RandomLetters)"
}
function Get-TrafficManagerProfileName
{
return "someuniqueTrafficManager"
}
function Get-WebHostPlanName
{
return "ho... |
combined_dataset/train/non-malicious/sample_11_99.ps1 | sample_11_99.ps1 | #
# Module manifest for module 'OCI.PSModules.Oce'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Oce.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/get-windowsproductkey.ps1 | get-windowsproductkey.ps1 | function get-windowsproductkey([string]$computer)
{
$Reg = [WMIClass] ("\\\\" + $computer + "\\root\\default:StdRegProv")
$values = [byte[]]($reg.getbinaryvalue(2147483650,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion","DigitalProductId").uvalue)
$lookup = [char[]]("B","C","D","F","G","H","J","K","M","P","Q","R"... |
combined_dataset/train/non-malicious/sample_32_1.ps1 | sample_32_1.ps1 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# IMPORTANT: Do not invoke this file directly. Please instead run eng/common/TestResources/New-TestResources.ps1 from the repository root.
param (
[hashtable] $AdditionalParameters = @{},
[hashtable] $DeploymentOutputs
)... |
combined_dataset/train/non-malicious/4191.ps1 | 4191.ps1 |
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][string]$ReportFile = 'Applications.csv',
[ValidateNotNullOrEmpty()][string]$ReportFileLocation = 'c:\windows\waller'
)
function Get-AddRemovePrograms {
[CmdletBinding()][OutputType([string])]
param ()
$Architecture = Get-Architecture
if ($Architecture... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.