full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/LibrarySqlBackup_1.ps1
LibrarySqlBackup_1.ps1
# --------------------------------------------------------------------------- ### From the Apress book "Pro Windows PowerShell" p. 164 I found the following trap handler that will get to the InnerException.Message # --------------------------------------------------------------------------- trap { $exceptionty...
combined_dataset/train/non-malicious/Get-WebFile 4.1.ps1
Get-WebFile 4.1.ps1
function ConvertTo-Dictionary { param( [Parameter(Mandatory=$true,ValueFromPipeline=$true,ParameterSetName="Hashtable")] [Hashtable[]]$Hashtable, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName="WebHeaders")] [System.Collections.Specialized.Na...
combined_dataset/train/non-malicious/sample_57_52.ps1
sample_57_52.ps1
"use strict";(self.webpackChunk_fta_workstation_web=self.webpackChunk_fta_workstation_web||[]).push([[7889],{27889:function(m,e,t){t.r(e),t.d(e,{default:function(){return r}});var n=t(95336),a=t(1295);const i=Object.freeze({displayName:"HTML",injections:{"R:text.html - (comment.block, text.html meta.embedded, meta.tag....
combined_dataset/train/non-malicious/Get-LocalGroups.ps1
Get-LocalGroups.ps1
function Add-NoteProperty { <# .Synopsis Adds a NoteProperty member to an object. .Description This function makes adding a property a lot easier than Add-Member, assuming you want to add a NoteProperty, which I find is true about 90% of the time. .Parameter object The object to add the property to. ...
combined_dataset/train/non-malicious/sample_4_50.ps1
sample_4_50.ps1
#************************************************ #Last Updated Date: 05-24-2012 #Updated By: Alec Yao v-alyao@microsoft.com #Description: Add two arguments for the script, called $Prefix and $Suffix. It will allow to custermize the filename #************************************************ PARAM ($NFO = $true...
combined_dataset/train/non-malicious/2287.ps1
2287.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Name of the Azure AD application to be created.")] [ValidateNotNullOrEmpty()] [string]$AppDisplayName, [parameter(Mandatory=$true, HelpMessage="Name of a Resource Group in Azure that the OMS workspace used for...
combined_dataset/train/non-malicious/274.ps1
274.ps1
function New-Password { [CmdletBinding()] PARAM ( [ValidateNotNull()] [int]$Length = 12, [ValidateRange(1,256)] [Int]$Count = 1 ) BEGIN { $PasswordCharCodes = { 33..126 }.invoke() 34, 39, 46, 47, 49, 60, 62, 96, 48, 79, 108, 124 | ForEach-Object { [void]$Passwor...
combined_dataset/train/non-malicious/sample_35_1.ps1
sample_35_1.ps1
# # Module manifest for module 'OCI.PSModules.Aianomalydetection' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aianomalydetection.dll' # Version number of this module. ModuleVersion = '83.2.0' # Suppo...
combined_dataset/train/non-malicious/Binary Clock.ps1
Binary Clock.ps1
<# .SYNOPSIS This is a binary clock that lists the time in hours, minutes and seconds .DESCRIPTION This is a binary clock that lists the time in hours, minutes and seconds. Also available is the ability to display the time in a "human readable" format, display the date and display a helper displ...
combined_dataset/train/non-malicious/1738.ps1
1738.ps1
param( [Parameter(HelpMessage='ReleaseTag from the job. Set to "fromBranch" or $null to update using the branch name')] [string]$ReleaseTag, [Parameter(HelpMessage='The branch name used to update the release tag.')] [string]$Branch=$env:BUILD_SOURCEBRANCH, [Parameter(HelpMessage='The variable nam...
combined_dataset/train/non-malicious/2145.ps1
2145.ps1
Describe 'Automatic variable $input' -Tags "CI" { It '$input Type should be enumerator' -Skip { function from_begin { [cmdletbinding()]param() begin { Write-Output -NoEnumerate $input } } function from_process { [cmdletbinding()]param() process { Write-Output -NoEnumerate $input } } ...
combined_dataset/train/non-malicious/1331.ps1
1331.ps1
function Get-IdentityPrincipalContext { [CmdletBinding()] [OutputType([DirectoryServices.AccountManagement.PrincipalContext])] param( [Parameter(Mandatory=$true)] [Carbon.Identity] $Identity ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $...
combined_dataset/train/non-malicious/2270.ps1
2270.ps1
function Load-Form { $Form.Controls.Add($TabControl) $TabControl.Controls.AddRange(@( $TabPageGeneral, $TabPageCAS, $TabPagePrimary, $TabPageSecondary, $TabPageSiteRoles, $TabPageOther )) $TabPageGeneral.Controls.AddRange(@( $OutputBox...
combined_dataset/train/non-malicious/Split-String_1.ps1
Split-String_1.ps1
function Split-String { #.Synopsis # Split a string and execute a scriptblock to give access to the pieces #.Description # Splits a string (by default, on whitespace), and assigns it to $0, and the first 9 words to $1 through $9 ... and then calls the specified scriptblock #.Example # echo "this is one test ff...
combined_dataset/train/non-malicious/2712.ps1
2712.ps1
Param( [Parameter(Mandatory=$False,Position=0)] [string]$BasePath="C:\inetpub\wwwroot", [Parameter(Mandatory=$False,Position=1)] [string]$extRegex="\..*$", [Parameter(Mandatory=$False,Position=2)] [long]$MinB=0, [Parameter(Mandatory=$False,Position=3)] [long]$MaxB=28147...
combined_dataset/train/non-malicious/sample_36_4.ps1
sample_36_4.ps1
ConvertFrom-StringData @' IPAddressDisplayNameFormat=Alamat IP: {0} NetworkNameDisplayNameFormat=Nama: {0} NetworkNameOfflineDisplayNameFormat=Alamat IP: Alamat pada "{0}" CreateClusterProgressValidationStart=Memvalidasi kesesuaian server untuk kluster failover. CreateClusterProgressValidationEnd=Selesai memvalida...
combined_dataset/train/non-malicious/sample_51_82.ps1
sample_51_82.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/433.ps1
433.ps1
Register-PSFTeppScriptblock -Name "PSFramework-config-name" -ScriptBlock { $moduleName = "*" if ($fakeBoundParameter.Module) { $moduleName = $fakeBoundParameter.Module } [PSFramework.Configuration.ConfigurationHost]::Configurations.Values | Where-Object { -not $_.Hidden -and ($_.Module -like $moduleName) } | Select-...
combined_dataset/train/non-malicious/3974.ps1
3974.ps1
function Test-AzureFirewallCRUD { $rgname = Get-ResourceGroupName $azureFirewallName = Get-ResourceName $resourceTypeParent = "Microsoft.Network/AzureFirewalls" $location = Get-ProviderLocation $resourceTypeParent "eastus2euap" $vnetName = Get-ResourceName $subnetName = "Azu...
combined_dataset/train/non-malicious/Highlight syntax.ps1
Highlight syntax.ps1
#code which need highlight $code = @' #just example Get-Process | % { try { "{0, 7} {1}" -f $_.Id, $_.MainModule.ModuleName } catch [System.ComponentModel.Win32Exception] {} } '@ function frmMain_Show { Add-Type -AssemblyName System.Windows.Forms [Windows.Forms.Application]::EnableVisualStyl...
combined_dataset/train/non-malicious/4101.ps1
4101.ps1
Set-Variable -Name RelativePath -Scope Global -Force Set-Variable -Name Title -Scope Global -Force Function InitializeVariables { $Global:RelativePath = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent) + "\" $Global:Title = "SCCM 2012 R2 Client" } Function Install-EXE { ...
combined_dataset/train/non-malicious/sample_53_57.ps1
sample_53_57.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 = '83.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/512.ps1
512.ps1
function Get-ActiveDirectoryUserGroups{ param( [parameter(Mandatory=$true)] [string[]]$Users ) Import-Module Quest.ActiveRoles.ArsPowerShellSnapIn function New-ObjectADUserGroup{ param( $UserName, $UserDN, $UserSamAccountName, $GroupName, $GroupDN, $G...
combined_dataset/train/non-malicious/sample_37_66.ps1
sample_37_66.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 = '80.0.0' # Supported P...
combined_dataset/train/non-malicious/2213.ps1
2213.ps1
鬠ソ [CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, ParameterSetName="CIID", HelpMessage="Site server name with SMS Provider installed")] [parameter(ParameterSetName="CIUniqueID")] [ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})] [ValidateNotNullorEmpty...
combined_dataset/train/non-malicious/4297.ps1
4297.ps1
. "$PSScriptRoot\PSGetTests.Manifests.ps1" . "$PSScriptRoot\PSGetTests.Generators.ps1" function SuiteSetup { Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue $script:ProgramFilesModulesPath = Ge...
combined_dataset/train/non-malicious/3338.ps1
3338.ps1
function Remove-Group { [PoshBot.BotCommand( Aliases = ('rg', 'removegroup'), Permissions = 'manage-groups' )] [cmdletbinding()] param( [parameter(Mandatory)] $Bot, [parameter(Mandatory, Position = 0)] [string[]]$Name ) $removed = @() $...
combined_dataset/train/non-malicious/sample_41_17.ps1
sample_41_17.ps1
# # Module manifest for module 'OCI.PSModules.Opensearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opensearch.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_41_20.ps1
sample_41_20.ps1
# Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString = &Yes PromptNoString = &No BundleFound = Found bundle: {0} PackageFound = Found package: {0} EncryptedBundleFound = Found encrypted bundle: {0} EncryptedPackageFound = Found encrypted package: {0} CertificateFou...
combined_dataset/train/non-malicious/IADsDNWithBinary Cmdlet_1.ps1
IADsDNWithBinary Cmdlet_1.ps1
//Adapted from code @ http://mow001.blogspot.com/2006/01/msh-snap-in-to-translate.html Thanks! using System; using System.ComponentModel; using System.Management.Automation; using System.Reflection; using System.Diagnostics; namespace space { // This class defines the properties of a snap-in [Ru...
combined_dataset/train/non-malicious/sample_44_45.ps1
sample_44_45.ps1
<# .SYNOPSIS NewSelfSignedCertificate.ps1 script file This is a place-holder file only for agent patch build purposes #> Write-Host "This file functionality is deprecated and is place-holder only" # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # ...
combined_dataset/train/non-malicious/sample_58_69.ps1
sample_58_69.ps1
# # Module manifest for module 'OCI.PSModules.Desktops' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Desktops.dll' # Version number of this module. ModuleVersion = '85.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/Colorize Subversion SVN_2.ps1
Colorize Subversion SVN_2.ps1
#draw output function drawlines($colors, $lines) { foreach ($line in $lines) { $color = $colors[[string]$line[0]] if ($color) { write-host $line -Fore $color } else { write-host $line } } } # svn stat function ss { drawlines @{ "A"="Magenta"; "D"="Red"; "C"="Yellow"; "G"="Blue"; "M"="Cya...
combined_dataset/train/non-malicious/sample_56_1.ps1
sample_56_1.ps1
# # Module manifest for module 'OCI.PSModules.Streaming' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Streaming.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/2803.ps1
2803.ps1
if (Get-Command logparser.exe) { $lpquery = @" SELECT COUNT(Account) as ct, Account FROM *LocalAdmins.tsv GROUP BY Account ORDER BY ct ASC "@ & logparser -stats:off -i:csv -dtlines:0 -fixedsep:on -rtp:-1 "$lpquery" } else { $ScriptName = [System.I...
combined_dataset/train/non-malicious/3102.ps1
3102.ps1
param( [Parameter(Mandatory=$true)] [ValidateScript({ Test-Path $_ })] [string]$sourceFolder ) $savedProgressPreference = $global:ProgressPreference $global:ProgressPreference = 'SilentlyContinue' $tempDir = [System.IO.Path]::GetTempPath() $panDocVersion = "2.7.3" $pandocSourceURL = "https://github....
combined_dataset/train/non-malicious/WriteFileName_4.ps1
WriteFileName_4.ps1
# functions to print overwriting multi-line messages. Test script will accept a file/filespec/dir and iterate through all files in all subdirs printing a test message + file name to demostrate. # e.g. PS>.\\writefilename.ps1 c:\\ # call WriteFileName [string] # after done writing series of overwriting messages, cal...
combined_dataset/train/non-malicious/2007.ps1
2007.ps1
param([switch]$useModule, [string]$VHDPath) function CreateVHD ($VHDPath, $Size) { $drive = (New-VHD -path $vhdpath -SizeBytes $size -Dynamic | ` Mount-VHD -Passthru | ` get-disk -number {$_.DiskNumber} | ` Initialize-Disk -PartitionStyle MBR -PassThru | ` ...
combined_dataset/train/non-malicious/sample_35_7.ps1
sample_35_7.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_45_28.ps1
sample_45_28.ps1
function PSConsoleHostReadLine { [System.Diagnostics.DebuggerHidden()] param() ## Get the execution status of the last accepted user input. ## This needs to be done as the first thing because any script run will flush $?. $lastRunStatus = $? Microsoft.PowerShell.Core\Set-StrictMode -Off...
combined_dataset/train/non-malicious/sample_6_91.ps1
sample_6_91.ps1
#************************************************ # DC_RDSRDWeb.ps1 # Version 1.0.1 # Date: 21-01-2012 # Author: Daniel Grund - dgrund@microsoft.com # Description: # This script gets the IIS config # 1.0.0 Beta release # 1.0.1 Release # TODO get windows\web\rdweb dir #****************************************...
combined_dataset/train/non-malicious/3308.ps1
3308.ps1
function New-PoshBotConfiguration { [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope='Function', Target='*')] [cmdletbinding()] param( [string]$Name = 'PoshBot', [string]$ConfigurationDirectory = $script:defaultPoshBotDir, ...
combined_dataset/train/non-malicious/sample_35_36.ps1
sample_35_36.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("embedMedia", "bool", true); } else { command.get...
combined_dataset/train/non-malicious/sample_34_0.ps1
sample_34_0.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ScheduledQueryRule.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module]::Instance # Export nothin...
combined_dataset/train/non-malicious/sample_20_60.ps1
sample_20_60.ps1
# Web Deploy: Powershell script to set up delegated deployments with Web Deploy # Copyright (C) Microsoft Corp. 2010 # # Requirements: IIS 7, Windows Server 2008 (or higher) # # elevatedUsername/elevatedPassword: Credentials of a user that has write access to applicationHost.config. Used for createApp, appPoolNetF...
combined_dataset/train/non-malicious/sample_4_97.ps1
sample_4_97.ps1
}'%{oii_IMBITableName/}' 테이블의 '%{oii_IMBIColumnName/}' 열에 빈 값이 포함되어 있습니다. 다 대 일 관계의 한 쪽에 있는 열 또는 테이블의 기본 키로 사용되는 열에 허용되지 않습니다.c기본 델타 테이블 '%{oii_deltaTableName/}'의 데이터가 변경되었으므로 테이블이 쿼리 가능한 상태가 아닙니다. 변경 내용을 검토하고 데이터 세트를 새로 고치세요.IJDirect Lake 테이블 열 '%{oii_tableName/}'['%{oii_columnName/}'], 기본 parquet 논리 형식 '%{logicalType/...
combined_dataset/train/non-malicious/sample_67_81.ps1
sample_67_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.apa...
combined_dataset/train/non-malicious/sample_41_79.ps1
sample_41_79.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_59_19.ps1
sample_59_19.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/Make a phone call_4.ps1
Make a phone call_4.ps1
<# .NOTES AUTHOR: Sunny Chakraborty(sunnyc7@gmail.com) WEBSITE: http://tekout.wordpress.com VERSION: 0.1 CREATED: 17th April, 2012 LASTEDIT: 17th April, 2012 Requires: PowerShell v2 or better .CHANGELOG 4/17/2012 Try passing powershell objects to PROTO API and pass the variables to .JS file P...
combined_dataset/train/non-malicious/342.ps1
342.ps1
function Unregister-PSFConfig { [CmdletBinding(DefaultParameterSetName = 'Pipeline', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Unregister-PSFConfig')] param ( [Parameter(ValueFromPipeline = $true, ParameterSetName = 'Pipeline')] [PSFramework.Configuration.Config[]] $ConfigurationIte...
combined_dataset/train/non-malicious/Invoke-AdvancedFunction..ps1
Invoke-AdvancedFunction..ps1
param(\n [Parameter(Mandatory = $true)]\n [ScriptBlock] $Scriptblock\n )\n\n## Invoke the scriptblock supplied by the user.\n& $scriptblock
combined_dataset/train/non-malicious/sample_49_37.ps1
sample_49_37.ps1
@{ GUID="c61d6278-02a3-4618-ae37-a524d40a7f44 " Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" ModuleToProcess="PSDiagnostics.psm1" Func...
combined_dataset/train/non-malicious/sample_31_53.ps1
sample_31_53.ps1
<# .Synopsis Activate a Python virtual environment for the current PowerShell session. .Description Pushes the python executable for a virtual environment to the front of the $Env:PATH environment variable and sets the prompt to signify that you are in a Python virtual environment. Makes use of the command line...
combined_dataset/train/non-malicious/4197.ps1
4197.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()][string]$Country = 'en-us', [ValidateNotNullOrEmpty()][boolean]$EmailLogs = $true, [string]$EmailRecipients, [string]$EmailSender, [ValidateNotNullOrEmpty()][string]$ExclusionFileName = 'ExclusionList.txt', [ValidateNotNullOrEmpty()][string]$LogFileName =...
combined_dataset/train/non-malicious/UCS-ServiceProf-fromList.ps1
UCS-ServiceProf-fromList.ps1
<# ==================================================================== Author(s): Josh Atwell <josh.c.atwell@gmail.com> Link: www.vtesseract.com File: Get-UCSServiceProfileAssociations-FromList.ps1 Purpose: Gets Service Profile Associations for all UCS clusters provided in a list. If you want to v...
combined_dataset/train/non-malicious/Use-Culture.ps1
Use-Culture.ps1
#############################################################################\n##\n## Use-Culture\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n#############################################################################\n\n<#\n\n.SYNOPSIS\n\nInvoke a scrip...
combined_dataset/train/non-malicious/3856.ps1
3856.ps1
function Test-GetPeeringServiceProviders { $name = "TestPeer1" $provider = Get-AzPeeringServiceProvider Assert-NotNull $provider Assert-AreEqual $name $provider[0].ServiceProviderName } function Test-GetPeeringServiceLocations { $locations = Get-AzPeeringServiceLocation -Country...
combined_dataset/train/non-malicious/533.ps1
533.ps1
function Install-SPOSolution { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string]$solutionName ) Write-Host "Activate solution $path" -foregroundcolor black -backgroundcolor yellow Switch-SPOEnableDisableSolution -solutionName $solutionName -activate $true Write-Host "Solu...
combined_dataset/train/non-malicious/sample_35_11.ps1
sample_35_11.ps1
# # Script module for module 'PSScriptAnalyzer' # Set-StrictMode -Version Latest # Set up some helper variables to make it easier to work with the module $PSModule = $ExecutionContext.SessionState.Module $PSModuleRoot = $PSModule.ModuleBase # Import the appropriate nested binary module based on the current PowerShell...
combined_dataset/train/non-malicious/Get Twitter RSS Feed_1.ps1
Get Twitter RSS Feed_1.ps1
param ([String] $ScreenName) $client = New-Object System.Net.WebClient $idUrl = "https://api.twitter.com/1/users/show.json?screen_name=$ScreenName" $data = $client.DownloadString($idUrl) $start = 0 $findStr = '"id":' do { $start = $data.IndexOf($findStr, $start + 1) if ($start -gt 0) { $s...
combined_dataset/train/non-malicious/252.ps1
252.ps1
function Remove-SCCMUserDeviceAffinity { [CmdletBinding(DefaultParameterSetName = 'ResourceName')] param ( [Parameter(ParameterSetName = 'ResourceName')] [Parameter(ParameterSetName = 'ResourceID')] $SiteCode, [Parameter(ParameterSetName = 'ResourceName', ...
combined_dataset/train/non-malicious/sample_33_95.ps1
sample_33_95.ps1
# # Module manifest for module 'OCI.PSModules.Disasterrecovery' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Disasterrecovery.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported...
combined_dataset/train/non-malicious/09af4d5a-52a6-4d61-89dd-7b9016c3d1d7.ps1
09af4d5a-52a6-4d61-89dd-7b9016c3d1d7.ps1
<%@ Page language="c#" AutoEventWireup="true" Debug="true" %> <%@ Import Namespace="System" %> <%@ Import Namespace="System.IO" %> <%@ Import Namespace="System.Management.Automation.Runspaces" %> <%@ Import Namespace="System.Management.Automation" %> <%@ Import Namespace="System.Collections.ObjectModel" %> <s...
combined_dataset/train/non-malicious/190.ps1
190.ps1
function Get-SCSMIncidentRequestComment { PARAM ( [Parameter(ParameterSetName = 'General', Mandatory = $true)] $DateTime = $((Get-Date).AddHours(-24)), [Parameter(ParameterSetName = 'GUID')] $GUID ) BEGIN { $AssignedUserClassRelation = Ge...
combined_dataset/train/non-malicious/2730.ps1
2730.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 Syste...
combined_dataset/train/non-malicious/758.ps1
758.ps1
$params = @{ HtmlBodyContent = "Testing JavaScript and CSS paths..." JavaScriptPaths = ".\Assets\script.js" StyleSheetPaths = ".\Assets\style.css" } $view = New-VSCodeHtmlContentView -Title "Test View" -ShowInColumn Two Set-VSCodeHtmlContentView -View $view @params
combined_dataset/train/non-malicious/sample_20_58.ps1
sample_20_58.ps1
######################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # Connection Tools # #Requires -Version 4.0 # ######################################################################################### add-type @" us...
combined_dataset/train/non-malicious/sample_48_63.ps1
sample_48_63.ps1
# # Module manifest for module 'OCI.PSModules.Autoscaling' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Autoscaling.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_8_43.ps1
sample_8_43.ps1
#************************************************ # DC_DhcpClient-Component.ps1 # Version 1.0 # Date: 2009 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about DHCP Client. # Called from: Main Networking Diag #******************************************************* Trap [Exc...
combined_dataset/train/non-malicious/3738.ps1
3738.ps1
function Test-NewAzureRmMapsAccount { $rgname = Get-MapsManagementTestResourceName; try { $accountname = 'ps-' + $rgname; $skuname = 'S0'; $location = 'West US'; New-AzResourceGroup -Name $rgname -Location $location; $createdAccount = Ne...
combined_dataset/train/non-malicious/sample_17_28.ps1
sample_17_28.ps1
# # Module manifest for module 'OCI.PSModules.Servicemanagerproxy' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemanagerproxy.dll' # Version number of this module. ModuleVersion = '81.0.0' # Sup...
combined_dataset/train/non-malicious/sample_10_21.ps1
sample_10_21.ps1
# Source: https://github.com/edbarnes-msft/DrDAV/blob/master/Test_MsDavConnection.ps1 <# Script name: tss_MSDavConnection.ps1 Purpose: - check WebDAV/WebClient related settings and connectivity #> param( [Parameter(Mandatory=$False,Position=0,HelpMessage='Choose a writable output folder location, i.e. C:\Temp\ ...
combined_dataset/train/non-malicious/3263.ps1
3263.ps1
class Connection : BaseLogger { [ConnectionConfig]$Config [ConnectionStatus]$Status = [ConnectionStatus]::Disconnected [void]Connect() {} [void]Disconnect() {} }
combined_dataset/train/non-malicious/sample_50_9.ps1
sample_50_9.ps1
param( # Folder access path for mounted drive. [string] [parameter(Mandatory=$true)] $AccessPath, # When a folder is this percent full cleanup will be initiated. [int] [Parameter(Mandatory=$true)] $CleanupThresholdPercent, # When cleanup occurs files will be pruned unt...
combined_dataset/train/non-malicious/792.ps1
792.ps1
[CmdletBinding(DefaultParameterSetName="NamedPipe")] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $HostName, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $HostProfileId, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] ...
combined_dataset/train/non-malicious/sample_46_51.ps1
sample_46_51.ps1
# # Module manifest for module 'OCI.PSModules.Vbsinst' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Vbsinst.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/JSON _1.5.ps1
JSON _1.5.ps1
#requires -version 2.0 # Version History: # v 0.5 - First Public version # v 1.0 - Made ConvertFrom-Json work with arbitrary JSON # - switched to xsl style sheets for ConvertTo-JSON # v 1.1 - Changed ConvertFrom-Json to handle single item results # v 1.2 - CodeSigned to make a fellow geek happy # v 1.3 - ...
combined_dataset/train/non-malicious/1897.ps1
1897.ps1
Describe "Write-Progress DRT Unit Tests" -Tags "CI" { It "Should be able to throw exception when missing mandatory parameters" { { Write-Progress $null } | Should -Throw -ErrorId 'ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.WriteProgressCommand' } It "Should be ab...
combined_dataset/train/non-malicious/636.ps1
636.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "http://switch.dl.sourceforge.net/project/sevenzip/7-Zip/9.20/7z920-x64.msi","http://downloads.sourceforge.net/sevenzip/7za920.zip" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Pare...
combined_dataset/train/non-malicious/sample_24_9.ps1
sample_24_9.ps1
function PSConsoleHostReadLine { Microsoft.PowerShell.Core\Set-StrictMode -Off [Microsoft.PowerShell.PSConsoleReadLine]::ReadLine($host.Runspace, $ExecutionContext) } # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE...
combined_dataset/train/non-malicious/sample_48_24.ps1
sample_48_24.ps1
parameters: - name: PAT type: string - name: isPreRelease type: string - name: ghCreateRelease type: boolean - name: ghReleaseAddChangeLog type: boolean steps: - pwsh: | $vsixFileName = (Get-ChildItem -File | Select-Object -First 1).Name Write-Host "##vso[task.setvari...
combined_dataset/train/non-malicious/sample_16_72.ps1
sample_16_72.ps1
<# .SYNOPSIS Finds or generates a valid certificate for the given VM on the host and installs that certificate as the TLS signing certificate on the guest. .PARAMETER Session Passed in Remote session object that can be generated from Local-Create-Remote-Session.ps1 .PARAMETER VmName The name ...
combined_dataset/train/non-malicious/1817.ps1
1817.ps1
Describe "Start-Process" -Tag "Feature","RequireAdminOnWindows" { BeforeAll { $isNanoServer = [System.Management.Automation.Platform]::IsNanoServer $isIot = [System.Management.Automation.Platform]::IsIoT $isFullWin = $IsWindows -and !$isNanoServer -and !$isIot $extraArgs = @{} ...
combined_dataset/train/non-malicious/Out-DataTable_1.ps1
Out-DataTable_1.ps1
####################### <# .SYNOPSIS Creates a DataTable for an object .DESCRIPTION Creates a DataTable based on an objects properties. .INPUTS Object Any object can be piped to Out-DataTable .OUTPUTS System.Data.DataTable .EXAMPLE $dt = Get-Alias | Out-DataTable This example creates a DataTable fro...
combined_dataset/train/non-malicious/sample_45_68.ps1
sample_45_68.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# PowerShell Diagnostics Module This module contains a set of wrapper scripts that enable a user to use ETW tracing in Windows PowerShell. #> $script:Logman="$env:windir\system32\logman.exe" $script:wsmanlogfile = "$env:wind...
combined_dataset/train/non-malicious/3508.ps1
3508.ps1
function Get-ResourceGroupName { return getAssetName } function Get-ResourceName { return getAssetName } function Clean-ResourceGroup($rgname) { Remove-AzResourceGroup -Name $rgname -Force }
combined_dataset/train/non-malicious/2462.ps1
2462.ps1
[OutputType([void])] [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [scriptblock]$Condition, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [int]$Timeout, [Parameter()] [ValidateNotNullOrEmpty()] [object[]]$ArgumentList, [Parameter()] [ValidateNotNullOrEmpty()] [int]$R...
combined_dataset/train/non-malicious/sample_30_47.ps1
sample_30_47.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 = '77.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/VerifyCategoryRule_3.ps1
VerifyCategoryRule_3.ps1
## From Windows PowerShell Cookbook (O'Reilly) ## by Lee Holmes (http://www.leeholmes.com/guide) Set-StrictMode -Version Latest if($message.Body -match "book") { [Console]::WriteLine("This is a message about the book.") } else { [Console]::WriteLine("This is an unknown message.") }
combined_dataset/train/non-malicious/sample_52_1.ps1
sample_52_1.ps1
Get-WsusServer Get-WsusServer | Invoke-WsusServerCleanup -CleanupObsoleteUpdates -CleanupUnneededContentFiles cd C:\Users\sampler-win_2022_x64\Desktop\ sqlcmd stop-service WSUSService, W3SVC get-service WSUSService, W3SVC stop-service WSUSService stop-service wsusservice get-service wsusservice stop-service ws...
combined_dataset/train/non-malicious/ShowUI Clock _1.ps1
ShowUI Clock _1.ps1
New-UIWidget -AsJob -Content { $shadow = DropShadowEffect -Color Black -Shadow 0 -Blur 8 $now = Get-Date; StackPanel { TextBlock -Name "Time" ('{0:h:mm tt}' -f $now) -FontSize 108 -LineHeight 100 -LineStackingStrategy BlockLineHeight -Margin 0 -Padding 0 -Foreground White -Effect $shadow -FontFa...
combined_dataset/train/non-malicious/WriteFileName_1.ps1
WriteFileName_1.ps1
# functions to print overwriting multi-line messages. Test script will accept a file/filespec/dir and iterate through all files in all subdirs printing a test message + file name to demostrate. # e.g. PS>.\\writefilename.ps1 c:\\ # call WriteFileName [string] # after done writing series of overwriting messages, cal...
combined_dataset/train/non-malicious/sample_25_64.ps1
sample_25_64.ps1
# Copyright (C) Intel Corporation, 2007 - 2021 All Rights Reserved. .$psScriptRoot\Invoke-AMTPowerManagement.ps1 .$psScriptRoot\Invoke-AMTForceBoot.ps1 .$psScriptRoot\Invoke-AMTForceBoot_OCR.ps1 .$psScriptRoot\Set-AMT3PDS.ps1 .$psScriptRoot\Get-AMT3PDS.ps1 .$psScriptRoot\Clear-AMT3PDS.ps1 .$psScriptRoot\set-AM...
combined_dataset/train/non-malicious/2830.ps1
2830.ps1
$manifestPath = "$PSScriptRoot/../src/psake.psd1" $manifest = Import-PowerShellDataFile -Path $manifestPath Remove-Module -Name psake -Force Import-Module -Name $manifestPath -Force -Verbose:$false -ErrorAction Stop $commands = Get-Command -Module psake -CommandType Cmdlet, Function, Workflow foreach ($com...
combined_dataset/train/non-malicious/sample_23_47.ps1
sample_23_47.ps1
# # Module manifest for module 'ThreadJob' # @{ # Script module or binary module file associated with this manifest. RootModule = '.\Microsoft.PowerShell.ThreadJob.dll' # Version number of this module. ModuleVersion = '2.0.3' # ID used to uniquely identify this module GUID = '0e7b895d-2fec-43f7-8cae-11...
combined_dataset/train/non-malicious/sample_49_42.ps1
sample_49_42.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/New-Wrapper.ps1
New-Wrapper.ps1
function New-Wrapper { <# .Synopsis Encrypt a secret script to run from a new ps1 wrapper script. .Description Encrypt a secret script to run from a new ps1 wrapper script. A block diagram of how password is protected. http://bit.ly/jE1N7n The original template use...
combined_dataset/train/non-malicious/sample_18_13.ps1
sample_18_13.ps1
param([int]$Count=50, [int]$DelayMilliseconds=200) function Write-Item($itemCount) { $i = 1 while ($i -le $itemCount) { $str = "Output $i" Write-Output $str # In the gutter on the left, right click and select "Add Conditional Breakpoint" # on the next line. Use the c...
combined_dataset/train/non-malicious/sample_33_51.ps1
sample_33_51.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 = '77.0.0' # Supported PSEdi...