full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/1812.ps1 | 1812.ps1 |
Describe "Remove-Item" -Tags "CI" {
$testpath = $TestDrive
$testfile = "testfile.txt"
$testfilepath = Join-Path -Path $testpath -ChildPath $testfile
Context "File removal Tests" {
BeforeEach {
New-Item -Name $testfile -Path $testpath -ItemType "file" -Value "lorem ipsum" -Force
Test-Path $... |
combined_dataset/train/non-malicious/sample_19_93.ps1 | sample_19_93.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/3614.ps1 | 3614.ps1 |
function Test-GetAzureRmLogProfile
{
try
{
$actual = Get-AzLogProfile -Name default
Assert-AreEqual /subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/providers/microsoft.insights/logprofiles/default $actual.Id "Resource Ids not equal"
Assert-AreEqual default ... |
combined_dataset/train/non-malicious/sample_20_41.ps1 | sample_20_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Datalabelingservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datalabelingservice.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Sup... |
combined_dataset/train/non-malicious/WindowsInstallPoint.ps1 | WindowsInstallPoint.ps1 | function Initialize-WindowsInstallPoint {
<#
.SYNOPSIS
Initializes a drive to become a Windows OS install point.
.DESCRIPTION
The Initialize-WindowsInstallPoint function uses the "diskpart" utility to wipe, partition, and format a local or removable drive.
The "bootsect" tool processes the bootmgr all... |
combined_dataset/train/non-malicious/1845.ps1 | 1845.ps1 |
return
$cmdletName = "Export-Counter"
. "$PSScriptRoot/CounterTestHelperFunctions.ps1"
$rootFilename = "exportedCounters"
$filePath = $null
$counterNames = @(
(TranslateCounterPath "\Memory\Available Bytes")
(TranslateCounterPath "\Processor(*)\% Processor Time")
(TranslateCounterPath "\Proces... |
combined_dataset/train/non-malicious/2971.ps1 | 2971.ps1 |
. "$PSScriptRoot/tools.ps1"
$dotnetArguments = @{
Channel = 'Current'
Version = 'latest'
NoSudo = $false
}
Install-Dotnet @dotnetArguments
$Env:PATH += "$([IO.Path]::PathSeparator)$Env:HOME/.dotnet"
dotnet build -version -nologo |
combined_dataset/train/non-malicious/3070.ps1 | 3070.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
. "$here\Add-Numbers.ps1"
Describe -Tags "Example" "Add-Numbers" {
It "adds positive numbers" {
Add-Numbers 2 3 | Should -Be 5
}
It "adds negative numbers" {
Add-Numbers (-2) (-2) | Should -Be (-4)
}
It "adds one negative nu... |
combined_dataset/train/non-malicious/sample_1_23.ps1 | sample_1_23.ps1 | # TS_AnonymousAuthentication_Enabled.ps1
# Description: Determine whether anonymous authentication is enabled on the CRM web site.
# Created: 1/10/2012
# Author: Jonathan Randall
#*************************************************************************************************
# Date: 11-12-2012
# Description:... |
combined_dataset/train/non-malicious/sample_21_8.ps1 | sample_21_8.ps1 | #************************************************
# TS_2K3ProcessorAffinityMaskCheck.ps1
# Version 1.0.1
# Date: 5/16/2012
# Author: v-kaw
# Description: [Idea ID 2346] [Windows] high cpu only on one processor
# Rule number: 2346
# Rule URL: //sharepoint/sites/rules/Rule%20Submissions/Forms/DispForm.aspx?ID=2... |
combined_dataset/train/non-malicious/2759.ps1 | 2759.ps1 |
function GetBase64GzippedStream {
Param(
[Parameter(Mandatory=$True,Position=0)]
[System.IO.FileInfo]$File
)
$memFile = New-Object System.IO.MemoryStream (,[System.IO.File]::ReadAllBytes($File))
$memStrm = New-Object System.IO.MemoryStream
$gzStrm = New-Object System.... |
combined_dataset/train/non-malicious/364.ps1 | 364.ps1 | function Register-PSFTypeSerializationData
{
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFTypeSerializationData')]
Param (
[Parameter(ValueFromPipeline = $true, Mandatory = $true)]
[string[]]
$TypeData,
[string]
$Path = (Get-PSFConfigValue -FullName 'P... |
combined_dataset/train/non-malicious/sample_11_19.ps1 | sample_11_19.ps1 | ##------------------------------------------------------------------
## <copyright file="Invoke-ParsingEngine.ps1" company="Microsoft">
## Copyright (C) Microsoft. All rights reserved.
## </copyright>
##------------------------------------------------------------------
Param (
[Parameter(Mandatory=$fal... |
combined_dataset/train/non-malicious/276.ps1 | 276.ps1 | function Connect-ExchangeOnPremises
{
PARAM (
[Parameter(Mandatory,HelpMessage= 'http://<ServerFQDN>/powershell')]
[system.string]$ConnectionUri,
$Credential = [System.Management.Automation.PSCredential]::Empty
)
$Splatting = @{
ConnectionUri = $ConnectionUri
Config... |
combined_dataset/train/non-malicious/Compare Reg Keys.ps1 | Compare Reg Keys.ps1 | <#
.SYNOPSIS
Compares Registry Key Properties and subkeys across multiple computers
.DESCRIPTION
The function Get-AllRegKey will recurse down from a given key, returning an array having
the key's properties, subkeys, and their properties and subkeys.
Provide Get-AllRegKey a list of computernames, and it wil... |
combined_dataset/train/non-malicious/sample_32_27.ps1 | sample_32_27.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 = '77.0.0'
# S... |
combined_dataset/train/non-malicious/4015.ps1 | 4015.ps1 | workflow Use-WorkflowCheckpointSample
{
Write-Output "Before Checkpoint."
start-sleep -s 20
Checkpoint-Workflow
Write-Output "After Checkpoint."
} |
combined_dataset/train/non-malicious/sample_61_34.ps1 | sample_61_34.ps1 | #
# Script module for module 'Az.Compute' that is executed when 'Az.Compute' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 07/31/2024 06:54:55
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
... |
combined_dataset/train/non-malicious/2158.ps1 | 2158.ps1 |
function Write-LogEntry {
param(
[parameter(Mandatory=$true, HelpMessage="Value added to the RemovedApps.log file.")]
[ValidateNotNullOrEmpty()]
[string]$Value,
[parameter(Mandatory=$false, HelpMessage="Name of the log file that the entry will written to.")]
[ValidateNotNul... |
combined_dataset/train/non-malicious/3196.ps1 | 3196.ps1 | function Get-PropertyType {
param (
[Parameter( Mandatory=$true,
ValueFromPipeline=$true)]
[psobject]$InputObject,
[string[]]$property = $null
)
Begin {
Function Get-PropertyOrder {
[cmdletbinding()]
p... |
combined_dataset/train/non-malicious/1165.ps1 | 1165.ps1 |
$iniPath = $null
Describe 'Test-RemoveIniEntry' {
BeforeAll {
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
}
BeforeEach {
$iniPath = Join-Path ([IO.Path]::GetTempPath()) ([IO.Path]::GetRandomFileName())
$null = New-Item $iniPath ... |
combined_dataset/train/non-malicious/Remove-Games.ps1 | Remove-Games.ps1 | #/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\
#
# Script Name: Remove-Games.ps1
# Title: Remove Games
# Version: 1.0
# Author: John W. Cannon <johnwcannon at_gmail_dot_com>
# Date: September 20, 2011
#
# Description: This tool removes the built-in games... |
combined_dataset/train/non-malicious/sample_50_80.ps1 | sample_50_80.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Support.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.Support.Module]::Instance
# Export nothing to clear implicit exports
... |
combined_dataset/train/non-malicious/2663.ps1 | 2663.ps1 |
[CmdletBinding()]
Param (
)
[string]$appDeployToolkitExtName = 'PSAppDeployToolkitExt'
[string]$appDeployExtScriptFriendlyName = 'App Deploy Toolkit Extensions'
[version]$appDeployExtScriptVersion = [version]'3.8.0'
[string]$appDeployExtScriptDate = '23/09/2019'
[hashtable]$appDeployExtScriptParameters = $PSBoun... |
combined_dataset/train/non-malicious/sample_40_27.ps1 | sample_40_27.ps1 | #
# Module manifest for module 'OCI.PSModules.Integration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Integration.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/Download Free Reflector.ps1 | Download Free Reflector.ps1 | #Thanks http://27.am/posts/how-to-download-net-reflector-6-for-free
add-type @'
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Reflection;
namespace LookingGlass
{
젨젨public class RedGateDownloader
젨젨젨젨public static void Download()
젨젨젨젨{
젨젨젨젨젨젨QueryDownloadUrl("... |
combined_dataset/train/non-malicious/sample_54_99.ps1 | sample_54_99.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param (
[Parameter(Manda... |
combined_dataset/train/non-malicious/Dell Order Status.ps1 | Dell Order Status.ps1 | # Version: 0.1
# Author: Stefan Stranger
# Description: Retrieve Dell Order Status
# Start Page Order Status USA: https://support.dell.com/support/order/status.aspx?c=us&cs=19&l=en&s=dhs&~ck=pn
# Start Page Order Status EMEA(nl): http://support.euro.dell.com/support/index.aspx?c=nl&l=nl&s=gen&~ck=bt
# Example Dell... |
combined_dataset/train/non-malicious/2239.ps1 | 2239.ps1 |
Begin {
if ([int](Get-WmiObject -Class Win32_OperatingSystem).BuildNumber -lt 14393) {
Write-Warning -Message "Unsupported build of Windows 10 detected, exiting" ; exit 1
}
try {
$TSEnvironment = New-Object -ComObject Microsoft.SMS.TSEnvironment -ErrorAction Stop
}
catch ... |
combined_dataset/train/non-malicious/Deleted-ObjectsAD_1.ps1 | Deleted-ObjectsAD_1.ps1 | param(
$Domen,
$ObjectsDeleted
)
function Ping ($Name){
$ping = new-object System.Net.NetworkInformation.Ping
if ($ping.send($Name).Status -eq "Success") {$True}
else {$False}
trap {Write-Verbose "Error Ping"; $False; continue}
}
[string[]]$ObjectPath
[string[]]$Disks
[string[]]$Info
[st... |
combined_dataset/train/non-malicious/disabled AD accounts_1.ps1 | disabled AD accounts_1.ps1 | #Get Domain List
$objForest = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
$DomainList = @($objForest.Domains | Select-Object Name)
$Domains = $DomainList | foreach {$_.Name}
#get users list
$users = Get-Content U:\\EMCU15FI3_USER.txt
$total = $users.count
"SAMaccountname;DisplayName... |
combined_dataset/train/non-malicious/sample_28_72.ps1 | sample_28_72.ps1 | [CmdletBinding()]
param
(
[Parameter(ParameterSetName="BackInTime")]
[system.int32]$DaysSince = 1,
[Parameter(ParameterSetName="DateRange")]
[DateTime]$StartDate,
[Parameter(ParameterSetName="DateRange")]
[DateTime]$EndDate
)
$ARM_NS_API_Regex = "(?mi)(?<path>(?<apipath>(?<NS... |
combined_dataset/train/non-malicious/sample_6_35.ps1 | sample_6_35.ps1 | # Load Common Library
# Load Reporting Utilities
#_#$debug = $false
. ./utils_cts.ps1
. ./TS_RemoteSetup.ps1
# 2023-02-20 WalterE mod Trap #we#
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationIn... |
combined_dataset/train/non-malicious/New-Type.ps1 | New-Type.ps1 | ## New-Type (like Add-Type, but for PowerShell 1.0)
## Takes C# source code, and compiles it (in memory) for use in scripts ...
####################################################################################################
## USAGE EXAMPLE:
## New-Type @"
## using System;
## public struct User {
#... |
combined_dataset/train/non-malicious/2589.ps1 | 2589.ps1 |
param (
$Server
);
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null;
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMOExtended")| Out-Null;
function writeHtmlPage
{
param ($title, $heading, $body, $filePath);
$html = "<html>
... |
combined_dataset/train/non-malicious/sample_26_61.ps1 | sample_26_61.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 = '73.1.0'
#... |
combined_dataset/train/non-malicious/sample_45_17.ps1 | sample_45_17.ps1 | #
# Module manifest for module 'OCI.PSModules.Bds'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bds.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/Remove-Trash.ps1 | Remove-Trash.ps1 | #requires -version 2.0
add-type @"
using System;
using System.Runtime.InteropServices;
using Microsoft.Win32;
namespace recyclebin
{
public class Empty
{
[DllImport("shell32.dll")]
static extern int SHEmptyRecycleBin(IntPtr hWnd, string pszRootPath, uint dwFlags);
public... |
combined_dataset/train/non-malicious/WPF v3 DEMO.ps1 | WPF v3 DEMO.ps1 | # Plik: 4_Demo_v3_Reflection.ps1
#requires -version 3
$Akceleratory =
[PSObject].
Assembly.
GetType("System.Management.Automation.TypeAccelerators")
Add-Type -AssemblyName PresentationCore, PresentationFramework -PassThru |
Where-Object IsPublic |
ForEach-Object {
$Class = $_
... |
combined_dataset/train/non-malicious/Form manipulation.ps1 | Form manipulation.ps1 | $code = @'
using System;
using System.Runtime.InteropServices;
namespace LibWrap
{
public class Animator
{
[DllImport("user32.dll")]
public static extern bool AnimateWindow(IntPtr hWnd, uint dwTime, uint dwFlags);
}
}
'@
function BuildAssembly {
$cscp = New-Object Microsoft.CSharp.CShar... |
combined_dataset/train/non-malicious/sample_61_82.ps1 | sample_61_82.ps1 | <#
.SYNOPSIS
MSRD-Collect global functions
.DESCRIPTION
Module for the MSRD-Collect global functions
.NOTES
Author : Robert Klemencz
Requires : At least PowerShell 5.1 (This module is not for stand-alone use. It is used automatically from within the main MSRD-Collect.ps1 script)
Version... |
combined_dataset/train/non-malicious/sample_47_25.ps1 | sample_47_25.ps1 | ###############################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# MBAM Client Deployment
#
# Version: 2.5.1
#
# Purpose: Configure BitLocker drive encryption.
# Record recovery keys with MBAM Server.
#
# Usage: Invoke... |
combined_dataset/train/non-malicious/2629.ps1 | 2629.ps1 | function Copy-SQLAgentJob{
param([string]$Source
,[string[]]$Targets
,[string]$JobName)
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null
$smosource = New-Object Microsoft.SqlServer.Management.Smo.Server $Source
$JobScript = $smosource.JobServer.... |
combined_dataset/train/non-malicious/get-SQLInstanceInfo.ps1 | get-SQLInstanceInfo.ps1 | function get-SQLInstanceInfo
{
<#
.SYNOPSIS
get-SQLInstanceInfo
.DESCRIPTION
Retrieves the following information for each SQL Instance on the server or cluster node, and
returns as an array of PSCustomObjects
DisplayName
Name ... |
combined_dataset/train/non-malicious/sample_44_32.ps1 | sample_44_32.ps1 | # Copyright 2019 The Kubernetes Authors.
#
# 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 required by applicable law or agreed to ... |
combined_dataset/train/non-malicious/sample_65_76.ps1 | sample_65_76.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 = '85.2.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_4_75.ps1 | sample_4_75.ps1 | #************************************************
# DC_SystemCollect.ps1
# Version 1.1
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects additional System information and ETL Logs (tbd).
# Called from: TS_AutoAddCommands_Apps.ps1
#********************************************... |
combined_dataset/train/non-malicious/sample_61_84.ps1 | sample_61_84.ps1 | @{
GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Start-Transcript", "Stop-Transcript"
AliasesTo... |
combined_dataset/train/non-malicious/Replicate-ADDS.ps1 | Replicate-ADDS.ps1 | # Transcribe output to log
$null = Start-Transcript "$pwd\\$([System.IO.Path]::GetFileNameWithoutExtension($MyInvocation.MyCommand.Definition)).log"
# Check the QAD snapins are installed
if ( (Get-PSSnapin -Name Quest.ActiveRoles.ADManagement -ErrorAction silentlycontinue) -eq $null ) {
# The QAD snapin is not act... |
combined_dataset/train/non-malicious/sample_27_2.ps1 | sample_27_2.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
# Import Observability EventSource
$observabili... |
combined_dataset/train/non-malicious/sample_44_83.ps1 | sample_44_83.ps1 | #
# Module manifest for module 'OCI.PSModules.Announcementsservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Announcementsservice.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# S... |
combined_dataset/train/non-malicious/sample_25_25.ps1 | sample_25_25.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 = '82.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/Findup_28.ps1 | Findup_28.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/Convert-BounceToX_4.ps1 | Convert-BounceToX_4.ps1 | # $Id: Convert-BounceToX500.ps1 610 2010-11-16 00:39:19Z jon $
# $Revision: 610 $
#.Synopsis
# Convert Bounce to X500
#.Description
# Convert URL Encoded address in a Bounce message to an X500 address
# that can be added as an alias to the mail-enabled object
#.Parameter bounceAddress
# URL Encoded bounce... |
combined_dataset/train/non-malicious/428.ps1 | 428.ps1 | Register-PSFTeppScriptblock -Name 'PSFramework.Message.Module' -ScriptBlock {
Get-PSFMessage | Select-Object -ExpandProperty ModuleName | Select-Object -Unique
}
Register-PSFTeppScriptblock -Name 'PSFramework.Message.Function' -ScriptBlock {
Get-PSFMessage | Select-Object -ExpandProperty FunctionName | Select-Object... |
combined_dataset/train/non-malicious/ShowUI Clock 4.ps1 | ShowUI Clock 4.ps1 | New-UIWidget -AsJob -Content {
$shadow = DropShadowEffect -Color Black -Shadow 0 -Blur 8
Grid {
Ellipse -Fill Transparent -Stroke Black -StrokeThickness 4 -Width 300 -Height 300
Ellipse -Fill Transparent -Stroke Black -StrokeThickness 6 -Width 290 -Height 290 -StrokeDashArray 1,11.406
... |
combined_dataset/train/non-malicious/3926.ps1 | 3926.ps1 |
function Test-AzureIotDpsLinkedHubLifeCycle
{
$Location = Get-Location "Microsoft.Devices" "Device Provisioning Service"
$IotDpsName = getAssetName
$ResourceGroupName = getAssetName
$IotHubName = getAssetName
$hubKeyName = "ServiceKey"
$Sku = "S1"
$LinkedHubName = [string]::Format("{0}... |
combined_dataset/train/non-malicious/913.ps1 | 913.ps1 |
$sourceSubscriptionId='yourSourceSubscriptionId'
$sourceResourceGroupName='mySourceResourceGroupName'
$managedDiskName='myDiskName'
Select-AzSubscription -SubscriptionId $sourceSubscriptionId
$managedDisk= Get-AzDisk -ResourceGroupName $sourceResourceGroupName -DiskName $managedDiskName
$targetSubscriptionI... |
combined_dataset/train/non-malicious/sample_63_1.ps1 | sample_63_1.ps1 | #
# Module manifest for module 'Az.StorageMover'
#
# Generated by: Microsoft Corporation
#
# Generated on: 7/4/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.StorageMover.psm1'
# Version number of this module.
ModuleVersion = '1.4.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/871.ps1 | 871.ps1 | function Start-PigJob {
$ErrorActionPreference = "Stop"
$context = Get-AzContext
if ($context -eq $null)
{
Connect-AzAccount
}
$context
$clusterName = Read-Host -Prompt "Enter the HDInsight cluster name"
$creds=Get-Credential -Message "Enter the login for th... |
combined_dataset/train/non-malicious/sample_16_0.ps1 | sample_16_0.ps1 | ##----------------------------------------------------------------------------
## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved.
##----------------------------------------------------------------------------
# Import string constants
. ./StringConstants.ps1
Stop-Service -Name $ServiceConsta... |
combined_dataset/train/non-malicious/109.ps1 | 109.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/3024.ps1 | 3024.ps1 | Set-StrictMode -Version Latest
$functionName = '01c1a57716fe4005ac1a7bf216f38ad0'
if (Test-Path Function:\$functionName) {
Remove-Item Function:\$functionName -Force -ErrorAction Stop
}
function global:01c1a57716fe4005ac1a7bf216f38ad0 {
return 'Original Function'
}
function script:Testing {
return '... |
combined_dataset/train/non-malicious/126.ps1 | 126.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... |
combined_dataset/train/non-malicious/Get-StatType proxy.ps1 | Get-StatType proxy.ps1 | # get-mystattype.ps1 : Proxy cmdlet for the Get-StatType cmdlet.
# The scripts add the parameter -ShowInstances to the cmdlet
# Parameters:
# ShowInstances : switch to define if all the instances for each metric will be shown
# Author: LucD
# History:
# v1.0 27/08/09 first version
#
[CmdletBinding()]
param(
... |
combined_dataset/train/non-malicious/1144.ps1 | 1144.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldGetCallStores
{
foreach( $location in ([enum]::GetValues('Security.Cryptography.X509Certificates.StoreLocation')) )
{
foreach( $name in ([Enum]::GetValues('Securi... |
combined_dataset/train/non-malicious/Lot buttons at one time.ps1 | Lot buttons at one time.ps1 | $frmMain_Load= {
for ($i = 0; $i -lt 2; $i++) {
for ($j = 0; $j -lt 5; $j++) {
$num[$i, $j] = $i * 5 + $j + 1
$btn[$i, $j] = New-Object Windows.Forms.Button
#
#btnX
#
$btn[$i, $j].Font = New-Object Drawing.Font("Tahoma", 14, [Drawing.FontStyle]::Bold)
$btn[$i, $j... |
combined_dataset/train/non-malicious/Deploy VM with Static IP_1.ps1 | Deploy VM with Static IP_1.ps1 | # 1. Create a simple customizations spec:
$custSpec = New-OSCustomizationSpec -Type NonPersistent -OSType Windows `
-OrgName “My Organization” -FullName “MyVM” -Domain “MyDomain” `
–DomainAdminUsername “user” –DomainAdminPassword “password”
# 2. Modify the default network customization settings:
$custSpec ... |
combined_dataset/train/non-malicious/sample_23_69.ps1 | sample_23_69.ps1 | 袧邪褋褌褉邪懈胁邪械屑褘泄 懈 懈褋锌芯谢薪褟械屑褘泄 HTTP-蟹邪锌褉芯褋 泻 褋械褉胁械褉褍.
袩褉懈 褉邪斜芯褌械 褋 URL-邪写褉械褋芯屑 褋褍褖械褋褌胁褍褞褌 锌芯写写械褉卸懈胁邪械屑褘械 懈 蟹邪锌褉械褖械薪薪褘械 褋懈屑胁芯谢褘. 袙褋械 薪械锌芯写写械褉卸懈胁邪械屑褘械 褋懈屑胁芯谢褘 写芯谢卸薪褘 斜褘褌褜 锌褉芯褑械薪褌-泻芯写懈褉芯胁邪薪褘.
袩褉懈 褝褌芯屑, 锌芯写写械褉卸懈胁邪械屑褘械 褋懈屑胁芯谢褘 (蟹邪褉械蟹械褉胁懈褉芯胁邪薪薪褘械 褋懈屑胁芯谢褘, 褉邪蟹写械谢懈褌械谢懈 褋械谐屑械薪褌芯胁 邪写褉械褋邪, 褉邪蟹写械谢懈褌械谢懈 胁薪褍褌褉懈 褋械谐屑械薪褌芯胁 懈 褌.写.) 屑芯谐褍褌... |
combined_dataset/train/non-malicious/sample_42_81.ps1 | sample_42_81.ps1 | param (
[Parameter(Mandatory = $true)]
[string] $CertificateStoreLocation,
[Parameter(Mandatory = $true)]
[string] $CertificatePfxFullPath,
[Parameter(Mandatory = $true)]
[string] $CertificateExportPfxPassword
)
# Import Certificate
try
{
$CertificateExportPfxPasswordSecureStrin... |
combined_dataset/train/non-malicious/sample_7_79.ps1 | sample_7_79.ps1 | #************************************************
# TS_ClusterCAUWMINamespaceCheck.ps1
# Version 1.0.1
# Date: 1/16/2013
# Author: v-kaw
# Description: [Idea ID 6519] [Windows] Invalid Class error on 2012 Clusters (SDP)
# Rule number: 6519
# Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispF... |
combined_dataset/train/non-malicious/sample_43_35.ps1 | sample_43_35.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 = '81.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/203.ps1 | 203.ps1 |
[CmdletBinding()]
PARAM (
[Alias("ExpirationDays")]
[Int]$Days = '10',
[String]$SearchBase = "",
[string]$EmailFrom = "ScriptServer@Contoso.com",
[string]$EmailTo = "IT@Contoso.com",
[String]$EmailSMTPServer = "smtp.contoso.com"
)
BEGIN
{
[String]$EmailSubject = "PS Report-Ac... |
combined_dataset/train/non-malicious/4412.ps1 | 4412.ps1 |
Microsoft.PowerShell.Core\Set-StrictMode -Version Latest
$script:IsInbox = $PSHOME.EndsWith('\WindowsPowerShell\v1.0', [System.StringComparison]::OrdinalIgnoreCase)
$script:IsWindows = (-not (Get-Variable -Name IsWindows -ErrorAction Ignore)) -or $IsWindows
$script:IsLinux = (Get-Variable -Name IsLinux -Err... |
combined_dataset/train/non-malicious/3837.ps1 | 3837.ps1 |
function TopicTests {
$location = Get-LocationForEventGrid
$topicName = Get-TopicName
$topicName2 = Get-TopicName
$topicName3 = Get-TopicName
$topicName4 = Get-TopicName
$resourceGroupName = Get-ResourceGroupName
$secondResourceGroup = Get-ResourceGroupName
$subscript... |
combined_dataset/train/non-malicious/sample_46_33.ps1 | sample_46_33.ps1 | param(
[Parameter(Mandatory=$true)][int] $BuildId,
[Parameter(Mandatory=$true)][int] $PublishingInfraVersion,
[Parameter(Mandatory=$true)][string] $AzdoToken,
[Parameter(Mandatory=$true)][string] $MaestroToken,
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro.dot.net',
[Parameter... |
combined_dataset/train/non-malicious/sample_58_84.ps1 | sample_58_84.ps1 | #Requires -RunAsAdministrator
##------------------------------------------------------------------
## <copyright file="Uninstall-ObservabilityExtension.ps1" company="Microsoft">
## Copyright (C) Microsoft. All rights reserved.
## </copyright>
##---------------------------------------------------------------... |
combined_dataset/train/non-malicious/sample_11_77.ps1 | sample_11_77.ps1 | ConvertFrom-StringData @'
id_clusterdependencyreport=Cluster resource dependency report
id_clusterdependencyreportdesc1=Obtaining cluster resource dependency report
id_clusterdependencyreportdesc=Obtaining cluster resource dependency report from group %GroupName%
'@
# SIG # Begin signature block
# MIIoUgYJKoZIh... |
combined_dataset/train/non-malicious/210.ps1 | 210.ps1 | function Set-RemoteDesktop
{
[CmdletBinding()]
PARAM (
[String[]]$ComputerName = $env:COMPUTERNAME,
[Parameter(Mandatory = $true)]
[Boolean]$Enable
)
PROCESS
{
FOREACH ($Computer in $ComputerName)
{
TRY
{
IF (Test-Connection -ComputerName $Computer -Count 1 -Quiet)
{
$regKey = [Micro... |
combined_dataset/train/non-malicious/815.ps1 | 815.ps1 | . ./ReferenceFileE.ps1
. "$PSScriptRoot/ReferenceFileE.ps1"
. "${PSScriptRoot}/ReferenceFileE.ps1"
. './ReferenceFileE.ps1'
. "./ReferenceFileE.ps1"
. .\ReferenceFileE.ps1
. '.\ReferenceFileE.ps1'
. ".\ReferenceFileE.ps1"
. ReferenceFileE.ps1
. 'ReferenceFileE.ps1'
. "ReferenceFileE.ps1"
. ./dir/../ReferenceFileE.ps1
.... |
combined_dataset/train/non-malicious/2938.ps1 | 2938.ps1 | BuildSetup {
$script:sequence += "executing build setup;"
}
Task default -depends Test-Results
Task Test-Results -depends Compile, Test, Deploy {
[string]$expected = "executing build setup;Compiling;Testing;Deploying"
if ($script:sequence -ne $expected) {
throw "Expected sequence '$expected', but ... |
combined_dataset/train/non-malicious/sample_9_26.ps1 | sample_9_26.ps1 | ConvertFrom-StringData @'
id_etltraceenable=Enabling %Component% Event Trace Log
id_etltraceenabledesc=Enabling Event Trace Log for %Component%
id_etltracereprotitle=Please click 'Next' to start collecting data
id_etltracereprodescription=Please click 'Next' to start collecting information. You will be prompted to ... |
combined_dataset/train/non-malicious/sample_59_45.ps1 | sample_59_45.ps1 | #
# Module manifest for module 'OCI.PSModules.Certificates'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Certificates.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_43_44.ps1 | sample_43_44.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/2753.ps1 | 2753.ps1 |
[CmdletBinding()]
Param(
[Parameter(Mandatory=$False,Position=0)]
[Int]$ProcId=$pid
)
$datestr = (Get-Date -Format "yyyyMMddHHmmss")
$outfile = "${pwd}\" + ($env:COMPUTERNAME) + "_PId_" + ($pid) + "_${datestr}.dmp"
$obj = "" | Select-Object Path,PId,Base64EncodedGzippedBytes
$obj.PId = $ProcId
$obj.Proc... |
combined_dataset/train/non-malicious/sample_8_78.ps1 | sample_8_78.ps1 | #
# Module manifest for module 'OCI.PSModules.Mysql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Mysql.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_50_2.ps1 | sample_50_2.ps1 | #
# Module manifest for module 'OCI.PSModules.Oda'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Oda.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/MacroScopeParser.ps1 | MacroScopeParser.ps1 | #requires -version 2
#Chad Miller
#http://www.sev17.com/
#Uses MacroScope/Antlr to parse SQL query for tables and table aliases
#Download MacroScope from http://macroscope.sourceforge.net/ and compile from source
#Or grab compiled assemblies from http://cid-ea42395138308430.skydrive.live.com/embedicon.aspx/Publi... |
combined_dataset/train/non-malicious/2754.ps1 | 2754.ps1 |
function Compute-FileHash {
Param(
[Parameter(Mandatory = $true, Position=1)]
[string]$FilePath,
[ValidateSet("MD5","SHA1","SHA256","SHA384","SHA512","RIPEMD160")]
[string]$HashType = "MD5"
)
switch ( $HashType.ToUpper() )
{
"MD5" { $hash = [System.Security.Cryptography.MD5]... |
combined_dataset/train/non-malicious/sample_57_99.ps1 | sample_57_99.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
function Get-WinRMComputerName
{
<#
.... |
combined_dataset/train/non-malicious/2139.ps1 | 2139.ps1 |
Describe "ParserTests (admin\monad\tests\monad\src\engine\core\ParserTests.cs)" -Tags "CI" {
BeforeAll {
$functionDefinitionFile = Join-Path -Path $TestDrive -ChildPath "functionDefinition.ps1"
$functionDefinition = @'
function testcmd-parserbvt {
[CmdletBinding()]
par... |
combined_dataset/train/non-malicious/412.ps1 | 412.ps1 | function Read-PsfConfigFile
{
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, ParameterSetName = 'Path')]
[string]
$Path,
[Parameter(Mandatory = $true, ParameterSetName = 'Weblink')]
[string]
$Weblink,
[Parameter(Mandatory = $true, ParameterSetName = 'RawJson')]
[string]
$RawJson
)
... |
combined_dataset/train/non-malicious/sample_56_64.ps1 | sample_56_64.ps1 | <#
.SYNOPSIS
UninstallSyncServiceIIS.ps1 script file
This is a place-holder file only fofr agent patch build purposes
#>
Write-Host "This file functionality is deprecated and is place-holder only"
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# ... |
combined_dataset/train/non-malicious/sample_18_35.ps1 | sample_18_35.ps1 | #
# Module manifest for module 'OCI.PSModules.Common'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Common.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_1_0.ps1 | sample_1_0.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 = '92.1.0'
... |
combined_dataset/train/non-malicious/repr_1.ps1 | repr_1.ps1 | function repr {
[CmdletBinding()]
[OutputType([string])]
Param(
[Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]
$InputObject)
process {
if($null -eq $InputObject) {
$PSCmdlet.WriteObject('$null')
}
elseif($InputObject -is ... |
combined_dataset/train/non-malicious/2452.ps1 | 2452.ps1 |
[CmdletBinding()]
param ()
begin {
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
Set-StrictMode -Version Latest
function Get-LoggedOnUserSID {
[CmdletBinding()]
param ()
process {
try {
if (-not (Get-PSDrive -Name HKU -ErrorAction SilentlyContinue)) {
New-PSDr... |
combined_dataset/train/non-malicious/Get-Scope_4.ps1 | Get-Scope_4.ps1 | #function Get-Scope {
#.Synopsis
# Determine the scope of execution (are you in a module? how many scope layers deep are you?)
#.Parameter Invocation
# In order to correctly determine the scope, this function requires that you pass in the $MyInvocation variable when you call it.
#.Parameter ToHost
# If you ju... |
combined_dataset/train/non-malicious/Start-AppVTestMode.ps1 | Start-AppVTestMode.ps1 | #This script is designed to set a test server to use a specific directory for App-V Apps, to enable testing
#Without having to publish to an external repository.
#REQUIREMENTS: Windows 2008
##FUNCTIONS
# DESCRIPTION: Displays the attention message box & checks to see if the user clicks the ok button.
function Sh... |
combined_dataset/train/non-malicious/sample_32_25.ps1 | sample_32_25.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 = '75.1.0'
# Supported PSEditions
Comp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.