full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_24_27.ps1
sample_24_27.ps1
<# .SYNOPSIS Demonstrates how to write a command that works with paths that allow wildards and must exist. .DESCRIPTION This command also demonstrates how you need to supply a LiteralPath parameter when your Path parameter accepts wildcards. This is in order to handle paths like foo[1].txt. ...
combined_dataset/train/non-malicious/sample_62_26.ps1
sample_62_26.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/Get-Software Function.ps1
Get-Software Function.ps1
Function Get-Software{ <# .SYNOPSIS Gets the software applications on a remote computer. .DESCRIPTION This function interrogates the remote registry for installed software products. It then returns an array of powershell objects that can be sorted and parsed. ...
combined_dataset/train/non-malicious/sample_32_93.ps1
sample_32_93.ps1
@{ GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" CmdletsToExport = @( 'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al...
combined_dataset/train/non-malicious/sample_47_17.ps1
sample_47_17.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/1775.ps1
1775.ps1
Import-Module HelpersSecurity try { $defaultParamValues = $PSDefaultParameterValues.Clone() $PSDefaultParameterValues["it:Skip"] = !$IsWindows Describe "Importing PowerShell script files are not allowed in ConstrainedLanguage" -Tags 'CI','RequireAdminOnWindows' { BeforeAll { ...
combined_dataset/train/non-malicious/sample_29_79.ps1
sample_29_79.ps1
# # Module manifest for module 'OCI.PSModules.Keymanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Keymanagement.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/Measure-File.ps1
Measure-File.ps1
#.Synopsis # Calculate statistics about files #.Description # A lightweight simulation of unix's "wc" word count application #.Parameter $file # Accepts PIPELINE input # The file name(s) or wildcard patterns for the file(s) you want to count #.Example # wc *.ps1 # # Calculates line, word, and character ...
combined_dataset/train/non-malicious/993.ps1
993.ps1
Param( [parameter(Mandatory=$true)] $SubscriptionId, [parameter(Mandatory=$true)] $VaultName, [parameter(Mandatory=$true)] $ConfigurationServer, [parameter(Mandatory=$true)] $CsvOutput ) class ProtectableItemInfo { [string]$Machine [string]$ProtectionStatus } $currentContext = ...
combined_dataset/train/non-malicious/1626.ps1
1626.ps1
< ============================================================================= REBOOT REMOTE COMPUTER - ALT CREDENTIALS ================================...
combined_dataset/train/non-malicious/Get-Desktop.ps1
Get-Desktop.ps1
Add-Type @' #region License // Desktop 1.1 // * // Copyright (C) 2004 http://www.onyeyiri.co.uk // Coded by: Nnamdi Onyeyiri // // This code may be used in any way you desire except for commercial use. // The code can be freely redistributed unmodified as long as all of the...
combined_dataset/train/non-malicious/3240.ps1
3240.ps1
class Logger { [string]$LogDir hidden [string]$LogFile [LogLevel]$LogLevel [int]$MaxSizeMB [int]$FilesToKeep Logger([string]$LogDir, [LogLevel]$LogLevel, [int]$MaxLogSizeMB, [int]$MaxLogsToKeep) { $this.LogDir = $LogDir $this.LogLevel = $LogLe...
combined_dataset/train/non-malicious/sample_11_89.ps1
sample_11_89.ps1
ConvertFrom-StringData @' id_detectmtu1514_activity=Detect MTU of 1514 id_detectmtu1514_status=Checking network adapters for an MTU of 1514. '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # K...
combined_dataset/train/non-malicious/sample_60_6.ps1
sample_60_6.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 = '85.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_47_86.ps1
sample_47_86.ps1
using namespace System.Management.Automation using namespace System.Management.Automation.Language # This is an example profile for PSReadLine. # # This is roughly what I use so there is some emphasis on emacs bindings, # but most of these bindings make sense in Windows mode as well. Import-Module PSReadLine ...
combined_dataset/train/non-malicious/sample_39_76.ps1
sample_39_76.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\vite@5.0.12\node_modules\vite\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\vite@5.0.12\no...
combined_dataset/train/non-malicious/Get-Payment.ps1
Get-Payment.ps1
function Get-Payment { param ( $LoanAmount, [double]$InterestRatePerPeriod, $NumberPayments ) $a = $LoanAmount $b = $InterestRatePerPeriod*[math]::Pow(($InterestRatePerPeriod + 1),$NumberPayments) $c = [math]::Pow((1+$InterestRatePerPeriod),$NumberPayments) - 1 $payment = $a*($b/$c) "{0:C}" -f $payment } ...
combined_dataset/train/non-malicious/sample_36_47.ps1
sample_36_47.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/ConvertHelpTo-Html.ps1
ConvertHelpTo-Html.ps1
## ConvertTo-DekiContent (aka Convert Help to Html) #################################################################################################### ## Converts the -Full help output to HTML markup for insertion into web pages. #####################################################################################...
combined_dataset/train/non-malicious/4459.ps1
4459.ps1
Install-PSResource 'TestModule' Install-PSResource -name 'TestModule' Install-PSResource 'TestModule1', 'TestModule2', 'TestModule3' Install-PSResource 'TestModule' -MinimumVersion '1.5.0' Install-PSResource 'TestModule' -MaximumVersion '1.5.0' Install-PSResource 'TestModule' -MinimumVersion '1.0.0' -M...
combined_dataset/train/non-malicious/sample_65_78.ps1
sample_65_78.ps1
# # Copyright (c) Microsoft Corporation. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ...
combined_dataset/train/non-malicious/sample_18_67.ps1
sample_18_67.ps1
# # Module manifest for module 'OCI.PSModules.Ons' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ons.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/2736.ps1
2736.ps1
[CmdletBinding()] Param() foreach($user in (Get-WmiObject win32_userprofile)) { $userpath = $user.localpath $usersid = $user.SID Write-Verbose "`$userpath : $userpath" Write-Verbose "`$usersid : $usersid" $sb = { Param( [Parameter(Mandatory=$True,Position=0)] [String]$u...
combined_dataset/train/non-malicious/sample_62_67.ps1
sample_62_67.ps1
@{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.ServiceFabric.Powershell' # Version number of this module. ModuleVersion = '3.1.0.0' # ID used to uniquely identify this module GUID = 'd2c42633-5254-4a82-a312-1dc0697a55cd' # Author of this module Author = '...
combined_dataset/train/non-malicious/4001.ps1
4001.ps1
$rg = "mo-resources-eus" $aa = "mo-aaa-eus2" $azureVMIdsW = @( "/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d/resourceGroups/mo-compute/providers/Microsoft.Compute/virtualMachines/mo-vm-w-01", "/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d/resourceGroups/mo-compute/providers/Microsoft.Comput...
combined_dataset/train/non-malicious/Find Local Group Members_5.ps1
Find Local Group Members_5.ps1
# Author: Hal Rottenberg # Purpose: Find matching members in a local group # Used tip from RichS here: http://powershellcommunity.org/Forums/tabid/54/view/topic/postid/1528/Default.aspx # Change these two to suit your needs $ChildGroups = "Domain Admins", "Group Two" $LocalGroup = "Administrators" $MemberName...
combined_dataset/train/non-malicious/Compare-DataSources_1.ps1
Compare-DataSources_1.ps1
#Define DPMHosts [CmdletBinding()] param([string]$PrimaryDPMHost, [string]$SecondaryDPMHost); Write-Verbose "Compare-DataSources.ps1 written by Shai Perednik shaiss@gmail.com" Write-Verbose "Primary DPM Host: $PrimaryDPMHost" Write-Verbose "Secondary DPM Host: $SecondaryDPMHost" #Load DPM Snaping Write-Verbo...
combined_dataset/train/non-malicious/554.ps1
554.ps1
function Add-SPOList { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string]$listTitle, [Parameter(Mandatory=$false, Position=1)] [Microsoft.SharePoint.Client.ListTemplateType]$templateType = "genericList" ) $web = $clientContext.Web $lists = $web.Lists $cl...
combined_dataset/train/non-malicious/2691.ps1
2691.ps1
function Get-SystemInfo { $Mod = New-InMemoryModule -ModuleName SysInfo $ProcessorType = psenum $Mod SYSINFO.PROCESSOR_ARCH UInt16 @{ PROCESSOR_ARCHITECTURE_INTEL = 0 PROCESSOR_ARCHITECTURE_MIPS = 1 PROCESSOR_ARCHITECTURE_ALPHA = 2 PROCESSOR_ARCHITECTURE_PPC = 3 ...
combined_dataset/train/non-malicious/1333.ps1
1333.ps1
function Reset-CHostsFile { [CmdletBinding(SupportsShouldProcess=$true)] param( [string] $Path = (Get-CPathToHostsFile) ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState if(-not (Test-Path $Path) ) ...
combined_dataset/train/non-malicious/sample_18_42.ps1
sample_18_42.ps1
# Script: tss_ExportVPNProfiles.ps1 #region ::::: Script Input PARAMETERS ::::: #$ScriptVer="1.01" #Date: 2024-03-21 [CmdletBinding()]param( [Parameter(Mandatory=$true, Position=0)] [String] $PrefixTime, [Parameter(Mandatory=$true, Position=1)] [string] $TssPhase ) function CollectNET_VpnProfiles { # Get VPN...
combined_dataset/train/non-malicious/ConvertTo-CliXml_3.ps1
ConvertTo-CliXml_3.ps1
#requires -version 2.0 function ConvertTo-CliXml { param( [Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)] [ValidateNotNullOrEmpty()] [PSObject[]]$InputObject ) begin { $type = [PSObject].Assembly.GetType('System.Management.Automation.Serializer') ...
combined_dataset/train/non-malicious/1255.ps1
1255.ps1
function New-CRsaKeyPair { [CmdletBinding()] [OutputType([IO.FileInfo])] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPassWordParams","")] param( [Parameter(Mandatory=$true,Position=0)] [ValidatePattern('^CN=')] [string] $Subje...
combined_dataset/train/non-malicious/sample_55_6.ps1
sample_55_6.ps1
########################################################################## # DELL PROPRIETARY INFORMATION # # This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this # software to you under the terms of a license agreement,nondisclosure agreement or both. # You may not copy, disclose, o...
combined_dataset/train/non-malicious/3654.ps1
3654.ps1
function Test-ExportDatabase { $testSuffix = 90063 $createServer = $true $createDatabase = $true $createFirewallRule = $true $operationName = "Export" $succeeded = $true Verify-ImportExport $testSuffix $createServer $createDatabase $createFirewallRule $operationNam...
combined_dataset/train/non-malicious/sample_15_72.ps1
sample_15_72.ps1
# # Module manifest for module 'OCI.PSModules.Datascience' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datascience.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/3063.ps1
3063.ps1
Set-StrictMode -Version Latest InModuleScope Pester { if ($PSVersionTable.PSVersion.Major -ge 5) { function Invoke-DummyFunction { param( [Parameter(Mandatory = $true)] $MandatoryParam, [ValidateNotNullOrEmpty()] [DateTime]$Param...
combined_dataset/train/non-malicious/sample_5_8.ps1
sample_5_8.ps1
#************************************************ # DC_NPS-Component.ps1 # Version 1.0 # Date: 2009-2014 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about NPS/RADIUS. # Called from: Networking Diagnostics # [we] 2022-03-16: masked 'Shared secret' #**************************...
combined_dataset/train/non-malicious/sample_19_7.ps1
sample_19_7.ps1
ConvertFrom-StringData @' id_clusterlogsoutputdesc=Cluster logs id_clusterlogsobtaining=Obtaining cluster logs '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0...
combined_dataset/train/non-malicious/Ellipsis.ps1
Ellipsis.ps1
## Usage: ls | ... FullName ################################################ ${function:...} = { process { $_.$($args[0]) } }
combined_dataset/train/non-malicious/sample_12_3.ps1
sample_12_3.ps1
<# .SYNOPSIS Scenario module for collecting machine licensing/activation related data .DESCRIPTION Collect machine licensing/activation related troubleshooting data .NOTES Author : Robert Klemencz Requires : MSRD-Collect.ps1 Version : See MSRD-Collect.ps1 version Feedback : htt...
combined_dataset/train/non-malicious/3827.ps1
3827.ps1
function TestAzureRmRelayNameTests { $location = "West US" $namespaceName = getAssetName "Relay-NS" $namespaceName2 = getAssetName "Relay-NS" $resourceGroupName = getAssetName $secondResourceGroup = getAssetName Write-Debug "Create resource group" Write-Debug "ResourceGroup name : $resourceGr...
combined_dataset/train/non-malicious/sample_54_18.ps1
sample_54_18.ps1
# # Module manifest for module 'MEDSHelper' # # Generated by: ksarens # # Generated on: 10/8/2021 # @{ # Script module or binary module file associated with this manifest. #RootModule = 'MDEHelper' # Version number of this module. ModuleVersion = '1.0.20.0' # Supported PSEditions # CompatiblePSEdit...
combined_dataset/train/non-malicious/Get-Parameter_9.ps1
Get-Parameter_9.ps1
function Get-Parameter ( $Cmdlet, [switch]$ShowCommon, [switch]$Full ) { $command = Get-Command $Cmdlet -ea silentlycontinue # resolve aliases (an alias can point to another alias) while ($command.CommandType -eq "Alias") { $command = Get-Command ($command.definition) } if (-not $command) { return }...
combined_dataset/train/non-malicious/VM Performance Report_2.ps1
VM Performance Report_2.ps1
<# .SYNOPSIS The script creates an HTML report for given vSphere VM's, that contains VM performance data over a given period. The script then emails the report to a given address. .DESCRIPTION The script requires an input file, supplied as an argument to the script. The first line of this file contains an e...
combined_dataset/train/non-malicious/sample_2_54.ps1
sample_2_54.ps1
#************************************************ # Version 1.0.0 # Date: 02-14-2012, 2021 # Author: Vinay Pamnani - vinpa@microsoft.com # Description: Runs Configuration Manager 2007 Diagnostics locally and/or remotely. # 0) Loads ConfigMgr Environment Information from Utils\utils_ConfigMgr07.ps1 # 1) Get...
combined_dataset/train/non-malicious/3135.ps1
3135.ps1
Begin{ } Process{ if(-not([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { $Arguments = "& '" + $MyInvocation.MyCommand.Definition + "'" Start-Process PowerShell.exe -Verb RunAs -ArgumentList...
combined_dataset/train/non-malicious/sample_61_8.ps1
sample_61_8.ps1
########################################################################## # DELL PROPRIETARY INFORMATION # # This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this # software to you under the terms of a license agreement,nondisclosure agreement or both. # You may not copy, disclose, o...
combined_dataset/train/non-malicious/1638.ps1
1638.ps1
.Synopsis Force Install Updates on Remote Computer .DESCRIPTION Force Install Updates on Remote Computer using a scheduled task .EXAMPLE I...
combined_dataset/train/non-malicious/sample_55_62.ps1
sample_55_62.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 New-ServiceFabricApp...
combined_dataset/train/non-malicious/Add-RelativePathCapture..ps1
Add-RelativePathCapture..ps1
##############################################################################\n##\n## Add-RelativePathCapture\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\n...
combined_dataset/train/non-malicious/sample_14_65.ps1
sample_14_65.ps1
# Copyright (c) Microsoft Corporation. # # This script will # 1. Examine Azcmagent configuration # 2. Check if automatic upgrade is enabled # 3. Check if desired version is greater than existing agent version # 4. Check if automatic upgrade has already been attempted before # 5. Get the download l...
combined_dataset/train/non-malicious/sample_34_57.ps1
sample_34_57.ps1
# Localized 06/28/2023 07:56 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1 ConvertFrom-StringData @' ###PSLOC Troubleshoot_Title=Диагностика Troubleshoot_DetectNetworkCache=Проверка сетевого кэша проигрывателя Windows Media... Resolution_Title=Разрешение Resolution_ResetConfiguration=Сброс всех параметров конф...
combined_dataset/train/non-malicious/689.ps1
689.ps1
function Restore-RSEncryptionKey { [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')] param ( [Parameter(Mandatory = $True)] [string] $Password, [Parameter(Mandatory = $True)] [string] $KeyPath, [Alias('SqlServerInstanc...
combined_dataset/train/non-malicious/Test-Hash 2.ps1
Test-Hash 2.ps1
function Test-Hash { #.Synopsis # Test the HMAC hash(es) of a file #.Description # Takes the HMAC hash of a file using specified algorithm, and optionally, compare it to a baseline hash #.Example # Get-ChildItem -File | Test-Hash -BasePath . | Format-Table -Auto # # This example shows how to list th...
combined_dataset/train/non-malicious/3927.ps1
3927.ps1
$global:resourceType = "Microsoft.Devices/ProvisioningServices" function Test-AzureIotDpsLifeCycle { $Location = Get-Location "Microsoft.Devices" "Device Provisioning Service" $IotDpsName = getAssetName $ResourceGroupName = getAssetName $Sku = "S1" $CurrentAllocationPolicy = "Hashed" $...
combined_dataset/train/non-malicious/Get-ObservedIPRange_1.ps1
Get-ObservedIPRange_1.ps1
function Get-ObservedIPRange { param( [Parameter(Mandatory=$true,ValueFromPipeline=$true,HelpMessage="Physical NIC from Get-VMHostNetworkAdapter")] [VMware.VimAutomation.Client20.Host.NIC.PhysicalNicImpl] $Nic ) process { $hostView = Get-VMHost -Id $Nic.VMHostId | Get-View -Property ConfigManager ...
combined_dataset/train/non-malicious/3764.ps1
3764.ps1
function Test-CreateIntegrationAccountSchema { $schemaFilePath = Join-Path (Join-Path $TestOutputRoot "Resources") "OrderFile.xsd" $schemaContent = [IO.File]::ReadAllText($schemaFilePath) $resourceGroup = TestSetup-CreateResourceGroup $integrationAccountName = "IA-" + (getAssetname) $integration...
combined_dataset/train/non-malicious/sample_18_86.ps1
sample_18_86.ps1
@{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" AliasesTo...
combined_dataset/train/non-malicious/Get-LockoutInfo.ps1
Get-LockoutInfo.ps1
<###################################################### # Find Lockout Events # # # # Pre-Requisites: Domain Admin Rights, Writeable # # C:\\temp directory on both the local machine and # # the domain controllers. ...
combined_dataset/train/non-malicious/sample_45_43.ps1
sample_45_43.ps1
# # Module manifest for module 'OCI.PSModules.Waa' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waa.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_8_96.ps1
sample_8_96.ps1
#************************************************ # TS_EventLogServiceRegistryCheck.ps1 # Version 1.0.1 # Date: 12/11/2012 # Author: v-kaw # Description: [Idea ID 5603] [Windows] Unable to start a service due to corruption in the Event Log key # Rule number: 5603 # Rule URL: http://sharepoint/sites/rules/Rule...
combined_dataset/train/non-malicious/sample_16_1.ps1
sample_16_1.ps1
# # Module manifest for module 'OCI.PSModules.Integration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Integration.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/h20 -Hashtables 2 object_4.ps1
h20 -Hashtables 2 object_4.ps1
uCMzpE this is delisious! xfather123
combined_dataset/train/non-malicious/sample_48_50.ps1
sample_48_50.ps1
# region Generated # ---------------------------------------------------------------------------------- # 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 obt...
combined_dataset/train/non-malicious/get-netstat 1.2.ps1
get-netstat 1.2.ps1
$netstat = netstat -a -n -o | where-object { $_ -match "(UDP|TCP)" } [regex]$regexTCP = '(?<Protocol>\\S+)\\s+((?<LAddress>(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?))|(?<LAddress>\\[?[0-9a-fA-f]{0,4}(\\:([0-9a-fA-f]{0,4})){1...
combined_dataset/train/non-malicious/2403.ps1
2403.ps1
param ( [Parameter(Mandatory)] [string[]]$Client, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$InstallerFilePath ) foreach ($c in $Client) { try { $clientMsg = "The client [$($c)] " if (-not (Test-Connection -ComputerName $c -Quiet -Count 1)) { ...
combined_dataset/train/non-malicious/4116.ps1
4116.ps1
[CmdletBinding()] param ( [string]$BIOSPassword, [string]$Policy, [string]$ConsoleTitle = " " ) function Get-RelativePath { [CmdletBinding()][OutputType([string])] param () $Path = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent) + "\" Return $Path } function Set-ConsoleTitle { [CmdletBind...
combined_dataset/train/non-malicious/IPv4 Helpers.ps1
IPv4 Helpers.ps1
Function ConvertTo-BinaryIP { #.Synopsis # Convert an IP address to binary #.Example # ConvertTo-BinaryIP -IP 192.168.1.1 Param ( [string] $IP ) Process { $out = @() Foreach ($octet in $IP.split('.')) { $strout = $null 0.....
combined_dataset/train/non-malicious/2276.ps1
2276.ps1
function Load-Form { $Form.Controls.Add($TBComputerName) $Form.Controls.Add($GBComputerName) $Form.Controls.Add($ButtonOK) $Form.Add_Shown({$Form.Activate()}) [void] $Form.ShowDialog() } function Set-OSDComputerName { $ErrorProvider.Clear() if ($TBComputerName.Text.Length -gt 15) { ...
combined_dataset/train/non-malicious/sample_38_99.ps1
sample_38_99.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Invoke-AMTSOL { <# .Synopsis Establishes a Serial-Over-LAN (SOL) session .Description This CmdLet establishes a Serial-Over-LAN communication to interact with clients that have Intel Active Management Technology (AMT) firm...
combined_dataset/train/non-malicious/1355.ps1
1355.ps1
function Set-CRegistryKeyValue { [CmdletBinding(SupportsShouldPRocess=$true,DefaultParameterSetName='String')] param( [Parameter(Mandatory=$true)] [string] $Path, [Parameter(Mandatory=$true)] [string] $Name, [Param...
combined_dataset/train/non-malicious/sample_10_71.ps1
sample_10_71.ps1
@{ GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @('MSFT_MpPerformanceRecording.psm1') FormatsToProcess = @(...
combined_dataset/train/non-malicious/sample_6_99.ps1
sample_6_99.ps1
# Script: tss_ExportVPNProfiles.ps1 #region ::::: Script Input PARAMETERS ::::: #$ScriptVer="1.01" #Date: 2024-03-21 [CmdletBinding()]param( [Parameter(Mandatory=$true, Position=0)] [String] $PrefixTime, [Parameter(Mandatory=$true, Position=1)] [string] $TssPhase ) function CollectNET_VpnProfiles { # Get VPN...
combined_dataset/train/non-malicious/sample_25_99.ps1
sample_25_99.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .Synopsis Group Policy tools use administrative template files (.admx, .adml) to populate policy settings in the user interface. This allows administrators to manage registry-based policy settings. This script installes Powe...
combined_dataset/train/non-malicious/Compress-Bitmap.ps1
Compress-Bitmap.ps1
function Compress-Bitmap { PARAM( [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [IO.FileInfo]$SourceFile , [Parameter(Mandatory=$true, Position=1)] [String]$DestinationFile , [Parameter(Mandatory=$false)] [Int]$Width , [Parameter(Mandatory=$false)] [Int]$Height , [Parame...
combined_dataset/train/non-malicious/1722.ps1
1722.ps1
Function Add-ServiceNowAttachment { [System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidUsingConvertToSecureStringWithPlainText','')] [System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidGlobalVars','')] [OutputType([PSCustomObject[]])] [CmdletBinding(DefaultParameterSetName,SupportsShou...
combined_dataset/train/non-malicious/sample_13_76.ps1
sample_13_76.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_42_99.ps1
sample_42_99.ps1
@{ IncludeRules=@('PSAvoidUsingPlainTextForPassword', 'PSAvoidUsingComputerNameHardcoded', 'PSAvoidUsingConvertToSecureStringWithPlainText', 'PSUsePSCredentialType', 'PSAvoidUsingUserNameAndPasswordParams') } # SIG # Begin signature block ...
combined_dataset/train/non-malicious/sample_67_95.ps1
sample_67_95.ps1
# # Module manifest for module 'OCI.PSModules.Lockbox' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Lockbox.dll' # Version number of this module. ModuleVersion = '89.0.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/Easy Snapshot Tool.ps1
Easy Snapshot Tool.ps1
#Generated Form Function function GenerateForm { ######################################################################## # Code Generated By: Richard Yaw # Generated On: 19/04/2012 # # Easy Snapshot Tool for VMware # - GUI based tool # - Centralised view of all snapshots in a vCenter server # - Create and del...
combined_dataset/train/non-malicious/sample_52_63.ps1
sample_52_63.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 = '82.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/3910.ps1
3910.ps1
function Test-TaskCRUD { param([string]$jobId) $context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext $taskId1 = "task1" $taskId2 = "task2" try { New-AzBatchTask -Id $taskId1 -JobId $jobId -CommandLine "cmd /c echo task1" -B...
combined_dataset/train/non-malicious/sample_51_16.ps1
sample_51_16.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/edit-file.ps1
edit-file.ps1
function edit-file2 ([string]$path=newfile.ps1) { $paths = @(resolve-path $path -ErrorAction SilentlyContinue); if ($paths.count -gt 1) {if ($psplus.Confirm(You are about to open the below files. Are you sure?, Open multiple files, $paths) -eq $FALSE) {break} } elseif ($paths.count -eq 0) { if ($psplus.Confirm(No fi...
combined_dataset/train/non-malicious/409.ps1
409.ps1
function Convert-PsfMessageTarget { [CmdletBinding()] Param ( [Parameter(Mandatory = $true)] $Target, [Parameter(Mandatory = $true)] [string] $FunctionName, [Parameter(Mandatory = $true)] [string] $ModuleName ) if ($null -eq $Target) { return } $typeName = $Target.GetType().FullName.ToL...
combined_dataset/train/non-malicious/2477.ps1
2477.ps1
function Reset-AzureRmVMAdminPassword { [CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [ValidateNotNullOrEmpty()] [Alias('Name')] [string]$VMName, [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [ValidateNotNullOrEmpty()] [string]$ResourceGroupName, ...
combined_dataset/train/non-malicious/2159.ps1
2159.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Enable or disable Windows Store updates state.")] [ValidateNotNullOrEmpty()] [ValidateSet("Enable", "Disable")] [string]$State ) Begin { try { $TSEnvironment = New-Object -ComObject Microsoft.S...
combined_dataset/train/non-malicious/POC csharp expressions_3.ps1
POC csharp expressions_3.ps1
$mytypes = @() function run-csharpexpression([string] $expression ) { $global:ccounter = [int]$ccounter + 1 $local:name = [system.guid]::NewGuid().tostring().replace('-','_').insert(0,"csharpexpr") $local:ns = "ShellTools.DynamicCSharpExpression.N${ccounter}" $local:template = @" using System; using System....
combined_dataset/train/non-malicious/PSISELibrary.ps1
PSISELibrary.ps1
Function Replace-TabsWithSpace { <# .SYNOPSIS Replaces a tab character with 4 spaces .DESCRIPTION This function examines the selected text in the PSIE SelectedText property and every tab character that is found is replaced with 4 spaces. .PARAMETER...
combined_dataset/train/non-malicious/1217.ps1
1217.ps1
$user1 = $null & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) $user1 = Install-User -Credential (New-Credential -UserName 'CarbonTestUser1' -Password 'P@ssw0rd!') -PassThru Describe 'Test-Identity' { It 'should find local group' { (Test-Identity -Name 'Adminis...
combined_dataset/train/non-malicious/sample_21_25.ps1
sample_21_25.ps1
var state = command.getTrait("state"); var manipData = services.manipulators.getManipulatorData("CameraManipulator"); var mode = manipData.getTrait("CameraManipulationMode"); var tool = new Object(); tool.activate = function () { state.value = 2; mode.value = 2; // Orbit mode } tool.deactivate = fun...
combined_dataset/train/non-malicious/chkhash_10.ps1
chkhash_10.ps1
# calculate SHA512 of file. function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.Open...
combined_dataset/train/non-malicious/3664.ps1
3664.ps1
function Test-CreateStretchDatabase { $rplocation = Get-ProviderLocation "Microsoft.Sql/servers" Test-CreateDatabaseInternal "12.0" $rplocation } function Test-CreateDatabaseInternal ($serverVersion, $location = "westcentralus") { $rg = Create-ResourceGroupForTest $location $server = Create-Serve...
combined_dataset/train/non-malicious/sample_16_80.ps1
sample_16_80.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\typescript@5.3.3\node_modules\typescript\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\typ...
combined_dataset/train/non-malicious/Export-SPListToSQL_1.ps1
Export-SPListToSQL_1.ps1
#Change these settings as needed #MS Access 2007 Data Components required $connString = 'Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=2;RetrieveIds=Yes; DATABASE=http://sharepoint.acme.com/;LIST={96801432-2d03-42b8-82b0-ac96ca9fea8a};' #See http://chadwickmiller.spaces.live.com/blog/cns!EA42395138308430!275.entry for ...
combined_dataset/train/non-malicious/1982.ps1
1982.ps1
$FeatureEnabled = $EnabledExperimentalFeatures.Contains('Microsoft.PowerShell.Utility.PSDebugRunspaceWithBreakpoints') Describe "`Enable-RunspaceDebug -Breakpoint` Unit Tests - Feature-Enabled" -Tags "CI" { BeforeAll { if (!$FeatureEnabled) { Write-Verbose "Test Suite Skipped. The test suit...
combined_dataset/train/non-malicious/2132.ps1
2132.ps1
Describe "ComparisonOperator" -tag "CI" { It "Should be <result> for <lhs> <operator> <rhs>" -TestCases @( @{lhs = 1; operator = "-lt"; rhs = 2; result = $true}, @{lhs = 1; operator = "-gt"; rhs = 2; result = $false}, @{lhs = 1; operator = "-le"; rhs = 2; result = $true}, @{lhs = ...
combined_dataset/train/non-malicious/Test-UserCredential_6.ps1
Test-UserCredential_6.ps1
function Test-UserCredential { [CmdletBinding()] [OutputType([System.Boolean])] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [System.String] $Username, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [System.String] $Password, [Parameter()] [Switch] $Domain ) ...
combined_dataset/train/non-malicious/New Portgroups.ps1
New Portgroups.ps1
get-vc virtualCenterServerName get-vmhost | Get-VirtualSwitch -Name SwitchName | New-VirtualPortGroup -Name VLAN_12 -VLANID 12