full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_44_1.ps1 | sample_44_1.ps1 | # Pipeline creates experimental msbuild insertions.
trigger: none # Prevents this pipeline from triggering on check-ins
pr: none # don't run this on PR as well
parameters:
# Dotnet installer channel from which to take the latest dotnet bits.
- name: DotnetInstallerChannel
displayName: Dotnet installer channel... |
combined_dataset/train/non-malicious/Get-Parameter_7.ps1 | Get-Parameter_7.ps1 | function Get-Parameter ( $Cmdlet, [switch]$ShowCommon, [switch]$Full ) {
foreach ($paramset in (Get-Command $Cmdlet).ParameterSets){
$Output = @()
foreach ($param in $paramset.Parameters) {
if ( !$ShowCommon ) {
if ($param.aliases -match "vb|db|ea|wa|ev|wv|ov|ob|wi|cf") { continue }
}
$process ... |
combined_dataset/train/non-malicious/4435.ps1 | 4435.ps1 | function Find-Command
{
[CmdletBinding(HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=733636')]
[outputtype('PSCustomObject[]')]
Param
(
[Parameter(Position = 0)]
[ValidateNotNullOrEmpty()]
[string[]]
$Name,
[Parameter()]
[ValidateNotNullOrEmpty(... |
combined_dataset/train/non-malicious/603.ps1 | 603.ps1 |
function Get-SPListItems{
param(
[Parameter(Mandatory=$false)]
$SPweb,
[Parameter(Mandatory=$false)]
[string]$FilterListName,
[switch]$OnlyDocumentLibraries,
[switch]$OnlyCheckedOutFiles,
[switch]$Recursive
)
if ((Get-PSSnapin โMicrosoft.SharePoin... |
combined_dataset/train/non-malicious/sample_28_30.ps1 | sample_28_30.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 = '73.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/Get-MIX10Video.ps1 | Get-MIX10Video.ps1 | #requires -version 2.0
PARAM (
[Parameter(Position=1, Mandatory=$true)]
[ValidateSet("wmv","wmvhigh","ppt", "mp4")]
[String]$MediaType,
[string]$Destination = $PWD
)
if( ([System.Environment]::OSVersion.Version.Major -gt 5) -and -not ( # Vista and ...
new-object Security.Principal.WindowsPrinci... |
combined_dataset/train/non-malicious/sample_18_45.ps1 | sample_18_45.ps1 | // workaround for https://github.com/microsoft/fast/issues/5675
export function updateProxy(id) {
if (!id) {
return;
}
const element = document.getElementById(id);
if (element && element.form) {
if (element.form.id !== '') {
element.proxy.setAttribute("form", elemen... |
combined_dataset/train/non-malicious/Sort-ISE_Boots.ps1 | Sort-ISE_Boots.ps1 | function Sort-ISE ()
{
<#
.SYNOPSIS
ISE Extension sort text starting at column $start comparing the next $length characters
.DESCRIPTION
ISE Extension sort text starting at column $start comparing the next $length characters
Leftmost column is column 1
.NOTES
File Name : Sort-IS... |
combined_dataset/train/non-malicious/sample_3_74.ps1 | sample_3_74.ps1 | // ==================================================================
// DCIM_CLPSettingData
// ==================================================================
[ dynamic, provider("dcismprovider")]
class DCIM_CLPSettingData : CIM_CLPSettingData
{ };
// Instance: DCIM_CLPSettingData for CLP spec default set... |
combined_dataset/train/non-malicious/Folder inheritance.ps1 | Folder inheritance.ps1 | # setup the test folders
md c:\\grandfather\\father\\son
md c:\\grandmother\\mother\\daughter
# By default the folders will inherit ACLs from the C: drive
# To toggle it or change it to the desired setting
# Will force the inheritance from parent
$inheritance = get-acl c:\\grandmother
$inhe... |
combined_dataset/train/non-malicious/sample_58_24.ps1 | sample_58_24.ps1 | #
# Module manifest for module 'OCI.PSModules.Redis'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Redis.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_17_97.ps1 | sample_17_97.ps1 | #
# Module manifest for module 'OCI.PSModules.Emwarehouse'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emwarehouse.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_24_95.ps1 | sample_24_95.ps1 | ConvertFrom-StringData -StringData @'
AdapterNotFound = ๆๅฎใใใใขใใใฟใผใฏ่ฆใคใใใพใใใงใใ: {0}
InvalidParams = ็กๅนใชใใฉใกใผใฟใผใฎใปใใใใใฉใกใผใฟใผใปใปใใใ็ขบ่ชใใใซใฏใcmdlet ใใซใใๅ็
งใใฆใใ ใใใ
InvalidParamsAdapterAndName = Name ใจ Adapter ใฎไธกๆนใฎใใฉใกใผใฟใผใๆๅฎใใใใจใฏใงใใพใใใ
InvalidParamsConfigAndModule = Module ใจ Configuration ใฎไธกๆนใฎใใฉใกใผใฟใผใๆๅฎใใใใจใฏใงใใพใใใ
InvalidModule ... |
combined_dataset/train/non-malicious/Combine-CSV Function.ps1 | Combine-CSV Function.ps1 | function Combine-CSV{
<#
.Synopsis
Combines similar CSV files into a single CSV File
.Description
Function will combine common .CSV files into one large file. CSV files should have same header.
This script is intended to aid when doing large reports across a large environment.
.Parameter S... |
combined_dataset/train/non-malicious/sample_29_53.ps1 | sample_29_53.ps1 | RefreshAllDataAndFormatRefreshAllDataAndFormatrฤทcupฤถrelesvaleursdesdonnฤทeslesplusrฤทcentesรpartirduserveurWebd'IBMCognosetmetรjourcesvaleursdansledocument,leclasseuroulaprฤทsentationMicrosoftOfficeencours.SyntaxeLesystฤถmedoitฤปtreconnectฤทauserveurWebd'IBMCognos.VฤทrifiezquelapropriฤทtฤทMฤทthodedemiseรjourd'invitedel'ongletGฤทr... |
combined_dataset/train/non-malicious/Sort IE Favorites.ps1 | Sort IE Favorites.ps1 | $Results = gci $env:userprofile\\favorites -rec -inc *.url |
? {select-string -inp $_ -quiet "^URL=http"} |
select @{Name="Name"; Expression={[IO.Path]::GetFileNameWithoutExtension($_.FullName)}},
@{Name="URL"; Expression={get-content $_ | ? {$_ -match "^URL=http"} | % {$_.Substring(4)}}}
New-Item $env:userprofil... |
combined_dataset/train/non-malicious/2266.ps1 | 2266.ps1 | Begin {
try {
Add-Type -AssemblyName "System.Drawing" -ErrorAction Stop
Add-Type -AssemblyName "System.Windows.Forms" -ErrorAction Stop
$ModulePath = Join-Path -Path "$($env:SystemDrive)\Program Files (x86)\Microsoft Intune Mobile Application Management\Android\App Wrappin... |
combined_dataset/train/non-malicious/851.ps1 | 851.ps1 |
param (
[Parameter(Mandatory = $true,
HelpMessage= "Source Storage account name.")]
[ValidatePattern("^[a-z0-9`]{3,24}$")]
[String]$srcStorageAccountName,
[Parameter(Mandatory = $true,
HelpMessage= "Source Storage account key.")]
[String]$srcStorageAccountKey,
[Parameter(Man... |
combined_dataset/train/non-malicious/3601.ps1 | 3601.ps1 |
function Get-AzureRmSecurityLocation-SubscriptionScope
{
$locations = Get-AzSecurityLocation
Validate-Locations $locations
}
function Get-AzureRmSecurityLocation-SubscriptionLevelResource
{
$location = Get-AzSecurityLocation | Select -First 1
$fetchedLocation = Get-AzSecurityLocation -Name $l... |
combined_dataset/train/non-malicious/Check PowerShell version.ps1 | Check PowerShell version.ps1 |
#Check if PowerShell version 3 or higher is installed
if($host.Version.Major -lt 3)
{
Write-Host "PowerShell Version 3 or higher needs to be installed" -ForegroundColor Red
Write-Host "Windows Management Framework 3.0 - RC" -ForegroundColor Magenta
Write-Host "http://www.microsoft.com/en-us/download/details... |
combined_dataset/train/non-malicious/1596.ps1 | 1596.ps1 |
function Encode-Text {
param (
[string]$Text,
[validateset('SecureString', 'SecureStringWithKey', 'Base64', 'ASCII')]
[string]$Method = 'Base64'
)
process {
if (!$Text) {
$Text = $input
}
}
end{
switch ($method) {
... |
combined_dataset/train/non-malicious/sample_31_66.ps1 | sample_31_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Threatintelligence'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Threatintelligence.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Suppo... |
combined_dataset/train/non-malicious/sample_5_2.ps1 | sample_5_2.ps1 | [dynamic, provider("dcismprovider"),
Association, Description ("ElementCapabilities represents the association between "
"ManagedElements and their Capabilities." )
]
class DCIM_PMSElementCapabilities : CIM_ElementCapabilities
{
[
Description ("This property represents the Capabilities obje... |
combined_dataset/train/non-malicious/sample_12_6.ps1 | sample_12_6.ps1 | #************************************************
# TS_B2693877_Sophos_BEFLTCheck.ps1
# Version 1.0.1
# TemplateVersion 1.2
# Date: 04/26/2012 11:29:18
# Author: jasonf
# Description: Check for the presence of Sophos BEFLT.SYS version 5.60.1.7
#************************************************
Import-Localize... |
combined_dataset/train/non-malicious/sample_44_47.ps1 | sample_44_47.ps1 | #
# Module manifest for module 'OCI.PSModules.Cims'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cims.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/1131.ps1 | 1131.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldCreateCredential
{
$cred = New-Credential -User 'Credential' -Password 'password1'
Assert-IsNotNull $cred 'New-Credential didn''t create credential object.'
... |
combined_dataset/train/non-malicious/Function Run-Script_2.ps1 | Function Run-Script_2.ps1 | #################################################################################
# This function should be included in the PowerShell ISE profile.ps1 and it will
# display the start and end times of any scripts started by clicking 'Run Script'
# in the Add-ons Menu, or F2; additionally they will be logged to the S... |
combined_dataset/train/non-malicious/4212.ps1 | 4212.ps1 | function Invoke-Mimikatz
{
[CmdletBinding(DefaultParameterSetName="DumpCreds")]
Param(
[Parameter(Position = 0)]
[String[]]
$ComputerName,
[Parameter(ParameterSetName = "DumpCreds", Position = 1)]
[Switch]
$DumpCreds,
[Parameter(ParameterSetName = "DumpCerts", Position = 1)]
[Switch]
$Dum... |
combined_dataset/train/non-malicious/253.ps1 | 253.ps1 | function Get-ScriptDirectory
{
if($hostinvocation -ne $null)
{
Split-Path $hostinvocation.MyCommand.path
}
else
{
Split-Path $script:MyInvocation.MyCommand.Path
}
}
|
combined_dataset/train/non-malicious/sample_23_61.ps1 | sample_23_61.ps1 | # Localized 12/03/2020 06:20 PM (GMT) 303:4.80.0411 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=ะ&ะฐ
PromptNoString=&ะะตั
BundleFound=ะะฐะนะดะตะฝะฝัะน ะฝะฐะฑะพั: {0}
PackageFound=ะะฑะฝะฐััะถะตะฝ ะฟะฐะบะตั: {0}
EncryptedBundleFound=ะะฐะนะดะตะฝ ะทะฐัะธััะพะฒะฐะฝะฝัะน ะฝะฐะฑะพั: {0}
EncryptedPackageFoun... |
combined_dataset/train/non-malicious/142.ps1 | 142.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/1589.ps1 | 1589.ps1 | $folders = @('C:\Windows\Temp\*', 'C:\Documents and Settings\*\Local Settings\temp\*', 'C:\Users\*\Appdata\Local\Temp\*', 'C:\Users\*\Appdata\Local\Microsoft\Windows\Temporary Internet Files\*', 'C:\Windows\SoftwareDistribution\Download', 'C:\Windows\System32\FNTCACHE.DAT')
foreach ($folder in $folders) {Remove-Ite... |
combined_dataset/train/non-malicious/Get-RemoteRegistry_4.ps1 | Get-RemoteRegistry_4.ps1 | ## Get-RemoteRegistry
########################################################################################
## Version: 2.2
## + Added a feature that will return the (Default) values for a key.
## These are referenced as ."(Default)".
## I didn't want to use just "Default" as the property name because of... |
combined_dataset/train/non-malicious/1633.ps1 | 1633.ps1 | function ConvertFrom-Bytes {
param (
[string]$bytes,
[string]$savepath
)
$dir = Split-Path $savepath
if (!(Test-Path $dir)) {
md $dir | Out-Null
}
[convert]::FromBase64String($bytes) | Set-Content $savepath -Encoding Byte
}
|
combined_dataset/train/non-malicious/1022.ps1 | 1022.ps1 | $rgName = <Specify your lab's resource group name>
$subscriptionId = <Specify your subscription ID>
$labName = <Specify your lab name>
Get-AzProviderOperation -OperationSearchString "Microsoft.DevTestLab/*"
(Get-AzRoleDefinition "DevTest Labs User").Actions
$policyRoleDef = (Get-AzRoleDefinition "DevTest Labs User"... |
combined_dataset/train/non-malicious/sample_59_70.ps1 | sample_59_70.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="$basedir\..\.store\vite@5.2.10\node_modules"
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# ar... |
combined_dataset/train/non-malicious/sample_50_12.ps1 | sample_50_12.ps1 | /*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-------------... |
combined_dataset/train/non-malicious/sample_12_98.ps1 | sample_12_98.ps1 | #
# Module manifest for module 'OCI.PSModules.Functions'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Functions.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_8_98.ps1 | sample_8_98.ps1 | ConvertFrom-StringData @'
progressbar_id_crm_org_update_check=Checking Microsoft CRM Organizations that have not been updated to latest revision
progressbar_id_crm_org_update_checkdesc=Checking Microsoft CRM Organizations that have not been updated to latest revision. Important database updates should be applied.
'@... |
combined_dataset/train/non-malicious/sample_12_49.ps1 | sample_12_49.ps1 | ##----------------------------------------------------------------------------
## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved.
##---------------------------------------------------------------------------
# Import shared functions and vars
. .\Commonalities.ps1
. .\StringConstants.ps1
Wr... |
combined_dataset/train/non-malicious/1546.ps1 | 1546.ps1 |
function New-MrPlanetPowerShellAuthor {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]$FirstName,
[Parameter(Mandatory)]
[string]$LastName,
[string]$Bio,
[string]$StateOrRegion,
[string]$EmailAddress,
[string]$TwitterHandle,
... |
combined_dataset/train/non-malicious/sample_41_81.ps1 | sample_41_81.ps1 | . "$PSScriptRoot/../project/api.ps1"
. "$PSScriptRoot/../php/api.ps1"
. "$PSScriptRoot/../database/helpers.ps1"
. "$PSScriptRoot/helpers.ps1"
function Php-Console {
param (
$Command,
$php=(Get-Php)
)
Set-Location (Get-Project-Root)
return & $php "-d" 'auto_prepend_file=""' "-d" "allow... |
combined_dataset/train/non-malicious/sample_2_5.ps1 | sample_2_5.ps1 | #
# Module manifest for module 'OCI.PSModules.Aispeech'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aispeech.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/Fill-ErUp.ps1 | Fill-ErUp.ps1 | function Fill-ErUp
{
<#
.Synopsis
The function will append random integers to a specified file through $Path until it reaches the $Size requirement.
.Description
Fills a file up with random integers until the file size is equal to the desired size. Used to increase file mememory size.
.Parameter FileP... |
combined_dataset/train/non-malicious/sample_55_71.ps1 | sample_55_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Emaildataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emaildataplane.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSE... |
combined_dataset/train/non-malicious/sample_7_71.ps1 | sample_7_71.ps1 | ConvertFrom-StringData @'
id_telnetsystemaccount_sd=The Telnet service is running under Local System account and this may cause problems with Plug and Play device installation.
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3Ag... |
combined_dataset/train/non-malicious/sample_10_39.ps1 | sample_10_39.ps1 | ConvertFrom-StringData @'
id_appliedsectemploutput=Applied Security Templates
id_appliedsectemplobtaining=Gathering applied security templates
'@
# SIG # Begin signature block
# MIIoVAYJKoZIhvcNAQcCoIIoRTCCKEECAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
#... |
combined_dataset/train/non-malicious/3735.ps1 | 3735.ps1 |
function Test-NestedEndpointsCreateUpdate
{
$resourceGroup = TestSetup-CreateResourceGroup
$childProfileName = getAssetName
$childProfileRelativeName = getAssetName
$anotherChildProfileName = getAssetName
$anotherChildProfileRelativeName = getAssetName
$parentProfileName = getAssetName
$parentProf... |
combined_dataset/train/non-malicious/CenturionPortal.ps1 | CenturionPortal.ps1 | ## New-CodeSigningCert.ps1
########################################################################################################################
## Does the setup needed to self-sign PowerShell scripts ...
## Generates a "test" self-signed root Certificate Authority
## And then generates a code-signing certific... |
combined_dataset/train/non-malicious/sample_41_98.ps1 | sample_41_98.ps1 |
> lint
> eslint . --ext .ts
C:\Users\pfwobcke\.vscode\extensions\vscode-vdf\apps\extension\browser\servers\HUDAnimations\src\server.ts
6:7 error 'server' is assigned a value but never used @typescript-eslint/no-unused-vars
C:\Users\pfwobcke\.vscode\extensions\vscode-vdf\apps\extension\browser\servers\Popfile\s... |
combined_dataset/train/non-malicious/655.ps1 | 655.ps1 |
$reportPortalUri = if ($env:PesterPortalUrl -eq $null) { 'http://localhost/reports' } else { $env:PesterPortalUrl }
$reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl }
function VerifyCatalogItemDoesNotExists()
{
param(
[Parameter(Manda... |
combined_dataset/train/non-malicious/660.ps1 | 660.ps1 |
Function Get-NewSubscription
{
[xml]$matchData = '<?xml version="1.0" encoding="utf-16" standalone="yes"?><ScheduleDefinition xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><StartDateTime xmlns="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/Repo... |
combined_dataset/train/non-malicious/sample_4_11.ps1 | sample_4_11.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/sample_49_70.ps1 | sample_49_70.ps1 | Signature-Version: 1.0
SHA-256-Digest-Manifest-Main-Attributes: VmrRqAIgAm0FCZViZFzpaP8OfDbN4
iY0MyYFuzTMPv8=
SHA-256-Digest-Manifest: m/5bWbHxq24WCSiJ+MsQrmKcgcC88UmXlXezBnDAy7E=
Created-By: 1.8.0_191 (IBM Corporation)
Name: com/q1labs/semsources/sources/jdbc/SourceDatabaseType$3.class
SHA-256-Digest: EYk0agm... |
combined_dataset/train/non-malicious/2475.ps1 | 2475.ps1 |
function ConvertTo-AzureSize
{
[CmdletBinding()]
[OutputType('Selected.Microsoft.Azure.Commands.Compute.Models.PSVirtualMachineSize')]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$VmmHardwareProfile,
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]$AzureLocation = 'WestUS'... |
combined_dataset/train/non-malicious/1179.ps1 | 1179.ps1 |
& (Join-Path -Path $PSScriptRoot 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'Remove-Junction' {
$JunctionPath = $null
$tempDir = Get-Item -Path 'TestDrive:'
function Invoke-RemoveJunction($junction)
{
Remove-Junction $junction
}
BeforeEach {
$Glob... |
combined_dataset/train/non-malicious/3393.ps1 | 3393.ps1 |
function Test-AEMExtensionBasicWindowsWAD
{
$rgname = Get-ComputeTestResourceName
$loc = Get-ComputeVMLocation
try
{
$vm = Create-AdvancedVM -rgname $rgname -loc $loc
$vmname = $vm.Name
$extension = Get-AzureRmVMAEMExtension -ResourceGroupName ... |
combined_dataset/train/non-malicious/3000.ps1 | 3000.ps1 | function Set-ItResult {
[CmdletBinding()]
param(
[Parameter(Mandatory = $false, ParameterSetName = "Inconclusive")][switch]$Inconclusive,
[Parameter(Mandatory = $false, ParameterSetName = "Pending")][switch]$Pending,
[Parameter(Mandatory = $false, ParameterSetName = "Skipped")][swit... |
combined_dataset/train/non-malicious/sample_22_43.ps1 | sample_22_43.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_66_0.ps1 | sample_66_0.ps1 | #
# Module manifest for module 'OCI.PSModules.Operatoraccesscontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Operatoraccesscontrol.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
#... |
combined_dataset/train/non-malicious/2905.ps1 | 2905.ps1 | task default -depends Test
task Test -depends Compile, Clean -PreAction {"Pre-Test"} -PostAction {"Post-Test"}
task Compile -depends Clean {
"Compile"
}
task Clean {
"Clean"
} |
combined_dataset/train/non-malicious/Select-CLSCompliant_1.ps1 | Select-CLSCompliant_1.ps1 | function Select-CLSCompliant {
#.Synopsis
# Outputs the same as "Select-Object *" with basic error handling for properties that are not CLS Compliant
[CmdletBinding()]
param([Parameter(ValueFromPipeline=$true)]$InputObject)
process {
foreach($in in $InputObject) {
$In | Select-Object *
trap ... |
combined_dataset/train/non-malicious/2409.ps1 | 2409.ps1 |
[CmdletBinding()]
[OutputType('Selected.Microsoft.Management.Infrastructure.CimInstance')]
param ()
process {
try {
Get-ScheduledTask | Select-Object TaskName,Author, @{ 'n' = 'CreationDate'; 'e' = { [datetime]$_.Date } }
} catch {
Write-Error "$($_.Exception.Message) - Line Number: $($_.InvocationInfo.ScriptL... |
combined_dataset/train/non-malicious/2674.ps1 | 2674.ps1 |
$cred = Get-Credential -UserName '<User>@<Tenant>.onmicrosoft.com' -Message "Enter SPO credentials"
Connect-SPOService -Url 'https://<Tenant>-admin.sharepoint.com' -Credential $cred
New-SPOSite -Url 'https://<Tenant>.sharepoint.com/sites/pnpdemo' -Title 'Dev Rampup Demo' -Template 'STS
Start-Sleep -Seconds 60
... |
combined_dataset/train/non-malicious/ScheduledTasks.ps1 | ScheduledTasks.ps1 | # Windows Scheduled Tasks Management PowerShell Module
# http://powershell.codeplex.com
Function Get-ScheduledTasks
{
[CmdletBinding()]
param (
[ValidateNotNullOrEmpty()]
[string] $TaskName,
[string] $HostName )
process
{
if ( $HostName ) { $HostName = "/S $HostName" }
$ScheduledTasks = S... |
combined_dataset/train/non-malicious/1128.ps1 | 1128.ps1 |
$CategoryName = 'Carbon-PerformanceCounters'
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Stop-Test
{
Uninstall-PerformanceCounterCategory -CategoryName $CategoryName
Assert-False (Test-PerformanceCounterCategory -... |
combined_dataset/train/non-malicious/Out-AnsiGraph_1.ps1 | Out-AnsiGraph_1.ps1 | #
# Out-AnsiGraph.psm1
# Author: xcud
# History:
# v0.1 September 21, 2009 initial version
#
function Out-AnsiGraph($Parameter1=$null) {
BEGIN {
$q = new-object Collections.queue
}
PROCESS {
if($_) {
$name = $_.($Parameter1[0]);
$val = $_.($Parameter1[1])
if($max -lt $val) { ... |
combined_dataset/train/non-malicious/LibrarySqlData.ps1 | LibrarySqlData.ps1 | #######################
function Get-SqlData
{
param([string]$serverName=$(throw 'serverName is required.'), [string]$databaseName=$(throw 'databaseName is required.'),
[string]$query=$(throw 'query is required.'))
Write-Verbose "Get-SqlData serverName:$serverName databaseName:$databaseName que... |
combined_dataset/train/non-malicious/2781.ps1 | 2781.ps1 |
[CmdletBinding()]
Param ([Parameter(Mandatory)] [string[]] $memstream = $(Throw("-memstream is required")),
[Parameter(Mandatory)] [string[]] $outputloc = $(Throw("-outputloc is required"))
)
function Get-DecompressedByteArray {
[CmdletBinding()] Param ([Parameter(ValueFromPipeline,ValueFromPipelineBy... |
combined_dataset/train/non-malicious/fc6a6ed7-a2a0-4a41-af75-9b06c4fba5de.ps1 | fc6a6ed7-a2a0-4a41-af75-9b06c4fba5de.ps1 | #========================================================================
# Code Generated By: SAPIEN Technologies, Inc., PowerShell Studio 2012 v3.1.15
# Generated On: 2/6/2013 2:58 AM
# Generated By: Manoj Nair
# Organization: Self
#========================================================================
#-----... |
combined_dataset/train/non-malicious/sample_48_84.ps1 | sample_48_84.ps1 | # Disable CI triggers, only called using Maestro
trigger: none
variables:
- group: Mirror-Credentials
- template: /eng/common/templates/variables/pool-providers.yml
# Moves code from GitHub into internal repos
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableTelemetry: true
helixR... |
combined_dataset/train/non-malicious/sample_40_92.ps1 | sample_40_92.ps1 | #Enforcing default PSModulePath to avoid getting unexpected modules to run instead of built-in modules
Get-Module | ForEach-Object { Remove-Module -Name $_.Name -Force }
$PSModuleAutoloadingPreference = 'none'
Import-Module Microsoft.PowerShell.Utility
$env:PSModulePath = "C:\Program Files\WindowsPowerShell\Modules... |
combined_dataset/train/non-malicious/sample_64_83.ps1 | sample_64_83.ps1 | #
# Module manifest for module 'OCI.PSModules.Objectstorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Objectstorage.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/Check e-mail access type.ps1 | Check e-mail access type.ps1 | $ErrorActionPreference = "silentlycontinue"
$login = read-host -prompt "Type the user login"
$Status = @( Get-ADuser $login | select SamAccountName).count
If($Status -eq 0) {
Write-Host No such user exists! -FOREGROUNDCOLOR RED
./the_script_name.ps1
} Else {Write-Host Working on it! -FOREGROUNDCOLOR ... |
combined_dataset/train/non-malicious/sample_42_30.ps1 | sample_42_30.ps1 | #
# Module manifest for module 'OCI.PSModules.Osmanagementhub'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osmanagementhub.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported P... |
combined_dataset/train/non-malicious/3435.ps1 | 3435.ps1 |
param (
[Parameter(Mandatory = $true)]
[string] $spPassword,
[string] $modulesDir = '',
[bool] $createPackages = $true,
[bool] $uploadPackages = $true,
[bool] $processRunbooks = $true,
[bool] $waitForResults = $true
)
. "$PSScriptRoot\Man... |
combined_dataset/train/non-malicious/Firefox Bookmarks By Key.ps1 | Firefox Bookmarks By Key.ps1 | if (!( gmo ShowUI)) {ipmo showui}
if(!(Get-Command DataGrid -ErrorAction SilentlyContinue)) {
Add-UIFunction -Type System.Windows.Controls.DataGrid
}
if(!(Get-Command DataGridTextColumn -ErrorAction SilentlyContinue)) {
Add-UIFunction -Type System.Windows.Controls.DataGridTextColumn
}
if(!(Get-Com... |
combined_dataset/train/non-malicious/370.ps1 | 370.ps1 | function Get-PSFLocalizedString
{
[OutputType([PSFramework.Localization.LocalStrings], ParameterSetName = 'Default')]
[OutputType([System.String], ParameterSetName = 'Name')]
[CmdletBinding(DefaultParameterSetName = 'Default')]
param (
[Parameter(Mandatory = $true, ParameterSetName = 'Name')]
[Parameter(Mandat... |
combined_dataset/train/non-malicious/sample_8_17.ps1 | sample_8_17.ps1 | ConvertFrom-StringData @'
id_descriptors=Collecting Windows Update service descriptors
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC0vOKl... |
combined_dataset/train/non-malicious/sample_25_95.ps1 | sample_25_95.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 = '83.2.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/PowerOAuth Beta 2.ps1 | PowerOAuth Beta 2.ps1 | if(@(Import-ConstructorFunctions -Path "$PSScriptRoot\\Types_Generated").Count -lt 3) {
Add-ConstructorFunction -T Hammock.Authentication.OAuth.OAuthCredentials, Hammock.RestClient, Hammock.RestRequest -Path "$PSScriptRoot\\Types_Generated"
}
$RequestToken = "request_token"
$AccessToken = "access_token"
$Auth... |
combined_dataset/train/non-malicious/New-RDP.ps1 | New-RDP.ps1 | ########################################################################################################################
# NAME
# New-RDP
#
# SYNOPSIS
# Creates a new RDP file to store Remote Desktop connection settings.
#
# SYNTAX
# Start-RDP [-Path] <string> [[-Server] <string>] [-PassThru] [-Forc... |
combined_dataset/train/non-malicious/6bdd2502-383e-47c0-9f8c-f6424b6ba672.ps1 | 6bdd2502-383e-47c0-9f8c-f6424b6ba672.ps1 | # Connect-VIServer <vCenter server>
# Uncomment the next line to test this script
# $WhatIfPreference = $true
if (-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) {
Add-PSSnapin VMware.VimAutomation.Core
}
if (-not (Get-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyCont... |
combined_dataset/train/non-malicious/sample_22_84.ps1 | sample_22_84.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Automanage.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Automanage.internal.psm1'
if(Test-Path $internalModulePath) {
... |
combined_dataset/train/non-malicious/Get-FileEncoding_5.ps1 | Get-FileEncoding_5.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/LibraryMSCS_4.ps1 | LibraryMSCS_4.ps1 |
# ------------------------------------------------------------------------
### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### Defines functions for working with Microsoft Cluster Service (MSCS)
### Updated 8/3/2011
### Added Authentication PacketPrivacy to fix Access Denied errorso... |
combined_dataset/train/non-malicious/Invoke-ExecuteTSQL .ps1 | Invoke-ExecuteTSQL .ps1 | #######################
<#
.SYNOPSIS
Execute T-SQL Statments and return messages from SQL Server (print).
.DESCRIPTION
Execute T-SQL Statments and return messages from SQL Server (print).
.INPUTS
None
You cannot pipe objects to Invoke-ExecuteTSQL
.OUTPUTS
PSObject :
Boolean Exitcode = $True or $False in... |
combined_dataset/train/non-malicious/4394.ps1 | 4394.ps1 | function New-SoftwareIdentityFromPSGetItemInfo
{
param
(
[Parameter(Mandatory=$true)]
$PSGetItemInfo
)
$SourceLocation = $psgetItemInfo.RepositorySourceLocation
if(Get-Member -InputObject $PSGetItemInfo -Name $script:PSArtifactType)
{
$artifactType = $psgetItemInfo.Type... |
combined_dataset/train/non-malicious/sample_33_67.ps1 | sample_33_67.ps1 | import{m as s}from"./index.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/m... |
combined_dataset/train/non-malicious/sample_7_65.ps1 | sample_7_65.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 "$($_.InvocationInfo... |
combined_dataset/train/non-malicious/sample_60_20.ps1 | sample_60_20.ps1 | #
# Module manifest for module 'OCI.PSModules.Loganalytics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loganalytics.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/167.ps1 | 167.ps1 | function Test-DatePattern
{
$patterns = "d","D","g","G","f","F","m","o","r","s", "t","T","u","U","Y","dd","MM","yyyy","yy","hh","mm","ss","yyyyMMdd","yyyyMMddhhmm","yyyyMMddhhmmss"
Write-host "It is now $(Get-Date)" -ForegroundColor Green
foreach ($pattern in $patterns) {
[pscustomobject]@{
Pattern = $pattern
Sy... |
combined_dataset/train/non-malicious/Get-Credential 2.6.ps1 | Get-Credential 2.6.ps1 | ## Get-Credential
## An improvement over the default cmdlet which has no options ...
###################################################################################################
## History
## v 2.6 Put back support for passing in the domain when getting credentials without prompting
## v 2.5 Added examples... |
combined_dataset/train/non-malicious/sample_4_7.ps1 | sample_4_7.ps1 | ConvertFrom-StringData @'
id_ex_exbpacmdact=Exchange Support Tool - ExBPA
id_ex_exbpacmdstat=Running Exchange Best Practices Analyzer (ExBPA), please wait...
id_ex_exbpacmdfiledescription=ExBPA Health Check
id_ex_exbpacmdreportsection=Exchange Toolbox
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIo... |
combined_dataset/train/non-malicious/3834.ps1 | 3834.ps1 |
function Get-SubscriptionID
{
$context = Get-AzContext
return $context.Subscription.SubscriptionId
}
function Get-ResourceGroupName
{
return "RGName-" + (getAssetName)
}
function New-ResourceGroup($ResourceGroupName, $Location)
{
Write-Debug "Creating resource group name $ResourceGrou... |
combined_dataset/train/non-malicious/sample_60_92.ps1 | sample_60_92.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/http___bestfreeipadgames.ps1 | http___bestfreeipadgames.ps1 | A man is not old as long as he is seeking something. A man is not old until regrets take the place of dreams.
-----------------------------------
|
combined_dataset/train/non-malicious/sample_43_6.ps1 | sample_43_6.ps1 | #
# Module manifest for module 'OCI.PSModules.Logging'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Logging.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_28_18.ps1 | sample_28_18.ps1 | =์ฐ๊ฒฐํ ์ ์์ต๋๋ค. ์บ์๋ ์๊ฒฉ ์ฆ๋ช
์ด ๋ง๋ฃ๋์๊ฑฐ๋ ์ํธ๊ฐ ์
๋ฐ์ดํธ๋์์ต๋๋ค. ์๊ฒฉ ์ฆ๋ช
์ ๋ค์ ์
๋ ฅํ์ธ์.1PowerBI ํ๊ฒฝ์ ๊ฒ์ํ๋ ๋์ URL '%{strURL/}'์ ์ฐ๊ฒฐํ์ง ๋ชปํ์ต๋๋ค.-์๋ชป๋ ์๋ต ํ์์ผ๋ก ์ธํด PowerBI ๋ฐฑ ์๋ ์๋ํฌ์ธํธ ๊ฒ์์ด ์คํจํ์ต๋๋ค.CertGetNameStringW๋ฅผ ํธ์ถํ์ง ๋ชปํ์ต๋๋ค.์ธ์ฆ์ ์ฒด์ธ์ ์ ํจ์ฑ์ ๊ฒ์ฌํ์ง ๋ชปํ์ต๋๋ค.-์ง๋ฌธ์ด '%{strThumbprint/}'์ธ ์ธ์ฆ์ ๋ฐ๊ธ์๋ฅผ ์ ๋ขฐํ ์ ์์ต๋๋ค.d์ด ์๋ฒ ์ธ์คํด์ค๋ SChannel ์ธ์ฆ์(ServerSchannelTokenSignerCert)๊ฐ ์ค์ ... |
combined_dataset/train/non-malicious/sample_8_89.ps1 | sample_8_89.ps1 | #************************************************
# TS_ADReplCheck.ps1
# Version 1.0.2
# Date: 03-23-2011
# Author: Craig Landis - clandis@microsoft.com
# Description: This script detects and report AD Replication problems
#************************************************
Function GetFailedReplicationStat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.