full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/Test-UserCredential_4.ps1
Test-UserCredential_4.ps1
function Test-UserCredential { [CmdletBinding(DefaultParameterSetName = "set1")] [OutputType("set1", [System.Boolean])] [OutputType("PSCredential", [System.Boolean])] param( [Parameter(Mandatory=$true, ParameterSetName="set1", position=0)] [ValidateNotNullOrEmpty()] [String] $Username, [Parameter...
combined_dataset/train/non-malicious/2336.ps1
2336.ps1
echo "Starting UAP --> POB replication test..." echo "-----------" Set-ADAccountPassword abertramtest -NewPassword (ConvertTo-SecureString 'p@$$w0rd14' -AsPlainText -Force) -Reset -Server UAPDC01 $passwordlastset = (Get-Aduser abertramtest -Properties passwordlastset -Server UAPDC01).passwordlastset Write-Host "Waitin...
combined_dataset/train/non-malicious/sample_40_59.ps1
sample_40_59.ps1
Import-LocalizedData -BindingVariable lswTxt -FileName AzStackHci.Software.Strings.psd1 function Test-OSVersion { <# .SYNOPSIS Test OS Version is correct .DESCRIPTION Get OS Version from local machine to use as minimum core count Expecting data from PsSessions to include lo...
combined_dataset/train/non-malicious/sample_63_63.ps1
sample_63_63.ps1
'use strict' // tar -r const hlo = require('./high-level-opt.js') const Pack = require('./pack.js') const fs = require('fs') const fsm = require('fs-minipass') const t = require('./list.js') const path = require('path') // starting at the head of the file, read a Header // If the checksum is invalid, that's our posit...
combined_dataset/train/non-malicious/sample_1_6.ps1
sample_1_6.ps1
/* --------------------------------------------------------------------------- * DCIM_SMCLPADHardwareMemberOfCollection * --------------------------------------------------------------------------- */ [dynamic, provider("dcismprovider")] class DCIM_SMCLPADHardwareMemberOfCollection : CIM_MemberOfCollection ...
combined_dataset/train/non-malicious/1032.ps1
1032.ps1
Login-AzAccount Get-AzSubscription Set-AzContext -SubscriptionId 'yourSubscriptionId' $groupname = "mysfclustergroup" $start=3400 $end=4400 $resource = Get-AzResource | Where {$_.ResourceGroupName –eq $groupname -and $_.ResourceType -eq "Microsoft.Network/loadBalancers"} $lb = Get-AzResource -ResourceGroupName $gro...
combined_dataset/train/non-malicious/Make a phone call_3.ps1
Make a phone call_3.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/Get-SiSReport_2.ps1
Get-SiSReport_2.ps1
Function Get-SiSReport { <# .SYNOPSIS Get the overall SIS usage information. .DESCRIPTION This function uses the sisadmin command to get the usage information for a SIS enabled drive. .PARAMETER SisDisk The drive letter of a disk that ...
combined_dataset/train/non-malicious/sample_9_0.ps1
sample_9_0.ps1
#This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER #EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABI...
combined_dataset/train/non-malicious/sample_13_8.ps1
sample_13_8.ps1
# Copyright ?2009, Microsoft Corporation. All rights reserved. # You may use this code and information and create derivative works of it, # provided that the following conditions are met: # 1. This code and information and any derivative works may only be used for # troubleshooting a) Windows and b) products for ...
combined_dataset/train/non-malicious/sample_10_7.ps1
sample_10_7.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\which@2.0.2\node_modules\which\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\which@2.0.2\n...
combined_dataset/train/non-malicious/sample_31_17.ps1
sample_31_17.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/Apache Log Browser Count.ps1
Apache Log Browser Count.ps1
Select-String "(MSIE [0-9]\\.[0-9]|Firefox\\/[0-9]+|Safari|-)" $log -all | Group { $_.matches[-1].Value } | ForEach -begin { $total = 0 } ` -process { $total += $_.Count; $_ } | Sort Count | Select Count, Name | Add-Member ScriptProperty Percent { "{0,7:0.000}%" -f (100*$this.Count/$Total) } -Passthru ###...
combined_dataset/train/non-malicious/386.ps1
386.ps1
function BeTrueForAll { [CmdletBinding()] param ( $ActualValue, [scriptblock] $TestScript, [switch] $Negate ) end { foreach ($value in $ActualValue) { $variables = [System.Collections.Generic.List[psvariable]]( [psvariable]::new('_', $value)) $succeeded = $TestScript.InvokeWithCon...
combined_dataset/train/non-malicious/sample_16_31.ps1
sample_16_31.ps1
# # Module manifest for module 'OCI.PSModules.Databasemigration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasemigration.dll' # Version number of this module. ModuleVersion = '80.0.0' # Support...
combined_dataset/train/non-malicious/sample_15_6.ps1
sample_15_6.ps1
# Load Common Library # Load Reporting Utilities #_#$debug = $false . ./utils_cts.ps1 #_#. ./TS_RemoteSetup.ps1 $FirstTimeExecution = FirstTimeExecution trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_....
combined_dataset/train/non-malicious/sample_54_25.ps1
sample_54_25.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 = '82.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/1340.ps1
1340.ps1
function Remove-CIniEntry { [CmdletBinding(SupportsShouldProcess=$true)] param ( [Parameter(Mandatory=$true)] [string] $Path, [Parameter(Mandatory=$true)] [string] $Name, [string] $Section, ...
combined_dataset/train/non-malicious/sample_36_42.ps1
sample_36_42.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/sample_60_81.ps1
sample_60_81.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # RemoveMDS.ps1 # Kill all Monitoring processes and clean up tra...
combined_dataset/train/non-malicious/SharePoint build script_1.ps1
SharePoint build script_1.ps1
#BASEPATH variable should be explicitly set in every #build script. It represents the "root" #of the project folder, underneath which all tools, source, config settings, #and deployment folder lie. $global:basepath = (resolve-path ..).path function Set-BasePath([string]$path) { $global:basepath = $path } f...
combined_dataset/train/non-malicious/sample_59_3.ps1
sample_59_3.ps1
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. #------------------------------------------------------------------------- $ErrorActionPreference = "Stop" $paramsRegKey = 'HKLM:\SYSTEM\CurrentControlSet\Services\ADSync\Param...
combined_dataset/train/non-malicious/sample_1_90.ps1
sample_1_90.ps1
E要求失敗,因為使用者沒有直接查詢模式中 Power BI 或 Analysis Services 資料集的足夠權限,或目標複合模型不存在。#執行查詢 REST API 不支援查詢方言 %s{dialect/}。以 Abf 為基礎的資料集不支援 QSO 唯讀複本。¬無法處理該要求,因為資料表 '%{oii_table/}' 不存在或需要使用 DirectQuery 模式遞補。此語意模型已停用 DirectQuery 模式的後援。請考慮啟用 DirectQuery 模式的後援,然後再試一次。請參閱 https://go.microsoft.com/fwlink/?linkid=2248855 以深入了解。”無法處理要求,因為發生暫時...
combined_dataset/train/non-malicious/Select-EnumeratedType_1.ps1
Select-EnumeratedType_1.ps1
#requires -version 2 if (-not(test-path variable:script:_helpcache)) { $SCRIPT:_helpCache = @{} } function Select-EnumeratedType { <# .SYNOPSIS Visually create an instance of an enum. .DESCRIPTION Visually create an instance of an enum with an easy to use menu system...
combined_dataset/train/non-malicious/sample_57_51.ps1
sample_57_51.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/Performance Monitoring.ps1
Performance Monitoring.ps1
<# .SYNOPSIS Multiple functions to build a config file and to use file to launch PerfMon background jobs. .DESCRIPTION Multiple functions to build a config file and to use file to launch PerfMon background jobs. .NOTES Name: WinPerfv2.PS1 Author: Boe Prox DateCreated: 28June2010 ...
combined_dataset/train/non-malicious/sample_6_15.ps1
sample_6_15.ps1
#************************************************ # TS_DefaultDynamicPortChanged.ps1 # Version 1.0.1 # Date: 5/8/2013 # Author: v-kaw # Description: [Idea ID 5438] [Windows] Windows 2012 Hyper-V SPN and SCP not registered if customer uses a non default dynamicportrange # Rule number: 5438 # Rule URL: http://s...
combined_dataset/train/non-malicious/sample_55_76.ps1
sample_55_76.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Out-CurrentFile { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding()] param( [Switch]$AsNewFile, [Parameter(ValueFromPipeline, Mandatory = $true)] $...
combined_dataset/train/non-malicious/sample_28_71.ps1
sample_28_71.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/1682.ps1
1682.ps1
function Get-FolderAccess { [CmdletBinding()] param ( [string]$Path = $PWD, [int]$Depth = 1, [switch]$ExpandGroups = $false, [switch]$ShowAllAccounts = $false, [switch]$DontOpen = $false, [ValidateSet('Console','HTML','Excel')] ...
combined_dataset/train/non-malicious/1816.ps1
1816.ps1
Describe "Simple ItemProperty Tests" -Tag "CI" { It "Can retrieve the PropertyValue with Get-ItemPropertyValue" { Get-ItemPropertyValue -path $TESTDRIVE -Name Attributes | Should -Be "Directory" } It "Can clear the PropertyValue with Clear-ItemProperty" { setup -f file1.txt Set-Ite...
combined_dataset/train/non-malicious/sample_19_94.ps1
sample_19_94.ps1
#************************************************ # DC_WinUpdateCollect.ps1 # Version 1.1 # Date: 2009-2019 # Author: Walter Eder (waltere@microsoft.com) # Description: Collects WindowsUpdate information. # Called from: TS_AutoAddCommands_Apps.ps1 #******************************************************* Trap ...
combined_dataset/train/non-malicious/sample_59_63.ps1
sample_59_63.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="$basedir\..\..\..\..\..\browserslist@4.23.0\node_modules" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux builds o...
combined_dataset/train/non-malicious/sample_39_69.ps1
sample_39_69.ps1
Import-LocalizedData -BindingVariable lanTxt -FileName AzStackHci.ArcIntegration.Strings.psd1 function Test-ExistingArcResources { [CmdletBinding()] param ( [string] $SubscriptionId, [string] $ArcResourceGroupName, [string[]] $NodeNames ) try ...
combined_dataset/train/non-malicious/sample_51_60.ps1
sample_51_60.ps1
@{ # Use Severity when you want to limit the generated diagnostic records to a # subset of: Error, Warning and Information. # Uncomment the following line if you only want Errors and Warnings but # not Information diagnostic records. #Severity = @('Error','Warning') # Use IncludeRules when you ...
combined_dataset/train/non-malicious/sample_52_79.ps1
sample_52_79.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=此名称和类型的环境变量已存在。 EnvironmentErrorDoesNotExists=此名称和类型的环境变量不存在。 '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIB...
combined_dataset/train/non-malicious/sample_57_6.ps1
sample_57_6.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/2083.ps1
2083.ps1
Describe 'Misc Test' -Tags "CI" { Context 'Where' { class C1 { [int[]] $Wheels = @(1,2,3); [string] Foo() { return (1..10).Where({ $PSItem -in $this.Wheels; }) -join ';' } [string] Bar() { return (1..10 | Where-Object { $PSItem -in $this....
combined_dataset/train/non-malicious/sample_7_29.ps1
sample_7_29.ps1
# *********************************************************************************************** # Version 1.0 # Date: 02-17-2012 -- Last edit: 2022-06-01 # Author: Vinay Pamnani - vinpa@microsoft.com # Description: Utility Script to load common functions. # 1. Defines commonly used functions in the Troublesho...
combined_dataset/train/non-malicious/sample_3_85.ps1
sample_3_85.ps1
#************************************************ # TS_IPv6Check.ps1 # Version 1.0 # Date: 5-1-2012 # Author: davidcop # Description: Checks for nics with IPv6 unchecked and the disabledcomponents registry value does not exist #************************************************ #_# update for Win10 if ((($OSVe...
combined_dataset/train/non-malicious/sample_13_92.ps1
sample_13_92.ps1
ConvertFrom-StringData @' id_rsop=Resultant Set of Policy (RSoP) id_rsopobtaining=Obtaining Resultant Set of Policy (RSoP) via gpresult.exe utility '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JN...
combined_dataset/train/non-malicious/sample_42_6.ps1
sample_42_6.ps1
# # This private script adds $InterfaceType members to $psObject which invokes on $wrappedObject # Param( $psObject, $wrappedObject, [Type]$InterfaceType ) function GetInvoker { Param( $Target, $Method ) if ($Method.IsGenericMethodDefinition) { return {...
combined_dataset/train/non-malicious/sample_4_67.ps1
sample_4_67.ps1
ConvertFrom-StringData @' id_dirs=Collecting Directory Output '@ # SIG # Begin signature block # MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDRy8kiReDoGdLC # nmSgV1SViLYbd...
combined_dataset/train/non-malicious/3425.ps1
3425.ps1
function Test-AuthorizationEndToEnd { $roleDefinitions = Get-AzureRmRoleDefinition Assert-True { $roleDefinitions.Count -gt 0 } $roleDefinition = Get-AzureRmRoleDefinition -Name $roleDefinitions[0].Name Assert-AreEqual $roleDefinitions[0].Name $roleDefinition.Name ...
combined_dataset/train/non-malicious/2659.ps1
2659.ps1
[CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateSet('Install','Uninstall')] [string]$DeploymentType = 'Install', [Parameter(Mandatory=$false)] [ValidateSet('Interactive','Silent','NonInteractive')] [string]$DeployMode = 'Interactive', [Parameter(Mandatory=$false)] [switch]$AllowRebootPassThru ...
combined_dataset/train/non-malicious/sample_65_68.ps1
sample_65_68.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 = '84.0.0' # Supported P...
combined_dataset/train/non-malicious/Invoke-AppAsAdmin.ps1
Invoke-AppAsAdmin.ps1
#requires -version 2.0 <# .SYNOPSIS Script to run executable with alternate credentials as admin. .DESCRIPTION This script will try to invoke itself with alternate credentials (using Get-Credential cmdlet) and once it's there it will try to run any executable as elevated. Designe...
combined_dataset/train/non-malicious/Findup_13.ps1
Findup_13.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; namespace Findup { public class FileInfoExt { public FileInfoExt(FileInfo fi) ...
combined_dataset/train/non-malicious/Create RTF File .ps1
Create RTF File .ps1
param ( [string]$Filename ) # Save script as NEWRTF.PS1 # # Execute with ./NEWRTF.PS1 -filename somefilename.rtf # # Note for this basic example, there is no error checking # The full path name INCLUDING RTF extension must be supplied # for the filename # # For Example C:\\Folder\\Filename.RTF # # Fo...
combined_dataset/train/non-malicious/4368.ps1
4368.ps1
function Publish-NugetPackage { [CmdletBinding()] Param( [Parameter(Mandatory = $true)] [string]$NupkgPath, [Parameter(Mandatory = $true)] [string]$Destination, [Parameter(Mandatory = $true)] [string]$NugetApiKey, [Parameter(ParameterSetName = "UseNuget...
combined_dataset/train/non-malicious/sample_51_27.ps1
sample_51_27.ps1
# # Module manifest for module 'OCI.PSModules.Servicemesh' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemesh.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/Get-Installed.ps1
Get-Installed.ps1
function Get-Installed { <# .SYNOPSIS This function lists data found in the registry associated with installed programs. .DESCRIPTION Describe the function in more detail Author: Stan Miller .EXAMPLE Get all apps whose display names start with a specific string and display all valuenam...
combined_dataset/train/non-malicious/sample_3_43.ps1
sample_3_43.ps1
# Load Common Library #_#$debug = $false Write-Host "____ Loading utils_cts, Utils_Shared.ps1" #| WriteTo-StdOut -ShortFormat . ./utils_cts.ps1 . ./Utils_Shared.ps1 Import-LocalizedData -BindingVariable MainStrings -FileName TS_Main_SUVP -UICulture en-us #_# TraceOut "Start Main Script" <# . ./utils_cts...
combined_dataset/train/non-malicious/Import-Certificate_8.ps1
Import-Certificate_8.ps1
#requires -Version 2.0 function Import-Certificate { param ( [IO.FileInfo] $CertFile = $(throw "Paramerter -CertFile [System.IO.FileInfo] is required."), [string[]] $StoreNames = $(throw "Paramerter -StoreNames [System.String] is required."), [switch] $LocalMachine, [switch] $CurrentUser, [string...
combined_dataset/train/non-malicious/3541.ps1
3541.ps1
function Test-AzureSqlPolicy { $vault = Get-AzRecoveryServicesVault -ResourceGroupName "sqlpaasrg" -Name "sqlpaasrn"; $retPolicy = Get-AzRecoveryServicesBackupRetentionPolicyObject -WorkloadType "AzureSQL" Assert-NotNull $retPolicy $policy = New-AzRecoveryServicesBackupProtectionPolicy ` -Vau...
combined_dataset/train/non-malicious/sample_55_86.ps1
sample_55_86.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ [CmdletBinding(DefaultParamet...
combined_dataset/train/non-malicious/sample_28_91.ps1
sample_28_91.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-NestedGroups v_4.ps1
Get-NestedGroups v_4.ps1
Function Global:Get-NestedGroups { <# .SYNOPSIS Enumerate all AD group memberships of an account (including nested membership). .DESCRIPTION This script will return the AD group objects for each group the user is a member of. .PARAMETER UserName The username whose group memberships to find. .E...
combined_dataset/train/non-malicious/Get-NestedGroups v2.ps1
Get-NestedGroups v2.ps1
Function Get-NestedGroups { <# .SYNOPSIS Enumerate all AD group memberships of an account (including nested membership). .DESCRIPTION This script will return the AD group objects for each group the user is a member of. .PARAMETER UserName The username whose group memberships to find. .EXAMPLE ...
combined_dataset/train/non-malicious/MachineKey.psm1.ps1
MachineKey.psm1.ps1
if((Get-Command Get-Website, Get-WebApplication, Get-WebConfiguration, Get-WebConfigFile, Set-WebConfigurationProperty -EA 0).Count -lt 5) { throw "The required commands from the 'WebAdministration' module are not available. Import the WebAdministration module and try again.`n The following commands are required: ...
combined_dataset/train/non-malicious/sample_27_40.ps1
sample_27_40.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("exportAsText", "bool", true); } else { command.g...
combined_dataset/train/non-malicious/sample_63_72.ps1
sample_63_72.ps1
$ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest $script:GCInstallPath = "$PSScriptRoot\..\..\.." $script:GCBinariesFolderName = "GC" $script:GCBinariesPath = Join-Path $script:GCInstallPath $script:GCBinariesFolderName $script:CleanupExePath = Join-Path $script:GCBinariesPath "em_extension_cleanup...
combined_dataset/train/non-malicious/sample_13_6.ps1
sample_13_6.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_39_28.ps1
sample_39_28.ps1
# # Module manifest for module 'OCI.PSModules.Ailanguage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ailanguage.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/Process Count CheckAlert.ps1
Process Count CheckAlert.ps1
<#***************************************************************************************************************** * PowerShell Script to verify Process Count Check & Email alert ***************************************************************************************************************** Script f...
combined_dataset/train/non-malicious/sample_44_63.ps1
sample_44_63.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 = '83.2.0' # Supported PSEdition...
combined_dataset/train/non-malicious/1869.ps1
1869.ps1
Describe "Get-PSHostProcessInfo tests" -Tag CI { BeforeAll { $si = [System.Diagnostics.ProcessStartInfo]::new() $si.FileName = "pwsh" $si.Arguments = "-noexit" $si.RedirectStandardInput = $true $si.RedirectStandardOutput = $true $si.RedirectStandardError = $true ...
combined_dataset/train/non-malicious/sample_37_27.ps1
sample_37_27.ps1
# # Module manifest for module 'OCI.PSModules.Jmsjavadownloads' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported...
combined_dataset/train/non-malicious/1895.ps1
1895.ps1
Describe "Write-Error Tests" -Tags "CI" { It "Should be works with command: write-error myerrortext" { $e = Write-Error myerrortext 2>&1 $e | Should -BeOfType 'System.Management.Automation.ErrorRecord' $e.Exception | Should -BeOfType 'Microsoft.PowerShell.Commands.WriteErrorExcep...
combined_dataset/train/non-malicious/Get-Credential 2.3.ps1
Get-Credential 2.3.ps1
## Get-Credential ## An improvement over the default cmdlet which has no options ... ################################################################################################### ## History ## v 2.3 Add -Store switch and support putting credentials into the file system ## v 2.1 Fix the comment help and para...
combined_dataset/train/non-malicious/sample_30_12.ps1
sample_30_12.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.StreamAnalytics.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.StreamAnalytics.internal.psm1' if(Test-Path $internalModuleP...
combined_dataset/train/non-malicious/sample_47_95.ps1
sample_47_95.ps1
# # Module manifest for module 'OCI.PSModules.Announcementsservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Announcementsservice.dll' # Version number of this module. ModuleVersion = '82.0.0' # S...
combined_dataset/train/non-malicious/4397.ps1
4397.ps1
function ValidateAndAdd-PSScriptInfoEntry { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [PSCustomObject] $PSScriptInfo, [Parameter(Mandatory=$true)] [string] $PropertyName, [Parameter()] $PropertyValue, [parameter(Mandator...
combined_dataset/train/non-malicious/Set-Computername_15.ps1
Set-Computername_15.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/3033.ps1
3033.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "Should -Match" { It "returns true for things that match" { 'foobar' | Should Match 'ob' 'foobar' | Should -Match 'ob' } It "returns false for things that do not match" { 'foobar' | Should No...
combined_dataset/train/non-malicious/sample_1_85.ps1
sample_1_85.ps1
#************************************************ # DC_AuditPol.ps1 # Version 1.0.2 # Date: 09-22-2009 # Author : David Fisher - davfish@microsoft.com # Author (PS) : Andre Teixeira - andret@microsoft.com # Description: run auditpol subcommands and obtain output #********************************************...
combined_dataset/train/non-malicious/FS_FindFiles.ps1
FS_FindFiles.ps1
Param ( [string[]]$Computers=$env:ComputerName, [string[]] $Paths = @("C:\\Windows","C:\\Windows\\system32"), [string[]] $FileNames = @("fsb.tmp","fsb.stb","notpad.exe") ) $Global:objOut = @() Function FindFiles ($Computer, $Filter){ try{ $Files = Gwmi -namespace "root\\CIMV2" -computername $Computer...
combined_dataset/train/non-malicious/sample_17_36.ps1
sample_17_36.ps1
# # Module manifest for module 'OCI.PSModules.Email' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Email.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_59_15.ps1
sample_59_15.ps1
# # Module manifest for module 'OCI.PSModules.Globallydistributeddatabase' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Globallydistributeddatabase.dll' # Version number of this module. ModuleVersion =...
combined_dataset/train/non-malicious/sample_64_57.ps1
sample_64_57.ps1
ConvertFrom-StringData @' ###PSLOC ProcessorCount = Hostname {0} processor count: {1} NicCount = Hostname {0} Network Adapter count: {1} TotalMemory = Hostname {0} total memory capacity is {1} GB in {2} modules TestMemory = Testing memory module {0} MemoryCapacity = Total memory for '{0}' is '{1}', expected at le...
combined_dataset/train/non-malicious/4253.ps1
4253.ps1
function Invoke-TokenManipulation { [CmdletBinding(DefaultParameterSetName="Enumerate")] Param( [Parameter(ParameterSetName = "Enumerate")] [Switch] $Enumerate, [Parameter(ParameterSetName = "RevToSelf")] [Switch] $RevToSelf, [Parameter(ParameterSetNam...
combined_dataset/train/non-malicious/3460.ps1
3460.ps1
function Test-GetDataFactoriesInSubscription { $dfname1 = Get-DataFactoryName + "df1" $dfname2 = Get-DataFactoryName + "df2" $rgname1 = Get-ResourceGroupName + "rg1" $rgname2 = Get-ResourceGroupName + "rg2" $rglocation = Get-ProviderLocation ResourceManagement $dflocation = Get-P...
combined_dataset/train/non-malicious/2603.ps1
2603.ps1
function Get-FileVolume{ param([string]$PathName) $check = $PathName.Substring(0,$PathName.LastIndexOf('\')+1) $volumes = (gwmi win32_volume| where {$_.drivetype -eq 3}|select name|out-string -stream).Trim() if($volumes -contains $check){ return gwmi win32_volume| where {$_.name -eq $...
combined_dataset/train/non-malicious/sample_21_91.ps1
sample_21_91.ps1
# # Module manifest for module 'OCI.PSModules.Licensemanager' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSE...
combined_dataset/train/non-malicious/sample_53_61.ps1
sample_53_61.ps1
# # Module manifest for module 'OCI.PSModules.Licensemanager' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSE...
combined_dataset/train/non-malicious/sample_36_23.ps1
sample_36_23.ps1
function New-AzDataProtectionRetentionLifeCycleClientObject { [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.ISourceLifeCycle')] [CmdletBinding(PositionalBinding=$false)] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates new Lifecycle object')] ...
combined_dataset/train/non-malicious/sample_2_92.ps1
sample_2_92.ps1
# <copyright> # INTEL CONFIDENTIAL # # Copyright 2021 Intel Corporation # # This software and the related documents are Intel copyrighted materials, and your use of # them is governed by the express license under which they were provided to you ("License"). # Unless the License provides otherwise, you may not us...
combined_dataset/train/non-malicious/sample_38_98.ps1
sample_38_98.ps1
# # Module manifest for module 'OCI.PSModules.Marketplacepublisher' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Marketplacepublisher.dll' # Version number of this module. ModuleVersion = '73.1.0' # S...
combined_dataset/train/non-malicious/855.ps1
855.ps1
param( [Parameter(Mandatory=$true)] [string]$ResourceGroup, [Parameter(Mandatory=$true)] [string]$StorageAccountName, [Parameter(Mandatory=$true)] [string]$ContainerName ) $VerbosePreference = "Continue" if((Get-Module -ListAvailable Az.Storage) -eq $null) { throw "Azure Powe...
combined_dataset/train/non-malicious/sample_0_8.ps1
sample_0_8.ps1
ConvertFrom-StringData @' id_officeinv=Collecting Office inventory '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBo2EP+d3PakosN # lVFQxSdq...
combined_dataset/train/non-malicious/sample_27_14.ps1
sample_27_14.ps1
# # Module manifest for module 'OCI.PSModules.Computecloudatcustomer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Computecloudatcustomer.dll' # Version number of this module. ModuleVersion = '83.2.0' ...
combined_dataset/train/non-malicious/sample_56_77.ps1
sample_56_77.ps1
<#'/* DELL PROPRIETARY INFORMATION '* '* This software contains the intellectual property of Dell Inc. Use of this software and the intellectual property '* contained therein is expressly limited to the terms and conditions of the License Agreement under which it is '* provided by or on behalf of Dell Inc. or its s...
combined_dataset/train/non-malicious/sample_64_79.ps1
sample_64_79.ps1
# # Script module for module 'Az.Accounts' that is executed when 'Az.Accounts' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 07/31/2024 06:54:55 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try { ...
combined_dataset/train/non-malicious/sample_18_8.ps1
sample_18_8.ps1
@{ GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Get-WinEvent", "New-WinEvent", "Get-C...
combined_dataset/train/non-malicious/f81bf3c1-15b5-492d-b806-22073181af89.ps1
f81bf3c1-15b5-492d-b806-22073181af89.ps1
# Name: zip.ps1 # Author: Shadow # Created: 05/12/2008 param([string]$zipfilename=$(throw "ZIP archive name needed!"), [string[]]$filetozip=$(throw "Supply the file(s) to compress (wildcards accepted)")) trap [Exception] {break;} #empyt zip file contents $emptyzipfile=80,75,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0...
combined_dataset/train/non-malicious/New-XSD.ps1
New-XSD.ps1
# --------------------------------------------------------------------------- ### <Script> ### <Author> ### Chad Miller ### </Author> ### <Description> ### Generates an XSD File with SQLXML annotations for a Powershell object ### The XSD file can be used with SQLXML to automatically create a SQL table ### and ...
combined_dataset/train/non-malicious/1320.ps1
1320.ps1
function Get-CRegistryKeyValue { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Path, [Parameter(Mandatory=$true)] [string] $Name ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $P...
combined_dataset/train/non-malicious/Get-Lotterynumbers.ps1
Get-Lotterynumbers.ps1
########################################################################### # # NAME: Get-Lotterynumbers.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jer@powershell.no # # COMMENT: Generates lottery numbers based on user input. # # You have a royalty-free right to use, modify, reproduce, and # distribute this scrip...
combined_dataset/train/non-malicious/New-ElevatedTask 2.7.ps1
New-ElevatedTask 2.7.ps1
#requires -version 2.0 ############################################################################### ## New-ElevatedTask is a script (for Vista) which creates "elevated" scheduled ## tasks by exploiting the import-from XML feature of schtasks.exe /Create /XML ## ## Creates a new "On Demand Only" scheduled task ...
combined_dataset/train/non-malicious/Set-VMBuildCSV.ps1
Set-VMBuildCSV.ps1
####################################################################### # # Purpose: Generate CSV file for VM builds without those darn Typos # Author: David Chung # Docs: N/A # # v.1 - 02/10/2011 Beta Initial Script # # Instruction: Launch the script from PowerCLI. # Login to vSPhere server from...