full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/4280.ps1
4280.ps1
Function Get-FireWallRule { Param ( $Name, $Direction, $Enabled, $Protocol, $profile, $action, $grouping ) $Rules = (New-object -comObject HNetCfg.FwPolicy2).rules If ($name) { $rules= $rules | where-object {$_.name -like $name}} If ($direction) {$rules= $rules | where-object {$_.direction -eq $direction}} If (...
combined_dataset/train/non-malicious/sample_50_57.ps1
sample_50_57.ps1
# # Module manifest for module 'OCI.PSModules.Generativeaiinference' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Generativeaiinference.dll' # Version number of this module. ModuleVersion = '77.0.0' #...
combined_dataset/train/non-malicious/sample_61_2.ps1
sample_61_2.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 Remove-ServiceFabric...
combined_dataset/train/non-malicious/219.ps1
219.ps1
function Get-ParentGroup { [CmdletBinding()] PARAM( [Parameter(Mandatory = $true)] [String[]]$Name ) BEGIN { TRY{ if(-not(Get-Module Activedirectory -ErrorAction Stop)){ Write-Verbose -Message "[BEGIN] Loading ActiveDirectory Module" ...
combined_dataset/train/non-malicious/sample_10_3.ps1
sample_10_3.ps1
# # Module manifest for module 'OCI.PSModules.Apmsynthetics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmsynthetics.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEdi...
combined_dataset/train/non-malicious/datareader to dataset.ps1
datareader to dataset.ps1
@@This code was copied from the site http://www.ti4fun.com @@----------------------------------------------------------- Public Function ConvDataReaderToDataTable(Byval command As System.Data.SqlClient.SqlCommand) As System.Data.DataTable Dim datatable As New System.Data.DataTable Dim reader As ...
combined_dataset/train/non-malicious/3551.ps1
3551.ps1
$containerName = "pstestwlvm1bca8" $resourceGroupName = "pstestwlRG1bca8" $vaultName = "pstestwlRSV1bca8" $resourceId = "/subscriptions/da364f0f-307b-41c9-9d47-b7413ec45535/resourceGroups/pstestwlRG1bca8/providers/Microsoft.Compute/virtualMachines/pstestwlvm1bca8" $policyName = "HourlyLogBackup" functio...
combined_dataset/train/non-malicious/sample_15_92.ps1
sample_15_92.ps1
@{ GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" FunctionsToExport = @() CmdletsToExport = "Get-Credential", "Get-ExecutionP...
combined_dataset/train/non-malicious/3379.ps1
3379.ps1
function Initialize-Mappings { param ( [Parameter(Mandatory = $false)] [string[]]$PathsToIgnore, [Parameter(Mandatory = $false)] [Hashtable]$CustomMappings ) $Mappings = [ordered]@{} Get-ChildItem -Path $Script:RootPath -File | ForEach-Object { $Mappings[$_.Name] =...
combined_dataset/train/non-malicious/sample_24_74.ps1
sample_24_74.ps1
[CmdletBinding()] param ( [Parameter(Mandatory)] [string]$MergeCommitSha ) Import-Module $(Join-Path $PSSCriptRoot Helpers.psm1) class DeleteEvent { [string]$Author; [string]$Sha; [DateTime]$CommitDate; DeleteEvent([string]$author, [string]$sha, [string]$datestring) { ...
combined_dataset/train/non-malicious/TabExpansion_15.ps1
TabExpansion_15.ps1
## Tab-Completion ################# ## Please dot souce this script file. ## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list. ## ## What this can do is: ## ## [datetime]::n<tab> ## [datetime]::now.d<tab> ## $a = New-Object "Int32[,]" 2,3; $b = "PowerShell","Pow...
combined_dataset/train/non-malicious/sample_62_41.ps1
sample_62_41.ps1
# default-build.yml # Description: Defines a build phase for invoking build.sh/cmd # Parameters: # jobName: string # The name of the job. Defaults to the name of the OS. No spaces allowed # jobDisplayName: string # The friendly job name to display in the UI. Defaults to the name of the OS. # agentOs: ...
combined_dataset/train/non-malicious/sample_43_60.ps1
sample_43_60.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/Select-UserGroup.ps1
Select-UserGroup.ps1
New-Grid -ControlName SelectUserGroups -Columns Auto,* -Rows 4 { $GetGroups = { $user = Get-QADUuser $this.Text -SizeLimit 1 if($User.LogonName -eq $this.Text -or $User.Email -eq $this.Text) { $this.Foreground = "Black" $Group.ItemsSource = Get-QADGroup -ContainsMember...
combined_dataset/train/non-malicious/43.ps1
43.ps1
[CmdletBinding(DefaultParameterSetName="NormalRun")] Param( [parameter(Mandatory=$true,ParameterSetName="NormalRun")] [alias("s")] [ValidateScript({ if (!($_.contains("/"))){ $True } else { Throw "Please use the hostname FQDN and not the HTTPS URL. Example: 'scep-contos...
combined_dataset/train/non-malicious/sample_19_67.ps1
sample_19_67.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
combined_dataset/train/non-malicious/1427.ps1
1427.ps1
function Test-CUncPath { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Path ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState ([Uri]$Path).IsUnc }
combined_dataset/train/non-malicious/sample_30_85.ps1
sample_30_85.ps1
########################################################### # # 'GCArcService' module # ########################################################### $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest Import-Module "$PSScriptRoot\ServiceHelper.psm1" $script:GCInstallPath = "$PSScriptRoot\..\..\...
combined_dataset/train/non-malicious/Email attachments_1.ps1
Email attachments_1.ps1
$file = "MYFILE.TXT" $smtpServer = "MYSMTPSERVER.EMAIL.CO.UK" $msg = new-object Net.Mail.MailMessage $att = new-object Net.Mail.Attachment($file) $smtp = new-object Net.Mail.SmtpClient($smtpServer) $msg.From = "FROMME@EMAIL.CO.UK" $msg.To.Add("TOME@EMAIL.CO.UK") $msg.Subject = "MY SUBJECT" $msg.Body = "MY...
combined_dataset/train/non-malicious/1352.ps1
1352.ps1
function Grant-CMsmqMessageQueuePermission { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $Name, [Switch] $Private, [Parameter(Mandatory=$true)] [string] ...
combined_dataset/train/non-malicious/New-XVM_14.ps1
New-XVM_14.ps1
#EXAMPLES <# New-XVM -ComputerName HYPERVSVR02 -Name "WS2012-TESTSVR01" -SwitchName "External(192.168.1.0/24)" -VhdType NoVHD New-XVM -ComputerName HYPERVSVR02 -Name "WS2012-TESTSVR02" -SwitchName "External(192.168.1.0/24)" -VhdType ExistingVHD -VhdPath D:\\vhds\\WS2012-TESTSVR02.vhdx New-XVM -ComputerName HYPERVSV...
combined_dataset/train/non-malicious/1867.ps1
1867.ps1
Describe "Out-Host Tests" -tag CI { BeforeAll { $th = New-TestHost $rs = [runspacefactory]::Createrunspace($th) $rs.open() $ps = [powershell]::Create() $ps.Runspace = $rs $ps.Commands.Clear() } AfterEach { $ps.Commands.Clear() } AfterAll { ...
combined_dataset/train/non-malicious/sample_3_31.ps1
sample_3_31.ps1
]Calculated table '%{oii_table/}' must have only one partition with source of type Calculated.ŎZa Direct Lake režim neophodan je Direct Lake izvor podataka. Tabele u Direct Lake režimu moraju biti tipa izvora podataka koji je SQL ili OneLake. Proverite i ispravite definicije izvora podataka za sledeće Direct Lake tabel...
combined_dataset/train/non-malicious/sample_26_27.ps1
sample_26_27.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/578.ps1
578.ps1
function Submit-SPOCheckIn { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string]$targetPath ) $targetPath = Join-SPOParts -Separator '/' -Parts $clientContext.Web.ServerRelativeUrl, $targetPath $remotefile = $clientContext.Web.GetFileByServerRelativeUrl($targetPath) $clien...
combined_dataset/train/non-malicious/3126.ps1
3126.ps1
function Send-WakeOnLan { [CmdletBinding()] param( [Parameter( Position=0, Mandatory=$true, HelpMessage='MAC-Address of the remote computer which you want to wake up')] [ValidateScript({ if($_ -match "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{...
combined_dataset/train/non-malicious/1405.ps1
1405.ps1
function Join-CIisVirtualPath { [CmdletBinding()] param( [Parameter(Mandatory=$true,Position=0)] [string] $Path, [Parameter(Position=1)] [string] $ChildPath ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Se...
combined_dataset/train/non-malicious/2260.ps1
2260.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")] [ValidateNotNullOrEmpty()] [ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})] [string]$SiteServer ) Begin { try { Write-Verb...
combined_dataset/train/non-malicious/sample_8_56.ps1
sample_8_56.ps1
ConvertFrom-StringData @' id_provisioningmode_activity=Checking Configuration Manager Client Issues id_provisioningmode_status=Detecting if the Client is in Provisioning Mode '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE...
combined_dataset/train/non-malicious/sample_50_6.ps1
sample_50_6.ps1
Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Built-By: vsts Created-By: Apache Maven Build-Jdk: 11.0.21 Name: com/microsoft/azure/toolkit/lib/appservice/deploy/FlexFunctionDe ployHandler.html SHA-256-Digest: uXPJcuXmM2bAu8SOYO8Imh4iFQADjsP4QepoUGPpO34= Name: jquery/jszip-utils/dist/jszip-utils.j...
combined_dataset/train/non-malicious/3611.ps1
3611.ps1
function Get-BandwidthScheduleName { return getAssetName } function Test-GetNonExistingBandwidthSchedule { $rgname = Get-DeviceResourceGroupName $dfname = Get-DeviceName $bwname = Get-BandwidthScheduleName Assert-ThrowsContains { Get-AzDataBoxEdgeBandwidthSchedule -ResourceGroupName $rgname ...
combined_dataset/train/non-malicious/sample_37_71.ps1
sample_37_71.ps1
# # Module manifest for module 'OCI.PSModules.Mysql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Mysql.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_25_14.ps1
sample_25_14.ps1
ConvertFrom-StringData -StringData @' AdapterNotFound = 找不到指定适配器:{0} InvalidParams = 无效的参数集。请参阅 cmdlet 帮助以查看有效的参数集。 InvalidParamsAdapterAndName = 您无法指定名称和适配器参数。 InvalidParamsConfigAndModule = 您无法指定 Module 和 Configuration 参数。 InvalidModule = {0}:{1} 不是有效的模块名称。请使用以下命令查看有效模块 "Get-IntelEthernetLogConfig -Name "{0}"" ...
combined_dataset/train/non-malicious/_1.168.1.1.ps1
_1.168.1.1.ps1
function Set-IPAddress { param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"), [string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"), [string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"), [string]$gateway = $(read-host "Enter...
combined_dataset/train/non-malicious/sample_37_81.ps1
sample_37_81.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 = 'https://aka...
combined_dataset/train/non-malicious/sample_31_52.ps1
sample_31_52.ps1
#!powershell # Copyright: (c) 2018, Wojciech Sciesinski <wojciech[at]sciesinski[dot]net> # Copyright: (c) 2017, Daniele Lazzari <lazzari@mailup.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy # win_psmodule (Windows PowerS...
combined_dataset/train/non-malicious/1840.ps1
1840.ps1
Describe "CredSSP cmdlet tests" -Tags 'Feature','RequireAdminOnWindows' { BeforeAll { $powershell = Join-Path $PSHOME "pwsh" $notEnglish = $false $IsToBeSkipped = !$IsWindows; $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() if ( $IsToBeSkipped ) ...
combined_dataset/train/non-malicious/SyntaxHighlighter Brush_2.ps1
SyntaxHighlighter Brush_2.ps1
/** * PowerShell 2.0 Brush for highlighter 2.0 * * SyntaxHighlighter http://alexgorbatchev.com/wiki/SyntaxHighlighter * * @version * 2.1.0 (April 07 2009) * * @copyright * Copyright (C) 2008-2009 Joel Bennett http://HuddledMasses.org/ * * @license * This file is for SyntaxHighlighter. * ...
combined_dataset/train/non-malicious/Invoke-ElevatedCommand.p.ps1
Invoke-ElevatedCommand.p.ps1
##############################################################################\n##\n## Invoke-ElevatedCommand\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\nR...
combined_dataset/train/non-malicious/sample_66_59.ps1
sample_66_59.ps1
# # Module manifest for module 'OCI.PSModules.Servicecatalog' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicecatalog.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSE...
combined_dataset/train/non-malicious/sample_52_70.ps1
sample_52_70.ps1
ConvertFrom-StringData @' FailoverClustersModuleRequired=A szükséges PowerShell-modul (FailoverClusters) nem található. A telepítéshez használja a Szerepkörök és szolgáltatások eszközt: Távoli kiszolgálófelügyelet eszközei | Szolgáltatásfelügyeleti eszközök | Feladatátvételi fürtszolgáltatás eszközei | Windows PowerSh...
combined_dataset/train/non-malicious/Set-ADUserRandomPassword.ps1
Set-ADUserRandomPassword.ps1
###########################################################################" # # NAME: Set-ADUserRandomPassword.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # # COMMENT: This script are used to set a random password for Active Directory users in a specified Organizational Unit. It stores th...
combined_dataset/train/non-malicious/3535.ps1
3535.ps1
$location = "southeastasia" $resourceGroupName = "pstestFSRG1bca8f8e" $vaultName = "PSTestFSRSV1bca8f8e" $fileShareFriendlyName = "pstestfs1bca8f8e" $fileShareName = "AzureFileShare;pstestfs1bca8f8e" $saName = "pstestsa1bca8f8e" $skuName="Standard_LRS" $policyName = "AFSBackupPolicy" ...
combined_dataset/train/non-malicious/VHDFunctions_1.psm1.ps1
VHDFunctions_1.psm1.ps1
<# Name: VHDFunctions.psm1 Author: Rich Kusak (rkusak@cbcag.edu) Created: 2009-10-23 LastEdit: 2009-11-03 08:57 Included Functions: Dismount-VHD Initialize-VHD Mount-VHD New-VHD Set-VHDBootConfiguration Test-VHD #> <# .SYNOPSIS Dismount a VHD file from the system. .DESCRIPTION This f...
combined_dataset/train/non-malicious/sample_39_58.ps1
sample_39_58.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 = '73.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_10_90.ps1
sample_10_90.ps1
ConvertFrom-StringData @' id_pagedpoold2dsymevent_sd=This Windows Server 2003 may run out of paged pool due to a version of symevent.sys. id_kerneltagtokekb982010_sd=This machine have high usage of kernel memory pool tag Toke possibly caused by the DisableWindowsUpdateAccess user policy. id_kerneltagrxm4setikb264745...
combined_dataset/train/non-malicious/556.ps1
556.ps1
function Add-SPOPrincipalToGroup { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string]$username, [Parameter(Mandatory=$true, Position=1)] [string]$groupname ) process { Write-Host "Adding principal with username $username to group $groupname" -foregroundcolor black -back...
combined_dataset/train/non-malicious/sample_4_15.ps1
sample_4_15.ps1
# # Module manifest for module 'OCI.PSModules.Aidocument' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aidocument.dll' # Version number of this module. ModuleVersion = '93.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/3622.ps1
3622.ps1
function Test-GetAzureLogAllParameters { $correlation = '/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.insights/alertrules/checkrule3-4b135401-a30c-4224-ae21-fa53a5bd253d/incidents/L3N1YnNjcmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGY...
combined_dataset/train/non-malicious/sample_20_69.ps1
sample_20_69.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/sample_5_26.ps1
sample_5_26.ps1
ConvertFrom-StringData @' id_ctsnps=Network Policy Server (NPS) id_ctsnpsdescription=Collects information about Network Policy Server (NPS) [RADIUS/IAS]. '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlL...
combined_dataset/train/non-malicious/sample_3_44.ps1
sample_3_44.ps1
#************************************************ # TS_SurfacePro3DetectFirmwareVersions.ps1 # Version 1.0.09.19.14: Created and tested SurfacePro3 scripts from Sep12-19 # Date: 2014 # Author: bbenson # Description: SurfacePro3DetectFirmwareVersions # # Rule GUID: 34F6567E-7B92-4C37-B1CA-5DE6E66D4881 # # Files...
combined_dataset/train/non-malicious/sample_52_40.ps1
sample_52_40.ps1
# # Module manifest for module 'OCI.PSModules.Dataintegration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dataintegration.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported P...
combined_dataset/train/non-malicious/sample_29_12.ps1
sample_29_12.ps1
# # Module manifest for module 'OCI.PSModules.Resourcemanager' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Resourcemanager.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported P...
combined_dataset/train/non-malicious/sample_55_18.ps1
sample_55_18.ps1
function PSConsoleHostReadLine { Microsoft.PowerShell.Core\Set-StrictMode -Off [Microsoft.PowerShell.PSConsoleReadLine]::ReadLine($host.Runspace, $ExecutionContext) } # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE...
combined_dataset/train/non-malicious/2690.ps1
2690.ps1
function Register-ProcessModuleTrace { [CmdletBinding()] Param () if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) { throw 'You must run this cmdlet from an elevated PowerShell se...
combined_dataset/train/non-malicious/2811.ps1
2811.ps1
if (Get-Command logparser.exe) { $lpquery = @" SELECT COUNT(ImagePath, LaunchString, Publisher) as ct, ImagePath, LaunchString FROM *autorunsc.tsv WHERE (ImagePath not like 'File not found%') GROUP BY ImagePath, LaunchString ORDER BY ...
combined_dataset/train/non-malicious/1612.ps1
1612.ps1
function Get-PrinterClients { Param ( [string]$comp = $env:COMPUTERNAME ) if (!$comp) { throw 'No comp.' } $ping = New-Object System.Net.NetworkInformation.Ping try { $result = $ping.Send($comp) } catch { $result = $null } if ($result.Status -eq 'Suc...
combined_dataset/train/non-malicious/Get-Parameter function.ps1
Get-Parameter function.ps1
function Get-Parameters { param([string]$CommandName, [switch]$IncludeCommon) try { $command = get-command $commandname $parameters = (new-object System.Management.Automation.CommandMetaData $command, $includecommon).Parameters $parameters.getenumerator() # unroll dictionary } catch ...
combined_dataset/train/non-malicious/2353.ps1
2353.ps1
$error.PSBase.Clear() $aRegRoots = @('HKCU\Software','HKLM\System','HKLM\Software'); $aGpos = Get-Gpo -All; $aUniqueSettings = @(); $aUniqueDups = @(); function findRegValues($sName,$sId,$sKeyPath,$aKeyPathHistory = $null) { $aPath = Get-GPRegistryValue -GUID $sId -Key $sKeyPath -ErrorAction 'silentlycontinue' $aK...
combined_dataset/train/non-malicious/sample_32_2.ps1
sample_32_2.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 = '80.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/3905.ps1
3905.ps1
function Test-JobScheduleCRUD { $context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext $jsId1 = "jobSchedule1" $jsId2 = "jobSchedule2" try { $jobSpec1 = New-Object Microsoft.Azure.Commands.Batch.Models.PSJobSpecification ...
combined_dataset/train/non-malicious/LibraryChart_4.ps1
LibraryChart_4.ps1
# --------------------------------------------------------------------------- ### <Script> ### <Author> ### Chad Miller ### </Author> ### <Description> ### Defines functions for wokring with Microsoft Chart Control for .NET 3.5 Framework ### Pipe output of Powershell command to Out-Chart function and specify c...
combined_dataset/train/non-malicious/sample_21_49.ps1
sample_21_49.ps1
# PowerShell Scripting Best Practices This document is intended as guidance for how all PowerShell scripts should be written for security, functionality, and consistency. To help enforce these rules during your dev process, consider using [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer). Each of the...
combined_dataset/train/non-malicious/Function Run-Script.ps1
Function Run-Script.ps1
function Run-Script { if ($psISE.CurrentFile.DisplayName.StartsWith("Untitled")) { return } $script = $psISE.CurrentFile.DisplayName $psISE.CurrentFile.Save() $logfile = "$env:programfiles\\Sea Star Development\\" + "Script Monitor Service\\ScriptMon.txt" #Change t...
combined_dataset/train/non-malicious/sample_59_4.ps1
sample_59_4.ps1
# # Module manifest for module 'OCI.PSModules.Nosql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Nosql.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/Get-NetworkStatistics_1.ps1
Get-NetworkStatistics_1.ps1
function Get-NetworkStatistics { [OutputType('System.Management.Automation.PSObject')] [CmdletBinding(DefaultParameterSetName='name')] param( [Parameter(Position=0,ValueFromPipeline=$true,ParameterSetName='port')] [System.String]$Port='*', [Parameter(Position=0,ValueFromPipeline=$true,ParameterSe...
combined_dataset/train/non-malicious/320.ps1
320.ps1
function Register-PSFMessageTransform { [CmdletBinding(PositionalBinding = $false, HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFMessageTransform')] Param ( [Parameter(Mandatory = $true, ParameterSetName = "Target")] [string] $TargetType, [Parameter(Mandatory = $true, ...
combined_dataset/train/non-malicious/sample_23_59.ps1
sample_23_59.ps1
[CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipeline,ValueFromPipelineByPropertyName)] [Alias("Fullname")] [String]$FileName ) return git log -n 1 --pretty=format:%H -- $filename # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgo...
combined_dataset/train/non-malicious/4070.ps1
4070.ps1
Clear-Host $Global:OS $Global:RelativePath $FileLoc = "C:\Program Files\Autodesk\Revit 2013\Program\" $DLL_01 = "RS.Common.ClientServer.Proxy" $DLL_02 = "DataStorageClient" $DLL_03 = "DesktopMFC" $DLL_04 = "FamilyDB" $DLL_05 = "GeomUtil" $DLL_06 = "Graphics" $DLL_07 = "GrphOGS3" $DLL_08 = "CommandServiceClient" ...
combined_dataset/train/non-malicious/Copy-History.ps1
Copy-History.ps1
##############################################################################\n##\n## Copy-History\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\nCopy select...
combined_dataset/train/non-malicious/Send-MailMessage.ps1
Send-MailMessage.ps1
##############################################################################\n##\n## Send-MailMessage\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n## Illustrate the techniques used to send an email in PowerShell.\n## In version two, use the Send-MailMessa...
combined_dataset/train/non-malicious/sample_23_62.ps1
sample_23_62.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 = '77.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/Solarized (Dark) Theme.ps1
Solarized (Dark) Theme.ps1
<?xml version="1.0" encoding="utf-16"?> <StorableColorTheme xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Keys> <string>ErrorForegroundColor</string> <string>ErrorBackgroundColor</string> <string>WarningForegroundColor</string> <string>Warni...
combined_dataset/train/non-malicious/Split-Job.ps1
Split-Job.ps1
#requires -version 1.0 ################################################################################ ## Run commands in multiple concurrent pipelines ## by Arnoud Jansveld - www.jansveld.net/powershell ## ## Basic "drop in" usage examples: ## - Functions that accept pipelined input: ## Without Spli...
combined_dataset/train/non-malicious/sample_19_89.ps1
sample_19_89.ps1
ConvertFrom-StringData @' id_systemservicediagnostic_sqlconnect=Connect to a Sql Server Instance id_systemservicediagnostic_sqlconnectdesc=Trying to connect to Sql Server id_axsqldataengine=Running SQL Query against Sql Server: %Server% id_axsqldataenginedesc=Checking sql configuration : %DC_Name% id_axsqlruleseng...
combined_dataset/train/non-malicious/sample_16_84.ps1
sample_16_84.ps1
Import-Module $PSScriptRoot\AzStackHci.EnvironmentChecker.Reporting.psm1 -Force -DisableNameChecking -Global Import-Module $PSScriptRoot\AzStackHci.EnvironmentChecker.PortableUtilities.psm1 -Force -DisableNameChecking -Global Import-LocalizedData -BindingVariable lTxt -FileName AzStackHci.EnvironmentChecker.Strings...
combined_dataset/train/non-malicious/788.ps1
788.ps1
 function Register-EditorCommand { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$Name, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$DisplayName, [Parameter( Mandatory=$tr...
combined_dataset/train/non-malicious/Queue Checker.ps1
Queue Checker.ps1
foreach ($ExchangServer in (Get-ExchangeServer | Where { $_.isHubTransportServer -eq $True})) {Get-queue -Server $ExchangeServer}
combined_dataset/train/non-malicious/Script Listing.ps1
Script Listing.ps1
$pathToScripts = "C:\\Scripts\\*" foreach($itm in get-childitem $pathToScripts -include *.ps1 -recurse) {"{0,-25}{1,0}" -f ((" " + $itm.name) -replace ".ps1",""), ((get-content $itm | where {$_ -like "*Purpose:*"}) -replace "# Purpose: ","")}
combined_dataset/train/non-malicious/Twitbrain cheat.ps1
Twitbrain cheat.ps1
#Twitbrain Cheat PowerShell script #Description: PowerShell script to beat everyone at the Twitter twitbrain game # For more info follow @twitbrain at www.twitter.com #Change the Twitter Username and Password in the script. #Author: Stefan Stranger #Website: http://tinyurl.com/sstranger #Date: 03/07/2...
combined_dataset/train/non-malicious/496.ps1
496.ps1
function Get-MSI{ $msiUtilSignature = @' /// <summary> /// The HRESULT error code for success. /// </summary> private const int ErrorSuccess = 0; /// <summary> /// The HRESULT error code that indicates there is more /// data available to retrieve. /// </summary> private const int ErrorMoreData = 234; /// <summ...
combined_dataset/train/non-malicious/sample_49_97.ps1
sample_49_97.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/1516.ps1
1516.ps1
function Assert-FileContains { [CmdletBinding()] param( [Parameter(Position=0)] [string] $Path, [Parameter(Position=1)] [string] $Needle, [Parameter(Position=2)] $Message ) Set-StrictMode -Ve...
combined_dataset/train/non-malicious/Get-Sequence.ps1
Get-Sequence.ps1
## Get-Sequence ## Optionless implementation of seq for PowerShell ############################################################################ ## Most of the options don't apply because they convert the numbers to text ## which isn't something a PowerShell Seq wants to do :) ####################################...
combined_dataset/train/non-malicious/sample_57_23.ps1
sample_57_23.ps1
<# .SYNOPSIS Powershell script to collect data about Geneva Metrics (AKA MDM, AKA Geneva Hot Path) data publication. .DESCRIPTION This script performs several operations for troubleshooting issues related to MetricsExtension such as: - Collection of metric traffic. - Collectio of information about...
combined_dataset/train/non-malicious/sample_30_84.ps1
sample_30_84.ps1
steps: - task: NodeTool@0 inputs: versionSource: fromFile versionFilePath: .nvmrc nodejsMirror: https://github.com/joaomoreno/node-mirror/releases/download - task: SFP.build-tasks.esrpclient-tools-task.EsrpClientTool@2 displayName: "Use EsrpClient" - task: AzureKeyVault@1 displayNa...
combined_dataset/train/non-malicious/1603.ps1
1603.ps1
function Take-Ownership { param ( [String]$Folder, [switch]$Everyone, [switch]$ThisItemOnly, [switch]$File, [switch]$Revoke ) if ( !$file -and !($Folder.EndsWith('\')) ) { $Folder += '\' } if ($Folder -match ' ') { $Folder = '"' + $...
combined_dataset/train/non-malicious/Read-HostWithPrompt.ps1
Read-HostWithPrompt.ps1
#############################################################################\n##\n## Read-HostWithPrompt\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\nRead ...
combined_dataset/train/non-malicious/1617.ps1
1617.ps1
function global:Get-LoggedOnUser { [CmdletBinding()] Param ( [Parameter(Mandatory=$true, ...
combined_dataset/train/non-malicious/Set-Computername_3.ps1
Set-Computername_3.ps1
function Set-ComputerName { param( [switch]$help, [string]$originalPCName=$(read-host "Please specify the current name of the computer"), [string]$computerName=$(read-host "Please specify the new name of the computer")) $usage = "set-ComputerName -originalPCname CurrentName -computername AnewName" if (...
combined_dataset/train/non-malicious/sample_42_12.ps1
sample_42_12.ps1
# Localized 04/14/2024 08:54 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=是(&Y) PromptNoString=否(&N) BundleFound=找到下列資源存放區: {0} PackageFound=找到封裝: {0} EncryptedBundleFound=找到加密的套件組合: {0} EncryptedPackageFound=找到加密的套件: {0} CertificateFou...
combined_dataset/train/non-malicious/sample_11_7.ps1
sample_11_7.ps1
ConvertFrom-StringData @' id_virtualization=Virtualization Information id_virtualizationobtaining=Obtaining Information about Virtualization Environment id_virtualizationoutput=Virtualization Information Output '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor ...
combined_dataset/train/non-malicious/sample_61_94.ps1
sample_61_94.ps1
# clickup-pretty-tasks README ClickUp Pretty Tasks displays tasks description and status right in the code where they are mentioned. ## Features - Decorate task links with task status + details ![image](https://github.com/everix-io/vscode-extensions/raw/HEAD/Media/demoscreen.png) - Run commands:...
combined_dataset/train/non-malicious/Get-NICSettings.ps1
Get-NICSettings.ps1
# Get-NICSettings by Hugo Peeters of www.peetersonline.nl ######################################################### $serverName = Read-Host "Enter server name" $NicConfig = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -ComputerName $serverName $myCol = @() ForEach ($Nic in $NicConfig) { If ($Nic.IPAddr...
combined_dataset/train/non-malicious/play-note(s)_1.ps1
play-note(s)_1.ps1
function Play-Note([string]$note,[int] $duration = 5) { if (!($note -match '(\\d+)')) { $note+='4' };[void]($note -match '([A-G#]{1,2})(\\d+)') [console]::Beep((440 * [math]::Pow([math]::pow(2,(1/12)), (([int] $matches[2]) - 4)* 12 + $( switch($matches[1]) { 'A' { 0 } 'A#' { 1 } 'Bb' { 1 } '...
combined_dataset/train/non-malicious/sample_57_76.ps1
sample_57_76.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ param ( [Parameter(Manda...
combined_dataset/train/non-malicious/3089.ps1
3089.ps1
function Verify-AssertionFailed { param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [ScriptBlock]$ScriptBlock ) $assertionExceptionThrown = $false $err = $null try { $null = & $ScriptBlock } catch [Exception] { $assertionExceptionThrown = ($_....
combined_dataset/train/non-malicious/sample_0_7.ps1
sample_0_7.ps1
<# .SYNOPSIS Simplify data collection and diagnostics for troubleshooting Microsoft Remote Desktop (RDP/RDS/AVD/W365) related issues and a convenient method for submitting and following quick & easy action plans. .DESCRIPTION This script is designed to gather information to assist Microsoft Customer Suppo...
combined_dataset/train/non-malicious/sample_52_22.ps1
sample_52_22.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 = '73.1.0' # Suppo...