full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/powertab patch.ps1 | powertab patch.ps1 | # When in the cert provider - objects returned by gci must be completed by a particular member (not by ToString).
# This can be done more generically but for now this is super handy to complete with these types
$firstChildType = $childitems[0].GetType()
if ($firstChildType -is [Microsoft.Power... |
combined_dataset/train/non-malicious/sample_36_81.ps1 | sample_36_81.ps1 | $ErrorActionPreference = 'Stop'
<#
.Synopsis
Returns payload information from glcm. This info is required to send a heart beat request to AA
#>
function Get-HeartbeatInfo
{
[CmdletBinding()]
param()
$glcm = Get-DscLocalConfigurationManager
$configurationName = ""
$aaServerU... |
combined_dataset/train/non-malicious/Citrix License Info.ps1 | Citrix License Info.ps1 | ###########################################
# Licence Checking Script for Citrix #
# Virtu-Al - http://teckinfo.blogspot.com/
###########################################
param( [string] $sendmailsched )
Function Sendemail ($LicTypeText, $InstalledLicNum, $InUseNum, $PercentageNum)
{
#Email options for automa... |
combined_dataset/train/non-malicious/sample_34_37.ps1 | sample_34_37.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/sample_56_40.ps1 | sample_56_40.ps1 | #
# Module manifest for module 'OCI.PSModules.Loggingingestion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported... |
combined_dataset/train/non-malicious/sample_53_81.ps1 | sample_53_81.ps1 | # ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apach... |
combined_dataset/train/non-malicious/sample_25_39.ps1 | sample_25_39.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
<#
.Synopsis
Compares two .NET versions and ch... |
combined_dataset/train/non-malicious/sample_58_78.ps1 | sample_58_78.ps1 | #requires -Version 5.0
using namespace Microsoft.Dynamics.Framework.UI.Client
using namespace Microsoft.Dynamics.Framework.UI.Client.Interactions
class ClientContext {
$events = @()
$clientSession = $null
$culture = ""
$caughtForm = $null
$IgnoreErrors = $true
ClientContext([strin... |
combined_dataset/train/non-malicious/4207.ps1 | 4207.ps1 | function Decrypt-RDCMan ($FilePath) {
if (!$FilePath) {
[xml]$config = Get-Content "$env:LOCALAPPDATA\microsoft\remote desktop connection manager\rdcman.settings"
$Xml = Select-Xml -Xml $config -XPath "//FilesToOpen/*"
$Xml | select-object -ExpandProperty "Node"| % {Write-Output "Decrypting... |
combined_dataset/train/non-malicious/New-SQLComputerLogin_1.ps1 | New-SQLComputerLogin_1.ps1 | # Depends on Invoke-SQLCmd2 http://poshcode.org/2950
# Depends on Get-ADComputer http://poshcode.org/3009
function New-SqlComputerLogin {
#.Synopsis
# Creates a Login on the specified SQL server for a computer account
#.Example
# New-SqlComputerLogin -SQL DevDB2 -Computer BuildBox2 -Force
#
# Specifying the F... |
combined_dataset/train/non-malicious/SetDefaultPrinter_1.ps1 | SetDefaultPrinter_1.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_30_42.ps1 | sample_30_42.ps1 | . "$PSScriptRoot\..\project\api.ps1"
. "$PSScriptRoot\..\project\java.ps1"
. "$PSScriptRoot\helpers.ps1"
. "$PSScriptRoot\..\database\helpers.ps1"
function List-Changelog {
$query = "SELECT FILENAME FROM DATABASECHANGELOG"
return Execute-Query-From-Php -Query $query
}
function Get-Liquibase-Directory {
... |
combined_dataset/train/non-malicious/3912.ps1 | 3912.ps1 |
function Test-GetPartner
{
$partnerId="5127255"
$partner = New-AzManagementPartner -PartnerId $partnerId
$partner = Get-AzManagementPartner -PartnerId $partnerId
Assert-AreEqual $partnerId $partner.PartnerId
Assert-NotNull $partner.TenantId
Assert-NotNull $partner.ObjectId
Asser... |
combined_dataset/train/non-malicious/sample_54_35.ps1 | sample_54_35.ps1 | COURSE DATASHEET MS-900T01A Microsoft 365 Fundamentals 6 Learning path 2: Describe Microsoft 365 apps and services Module 1: What is Microsoft 365? 1. Introduction 2. Describe the differences between Office 365 and Microsoft 365 3. Describe Windows 365 4. Describe how Microsoft 365 empowers workers in this hybrid ... |
combined_dataset/train/non-malicious/935.ps1 | 935.ps1 |
$uniqueId=$(-join ((97..122) + (48..57) | Get-Random -Count 15 | % {[char]$_}))
$apiVersion = "2015-04-08"
$location = "West US 2"
$resourceGroupName = "mjbArmTest"
$accountName = "mycosmosaccount-$uniqueId"
$apiType = "EnableTable"
$accountResourceType = "Microsoft.DocumentDb/databaseAccounts"
$tableName = "tabl... |
combined_dataset/train/non-malicious/1033.ps1 | 1033.ps1 |
$probename = "AppPortProbe6"
$rulename="AppPortLBRule6"
$RGname="mysftestclustergroup"
$port=8303
$subscriptionID = 'subscription ID'
Connect-AzAccount
Get-AzSubscription -SubscriptionId $subscriptionID | Select-AzSubscription
$resource = Get-AzResource | Where {$_.ResourceGroupName –eq $RGname -and $_.ResourceTy... |
combined_dataset/train/non-malicious/4406.ps1 | 4406.ps1 | function Test-MicrosoftCertificate
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[System.Management.Automation.Signature]
$AuthenticodeSignature
)
$IsMicrosoftCertificate = $false
if($AuthenticodeSignature.SignerCertificate -and
('Microsoft.PowerShell.Comma... |
combined_dataset/train/non-malicious/sample_57_27.ps1 | sample_57_27.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
[CmdletBinding(DefaultParamet... |
combined_dataset/train/non-malicious/4220.ps1 | 4220.ps1 |
function Invoke-SqlQuery {
param (
[String]$ConnectionString,
[String]$Sqlserver,
[String]$Username,
[String]$Password,
[String]$Catalog,
[String]$Database,
[String]$Query
)
if (!$Database){
$Database = ";"
} else {
$Database = "$Database;"
}
if (!$Catalog){
$Catal... |
combined_dataset/train/non-malicious/4099.ps1 | 4099.ps1 |
function Install-EXEUpdates {
Set-Variable -Name Arguments -Scope Local -Force
Set-Variable -Name ErrCode -Scope Local -Force
Set-Variable -Name File -Scope Local -Force
Set-Variable -Name EXEFiles -Scope Local -Force
Set-Variable -Name RelativePath -Scope Local -Force
$RelativePath = (split-path $SCRIPT:M... |
combined_dataset/train/non-malicious/8b815eb7-c620-4159-b0fc-435ceeca036b.ps1 | 8b815eb7-c620-4159-b0fc-435ceeca036b.ps1 | # Add the Active Directory bits and not complain if they're already there
Import-Module ActiveDirectory -ErrorAction SilentlyContinue
# set default password
# change pass@word1 to whatever you want the account passwords to be
$defpassword = (ConvertTo-SecureString "pass@word1" -AsPlainText -force)
# Get domain... |
combined_dataset/train/non-malicious/3336.ps1 | 3336.ps1 |
function Remove-Role {
[PoshBot.BotCommand(
Aliases = ('rr', 'remove-role'),
Permissions = 'manage-roles'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string[]]$Name
)
$removed = @()
$no... |
combined_dataset/train/non-malicious/3133.ps1 | 3133.ps1 |
function Invoke-IPv4NetworkScan
{
[CmdletBinding(DefaultParameterSetName='CIDR')]
Param(
[Parameter(
ParameterSetName='Range',
Position=0,
Mandatory=$true,
HelpMessage='Start IPv4-Address like 192.168.1.10')]
[IPAddress]$StartIPv4Address,... |
combined_dataset/train/non-malicious/sample_22_53.ps1 | sample_22_53.ps1 | # Localized 12/03/2020 06:20 PM (GMT) 303:4.80.0411 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Evet
PromptNoString=&Hayır
BundleFound=Demet bulundu: {0}
PackageFound=Paket bulundu: {0}
EncryptedBundleFound=Şifreli demet bulundu: {0}
EncryptedPackageFound=Şif... |
combined_dataset/train/non-malicious/sample_12_60.ps1 | sample_12_60.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplace'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplace.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_56_89.ps1 | sample_56_89.ps1 | ###########################################################
#
# 'ExtensionService' module
#
###########################################################
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
Import-Module "$PSScriptRoot\ServiceHelper.psm1"
$script:GCInstallPath = "$PSScriptRoot\..... |
combined_dataset/train/non-malicious/1874.ps1 | 1874.ps1 |
Describe "Clear-Variable DRT Unit Tests" -Tags "CI" {
It "Clear-Variable normal variable Name should works"{
Set-Variable foo bar
Clear-Variable -Name foo
$var1=Get-Variable -Name foo
$var1.Name|Should -BeExactly "foo"
$var1.Value|Should -BeNullOrEmpty
$var1.Options|Should -BeExactly "None"
$var1.Descr... |
combined_dataset/train/non-malicious/100.ps1 | 100.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"... |
combined_dataset/train/non-malicious/3046.ps1 | 3046.ps1 | function Should-BeIn($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
[bool] $succeeded = $ExpectedValue -contains $ActualValue
if ($Negate) {
$succeeded = -not $succeeded
}
if (-not $succeeded) {
if ($Negate) {
return New-Object psobject -Property @... |
combined_dataset/train/non-malicious/3584.ps1 | 3584.ps1 |
function Create-ResourceGroupForTest
{
$useExistingService = [Microsoft.Azure.Commands.DataMigrationConfig]::GetConfigBool("useExistingService")
$location = [Microsoft.Azure.Commands.DataMigrationConfig]::GetConfigString("Location")
$rg = $null
if($useExistingService)
{
$rgName = [Microsoft.Azure.C... |
combined_dataset/train/non-malicious/New-UrlFile.ps1 | New-UrlFile.ps1 | function New-UrlFile
{
param( $URL = "http://www.google.com")
$UrlFile = [system.io.Path]::ChangeExtension([system.io.Path]::GetTempFileName(),".url")
$UrlFileContents = `
"[InternetShortcut]",
"URL=$URL"
Write-Host $URL
$UrlFileContents | Set-Content -Path $UrlFile
Get-Item $UrlFile
}
|
combined_dataset/train/non-malicious/sample_25_85.ps1 | sample_25_85.ps1 | #
# Module manifest for module 'OCI.PSModules.Recovery'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Recovery.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_49_95.ps1 | sample_49_95.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/sample_14_44.ps1 | sample_14_44.ps1 | #########################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Localized PackageManagement.Resources.psd1
#
#########################################################################################
ConvertFrom-StringDa... |
combined_dataset/train/non-malicious/sample_15_99.ps1 | sample_15_99.ps1 | ## Copyright (c) Microsoft Corporation. All rights reserved.
<#
.SYNOPSIS
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans.
.DESCRIPTION
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans. These performance recordings contain Microsoft-Antimal... |
combined_dataset/train/non-malicious/sample_17_85.ps1 | sample_17_85.ps1 | ##----------------------------------------------------------------------------
## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved.
##----------------------------------------------------------------------------
# Import string constants
. ./StringConstants.ps1
# Import shared functions and var... |
combined_dataset/train/non-malicious/Get-PrivateKeyPath.ps1 | Get-PrivateKeyPath.ps1 | #requires -Version 2.0
function Get-PrivateKeyPath
{
param
(
[Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)]
[System.Security.Cryptography.X509Certificates.X509Certificate2]
[ValidateScript( { ( $_ -is [System.Security.Cryptography.X509Certificates.X509Certificate2] ) } ) ]
$Ce... |
combined_dataset/train/non-malicious/1687.ps1 | 1687.ps1 |
function Get-User {
param (
[string]$comp = $env:COMPUTERNAME,
[ValidateSet('computersystem', 'process', 'dir')]
$method = 'computersystem'
)
switch ($method) {
'dir' {
Get-ChildItem \\$comp\c$\users -Directory -Exclude '*$*' | % {Get-Chi... |
combined_dataset/train/non-malicious/Invoke-PoshCode.ps1 | Invoke-PoshCode.ps1 | # .Summary
# Download and execute a script block from PoshCode.org
# .Description
# Download the code for a PoshCode script based on search of by specific index.
# Execute the code as a script block, passing arguments to it.
#
# Note: this is scary, and you should only use it if you really know what you're doing ... |
combined_dataset/train/non-malicious/sample_33_82.ps1 | sample_33_82.ps1 | #
# Module manifest for module 'OCI.PSModules.Rover'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Rover.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/Get-Credential.ps1 | Get-Credential.ps1 | function Get-Credential{
PARAM([String]$Title, [String]$Message, [String]$Domain, [String]$UserName, [switch]$Console)
## Carefully EA=SilentlyContinue and check for $True because by default it's MISSING (not False, as you might expect)
$cp = (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellI... |
combined_dataset/train/non-malicious/Get-MacAddressOui_1.ps1 | Get-MacAddressOui_1.ps1 | function Get-MacAddressOui {
<#
.SYNOPSIS
Gets a MAC address OUI (Organizationally Unique Identifier).
.DESCRIPTION
The Get-MacAddressOui function retrieves the MAC address OUI reference list maintained by the IEEE standards website and
returns the name of the company to which the MAC address OUI is ass... |
combined_dataset/train/non-malicious/Add-UniqueEndings.ps1 | Add-UniqueEndings.ps1 | ## Add-UniqueEndings
## Takes an array of strings and forces them to be unique by adding _<number> tails to duplicates.
####################################################################################################
## Usage:
## $$: (Add-UniqueEndings "one","two","three","one","two","one","one_5").ToString()... |
combined_dataset/train/non-malicious/sample_5_75.ps1 | sample_5_75.ps1 | ConvertFrom-StringData @'
id_setupapilogs=Setup API Logs
id_setupapilogsobtaining=Obtaining SetupAPI.*.Log
id_setupapilogsoutput=SetupAPI Log
id_setupapilogsoutputdesc=Device Drivers Instalation Logs
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3... |
combined_dataset/train/non-malicious/sample_49_82.ps1 | sample_49_82.ps1 | <#
.SYNOPSIS
Common Reporting functions across all modules/scenarios
.DESCRIPTION
Logging, Reporting
.INPUTS
Inputs (if any)
.OUTPUTS
Output (if any)
.NOTES
General notes
#>
function Set-AzStackHciOutputPath
{
param ($Path, $Source='AzStackHciEnvironmentChecker/Diagnostic')
... |
combined_dataset/train/non-malicious/3399.ps1 | 3399.ps1 |
function Test-VirtualMachine
{
param ($loc, [bool] $hasManagedDisks = $false)
$rgname = Get-ComputeTestResourceName
try
{
if ($loc -eq $null)
{
$loc = Get-ComputeVMLocation;
}
New-AzureRmResourceGroup -Name $rgname -Location $loc ... |
combined_dataset/train/non-malicious/sample_23_36.ps1 | sample_23_36.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 = '75.1.0'
# Sup... |
combined_dataset/train/non-malicious/3742.ps1 | 3742.ps1 |
param(
[Parameter(Mandatory=$true, Position=0)]
[string] $TestRunNameSpace,
[Parameter(Mandatory=$false, Position=1)]
[ValidateSet('ControlPlane','DataPlane', 'All')]
[string] $TestMode = 'All',
[Parameter(Mandatory=$false, Position=2)]
[string] $Location = 'eastus2',
[Parameter(Mandato... |
combined_dataset/train/non-malicious/sample_12_66.ps1 | sample_12_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Genericartifactscontent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Genericartifactscontent.dll'
# Version number of this module.
ModuleVersion = '73.1.0... |
combined_dataset/train/non-malicious/sample_28_73.ps1 | sample_28_73.ps1 | # Localized 05/07/2022 03:57 AM (GMT) 303:7.0.30723 AssignedAccessMsg.psd1
# Localized resources for AssignedAccess.psm1
ConvertFrom-StringData @'
###PSLOC
AppliedSettings=User and Application set, log on as this user to start Assigned Access
ClearedSettings=Cleared Assigned Access, settings reset to factory defa... |
combined_dataset/train/non-malicious/1387.ps1 | 1387.ps1 |
function Test-CScheduledTask
{
[CmdletBinding()]
[OutputType([bool])]
param(
[Parameter()]
[Alias('TaskName')]
[string]
$Name
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
$Na... |
combined_dataset/train/non-malicious/sample_65_71.ps1 | sample_65_71.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/$env_PATH permanently.ps1 | $env_PATH permanently.ps1 | #requires -version 2
param(
[string] $AddedFolder,
[bool] $ApplyImmediately = $true
)
$environmentRegistryKey = 'Registry::HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\\Environment'
$oldPath = (Get-ItemProperty -Path $environmentRegistryKey -Name PATH).Path
# See if a n... |
combined_dataset/train/non-malicious/2860.ps1 | 2860.ps1 | function Properties {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[scriptblock]$properties
)
$psake.context.Peek().properties.Push($properties)
}
|
combined_dataset/train/non-malicious/sample_26_86.ps1 | sample_26_86.ps1 | #
# Module manifest for module 'OCI.PSModules.Budget'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Budget.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_16_24.ps1 | sample_16_24.ps1 | # Copyright ?2009, Microsoft Corporation. All rights reserved.
# You may use this code and information and create derivative works of it,
# provided that the following conditions are met:
# 1. This code and information and any derivative works may only be used for
# troubleshooting a) Windows and b) products for ... |
combined_dataset/train/non-malicious/a4d96102-d5a8-4437-b3e0-568a0936fcbf.ps1 | a4d96102-d5a8-4437-b3e0-568a0936fcbf.ps1 | # The $test variable can be pretty much whatever you want it to be, or with a little adjustment it isn't even necessary.
# I just wanted to set it up like this for the $match variable later on
$test=(get-folder testing|get-vm)
#$data and the csv is where all the information lies that this script/s pulls
$data=imp... |
combined_dataset/train/non-malicious/sample_51_13.ps1 | sample_51_13.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_9_23.ps1 | sample_9_23.ps1 | ConvertFrom-StringData @'
id_ctsaddons=Setup App Compat Component
id_ctsaddonsdescription=Collects Setup App Compat information.
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIB... |
combined_dataset/train/non-malicious/4376.ps1 | 4376.ps1 | function Get-ValidModuleLocation
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$LocationString,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$ParameterName,
[Parameter... |
combined_dataset/train/non-malicious/sample_34_93.ps1 | sample_34_93.ps1 | # escape=`
ARG base_image
FROM ${base_image}
# https://www.thomasmaurer.ch/2019/07/how-to-install-and-update-powershell-7/
# Wrapping the following command in cmd.exe
# iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet"
RUN powershell -ExecutionPolicy RemoteSigned -Command "$ErrorActionPreference... |
combined_dataset/train/non-malicious/3223.ps1 | 3223.ps1 |
Describe 'New-PoshBotInstance' {
BeforeAll {
$VerbosePreference = 'SilentlyContinue'
$PSDefaultParameterValues = @{
'New-PoshBotInstance:Verbose' = $false
}
$script:backend = New-PoshBotSlackBackend -Configuration @{Token = (New-Guid).ToString(); Name = 'Test-Backend'}
... |
combined_dataset/train/non-malicious/Get-SerialNumber.ps1 | Get-SerialNumber.ps1 | function Get-SerialNumber {
param([VMware.VimAutomation.Types.VMHost[]]$InputObject = $null)
process {
$hView = $_ | Get-View -Property Hardware
$serviceTag = $hView.Hardware.SystemInfo.OtherIdentifyingInfo | where {$_.IdentifierType.Key -eq "ServiceTag" }
$assetTag = $hView.Hardware.SystemInfo.OtherId... |
combined_dataset/train/non-malicious/sample_63_39.ps1 | sample_63_39.ps1 | #
# Module manifest for module 'OCI.PSModules.Sch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Sch.dll'
# Version number of this module.
ModuleVersion = '89.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_65_49.ps1 | sample_65_49.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"
... |
combined_dataset/train/non-malicious/sample_12_83.ps1 | sample_12_83.ps1 | #************************************************
# TS_ETLTraceCollector.ps1
# Version 1.2.2
# Date: 10-31-2010
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script is a universal ETL Trace collector. Caller has to inform a Data Collector Set XML for the ETL and additional data.
# ... |
combined_dataset/train/non-malicious/728.ps1 | 728.ps1 |
function New-RsFolder
{
[cmdletbinding()]
param
(
[Parameter(Mandatory = $True)]
[Alias('ItemPath','Path')]
[string]
$RsFolder,
[Parameter(Mandatory = $True)]
[Alias('Name')]
[string]
$FolderName,
[string]
$Descriptio... |
combined_dataset/train/non-malicious/sample_60_48.ps1 | sample_60_48.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 Copy-ToTemp
{
... |
combined_dataset/train/non-malicious/sample_58_33.ps1 | sample_58_33.ps1 | #
# Module manifest for module 'DscInstall'
#
# Generated by: Zia Jalali
#
# Generated on: 07/31/2017
#
@{
# Script module or binary module file associated with this manifest.
ModuleToProcess = 'Heartbeat.psm1'
# Version number of this module.
ModuleVersion = '1.1'
# ID used to uniquely identify thi... |
combined_dataset/train/non-malicious/Start-RDP_2.ps1 | Start-RDP_2.ps1 | ########################################################################################################################
# NAME
# Start-RDP
#
# SYNOPSIS
# Opens a remote desktop connection to another computer.
#
# SYNTAX
# Start-RDP [[-Server] <string>] [[-Width] <int>] [[-Height] <int>]
# Star... |
combined_dataset/train/non-malicious/1907.ps1 | 1907.ps1 |
Describe "TestData cmdlets" -Tags "CI" {
Context "Get-TypeData" {
It "System.DateTime" {
(Get-TypeData System.DateTime).TypeName | Should -Be System.DateTime
("System.DateTime" | Get-TypeData).TypeName | Should -Be System.DateTime
}
It "Type accelerato... |
combined_dataset/train/non-malicious/2837.ps1 | 2837.ps1 | function GetTasksFromContext($currentContext) {
$docs = $currentContext.tasks.Keys | foreach-object {
$task = $currentContext.tasks.$_
new-object PSObject -property @{
Name = $task.Name;
Alias = $task.Alias;
Description = $task.Description;
DependsOn... |
combined_dataset/train/non-malicious/4402.ps1 | 4402.ps1 | function HttpClientApisAvailable
{
$HttpClientApisAvailable = $false
try
{
[System.Net.Http.HttpClient]
$HttpClientApisAvailable = $true
}
catch
{
}
return $HttpClientApisAvailable
}
|
combined_dataset/train/non-malicious/2121.ps1 | 2121.ps1 |
Describe "Breakpoints set on custom FileSystem provider files should work" -Tags "CI" {
try
{
$scriptPath = [io.path]::GetTempPath()
$scriptName = "DebuggerScriptTests-ExposeBug221362.ps1"
$scriptFullNam... |
combined_dataset/train/non-malicious/sample_22_19.ps1 | sample_22_19.ps1 | function trySetDesignerProp(tname, ttype, val) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0);
trait.value = val;
}
if (command.getTrait("state").value == 0) {
command.getTrait("state").value = 2;
trySetDesignerProp("manipulationWorldMode", "bool", true);
}
else {
... |
combined_dataset/train/non-malicious/1773.ps1 | 1773.ps1 |
Describe "SecureString conversion tests" -Tags "CI" {
BeforeAll {
$string = "ABCD"
$secureString = [System.Security.SecureString]::New()
$string.ToCharArray() | foreach-object { $securestring.AppendChar($_) }
}
It "using null arguments to ConvertFrom-SecureString produces an excep... |
combined_dataset/train/non-malicious/sample_11_11.ps1 | sample_11_11.ps1 | #
# Module manifest for module 'OCI.PSModules.Psql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Psql.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/ESXiMgmt module.ps1 | ESXiMgmt module.ps1 | #######################################################################################################################
# File: ESXiMgmt.psm1 #
# Author: Alexander Petrovskiy ... |
combined_dataset/train/non-malicious/finddupe_3.ps1 | finddupe_3.ps1 | function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.MD5CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.OpenRead();
$hashByteArray = $hashA... |
combined_dataset/train/non-malicious/Custom Speech Commands_1.ps1 | Custom Speech Commands_1.ps1 | #Filename commands.ps1
import-module "G:\\Documents\\Speech Macros\\custom.psm1"
import-module "G:\\Documents\\Speech Macros\\alice.psm1"
Add-SpeechCommands @{
"test command" = { Say $(Respond "3:2,4:0-2") }
" * the percentages * " = { Say $(Percentages) }
" * star date * " = { Say "Current,... |
combined_dataset/train/non-malicious/2579.ps1 | 2579.ps1 |
[CmdletBinding()]
param
(
[xml]$config = (Get-Content E:\Dexma\support\Sync-DBBackups-config.ps1)
)
cls
foreach ( $Client in $config.clients.client ) {
Write-Host "Begin $($Client.Name)." -ForegroundColor DarkGray
$BAKSourcePath = '\\' + $Client.SourceDBServer + '\e$\MSSQL10.MSSQLSERVER\MSSQL\BAK\'
$BAKDestP... |
combined_dataset/train/non-malicious/4054.ps1 | 4054.ps1 | param(
[string]$refPath = 'Pscx1_0Commands.xml',
[string]$diffPath = 'Pscx1_1Commands.xml'
)
function Remove-Aliases($cmdal) {
$script:aliases = $($script:aliases |? {
$cmdal -notcontains $_.Name
})
}
function Get-CommandNoun($command) {
$command.Split('-', 2)[1]
}
function Get-AliasCommand($al) {
$diff |?... |
combined_dataset/train/non-malicious/3458.ps1 | 3458.ps1 |
function Test-LinkedService
{
$dfname = Get-DataFactoryName
$rgname = Get-ResourceGroupName
$rglocation = Get-ProviderLocation ResourceManagement
$dflocation = Get-ProviderLocation DataFactoryManagement
New-AzResourceGroup -Name $rgname -Location $rglocation -Force
try
... |
combined_dataset/train/non-malicious/sample_11_61.ps1 | sample_11_61.ps1 | <##############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
###########################################################... |
combined_dataset/train/non-malicious/sample_59_79.ps1 | sample_59_79.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 = 'ht... |
combined_dataset/train/non-malicious/246.ps1 | 246.ps1 | function New-CimSmartSession
{
[CmdletBinding()]
PARAM (
[Parameter(ValueFromPipeline = $true)]
[string[]]$ComputerName = $env:COMPUTERNAME,
[System.Management.Automation.Credential()]
$Credential = [System.Management.Automation.PSCredential]::Empty
)
BEGIN
{
... |
combined_dataset/train/non-malicious/sample_7_78.ps1 | sample_7_78.ps1 | // ===========================================================================================================================
// Class DCIM_LDAPService
// ===========================================================================================================================
[
Description ("Contains settings f... |
combined_dataset/train/non-malicious/sample_49_90.ps1 | sample_49_90.ps1 | # DO NOT COPY THIS MANIFEST VERBATIM. THIS IS JUST A SAMPLE.
# GENERATE YOUR MANIFEST USING THE New-ModuleManifest COMMAND TO
# GUARANTEE YOU GET A UNIQUE GUID FOR YOUR MODULE.
@{
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additio... |
combined_dataset/train/non-malicious/Set Single email .ps1 | Set Single email .ps1 | # Very simple script to use in Exchange 2007 with a dead simple task
# Create an email enabled user with the local Email Address Policy Disabled with a SINGLE email address
# Attached to it
#
# This can be used in an environment where you may have multiple email addresses but don't want an account picking
# up mul... |
combined_dataset/train/non-malicious/ProcuriosJSON.psm1.ps1 | ProcuriosJSON.psm1.ps1 | function ConvertFrom-Json {
param (
[Parameter( Mandatory = $true, ValueFromPipeline = $true, Position = 0)]
[Alias("Json")]
[string[]]
$InputObject,
[switch]$AsPSObject = $false
)
Process {
$output = [procurios.Public.JSON]::JsonDecode( $InputObject )
if ( $AsPSObject ) {
$output | ForEa... |
combined_dataset/train/non-malicious/3744.ps1 | 3744.ps1 | Param(
[Parameter(Mandatory=$true, Position=0)]
[string] $TestRunNameSpace,
[Parameter(Mandatory=$false, Position=1)]
[string] $Vault = "",
[Parameter(Mandatory=$false, Position=2)]
[string] $StorageResourceId = $null
)
. (Join-Path $PSScriptRoot "..\..\..\..\Common\Commands.ScenarioTests.Commo... |
combined_dataset/train/non-malicious/Deny-PendingRequest.ps1 | Deny-PendingRequest.ps1 | #####################################################################
# Deny certificate request.ps1
# Version 1.0
#
# Denies certificate request from a pending request
#
# For this function to succeed, the certificate request must be pending
#
# Vadims Podans (c) 2010
# http://en-us.sysadmins.lv/
###########... |
combined_dataset/train/non-malicious/Explorer Style Script.ps1 | Explorer Style Script.ps1 | $nul = "<NULL>"
$type = "Directory", "File"
function Show-Error([string]$mes) {
[Windows.Forms.MessageBox]::Show($mes, "Error",
[Windows.Forms.MessageBoxButtons]::OK,
[Windows.Forms.MessageBoxIcon]::Exclamation
)
}
function Add-RootsTree {
[IO.Directory]::GetLogicalDrives() | % {
$nod = ... |
combined_dataset/train/non-malicious/1950.ps1 | 1950.ps1 |
Describe "ConvertTo-Html Tests" -Tags "CI" {
BeforeAll {
$customObject = [pscustomobject]@{"Name" = "John Doe"; "Age" = 42; "Friends" = ("Jack", "Jill")}
$newLine = "`r`n"
}
function normalizeLineEnds([string]$text)
{
$text -replace "`r`n?|`n", "`r`n"
}
It "Test Conv... |
combined_dataset/train/non-malicious/2071.ps1 | 2071.ps1 |
Import-Module HelpersCommon
$script:cmdletsToSkip = @(
"Get-PSHostProcessInfo",
"Out-Default",
"Register-ArgumentCompleter",
"New-PSRoleCapabilityFile",
"Get-PSSessionCapability",
"Disable-PSRemoting",
"Enable-PSRemoting",
"Get-ExperimentalFeature",
"Enable-ExperimentalFeature... |
combined_dataset/train/non-malicious/sample_66_81.ps1 | sample_66_81.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 = '84.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_46_15.ps1 | sample_46_15.ps1 | #
# Module manifest for module 'OCI.PSModules.Managementdashboard'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Managementdashboard.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Sup... |
combined_dataset/train/non-malicious/Get-HexDump.ps1 | Get-HexDump.ps1 | <#
Required v2.0
Using examples:
PS C:\\> gi .\\foo | hex -b 150
Dumps first 150 bytes of foo.
PS C:\\> hex .\\foo -b 150
It's equal first command.
#>
function Get-HexDump {
[CmdletBinding()]
param(
[Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]
... |
combined_dataset/train/non-malicious/Mailbox User_Update.ps1 | Mailbox User_Update.ps1 | #Generated Form Function
function GenerateForm {
########################################################################
# Code Generated By: SAPIEN Technologies PrimalForms v1.0.1.0
# Generated On: 5/10/2010 9:28 AM
# Generated By: Bernard Chouinard berchouinard@gmail.com
# This script requires Powershell v2
#... |
combined_dataset/train/non-malicious/1027025e-d46a-4d37-a5b0-b1c76068dc6b.ps1 | 1027025e-d46a-4d37-a5b0-b1c76068dc6b.ps1 | # Code to auto update the Address policy, GAL, OAB and storage groups and mailbox databases of an Exchange 2007 server by John McLear
# This code is good for hosting providers or people who wish to use lots of storage groups and mailbox databases.
#
# Thanks to Joel Bennett (Jaykul) for general scripting help and t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.