full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/1228.ps1
1228.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) Describe 'Get-ScheduledTask' { function Assert-ScheduledTaskEqual { param( $Expected, $Actual ) Write-Debug ('{0} <=> {1}' -f $Expected.TaskName,$Actual.TaskNa...
combined_dataset/train/non-malicious/sample_25_18.ps1
sample_25_18.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/Findup_14.ps1
Findup_14.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/sample_7_49.ps1
sample_7_49.ps1
ConvertFrom-StringData @' id_filesnottobackup2k3check_st=There are too many HKLM\\SYSTEM\\CurrentControlSet\\Control\\BackupRestore\\FilesNotToBackup entries and this may cause problems with ntbackup '@ # SIG # Begin signature block # MIIoUwYJKoZIhvcNAQcCoIIoRDCCKEACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgE...
combined_dataset/train/non-malicious/Get-DistanceOnEarth.ps1
Get-DistanceOnEarth.ps1
function Get-DistanceOnEarth { <# .SYNOPSIS Calculates distance between points on the Earth. .DESCRIPTION Implementation of the Haversine equation to calculate distance over the surface of a sphere. .INPUTTYPE Pipeline object with the following parameters: LATITUDE1 LONGITUDE1 LATITUDE2 LONGITUDE2 #> ...
combined_dataset/train/non-malicious/Change-ServicePassword.ps1
Change-ServicePassword.ps1
Param([string]$server,[string]$service,[string]$user,[string]$password) Begin{ function ChangeServicePassword{ Param([string]$srv,[string]$ms,[string]$usr,[string]$pwd) # Setup for WMI $class = "Win32_Service" $method = "change" $computer = $srv $filter...
combined_dataset/train/non-malicious/SnapReminder.ps1
SnapReminder.ps1
# - SnapReminder V1.0 By Virtu-Al - http://virtu-al.net # # Please use the below variables to define your settings before use # $smtpServer = "mysmtpserver.mydomain.com" $MailFrom = "me@mydomain.com" $VISRV = "MYVISERVER" function Find-User ($username){ if ($username -ne $null) { $usr = (($username.spli...
combined_dataset/train/non-malicious/TabExpansion_2.ps1
TabExpansion_2.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> ## $foo[0].<tab> ## $foo[0].n.b<tab> ## $function:a<tab> ##...
combined_dataset/train/non-malicious/sample_48_98.ps1
sample_48_98.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 = '74.1.0' # Supported...
combined_dataset/train/non-malicious/_CTP3_ Invoke-ISE_1.ps1
_CTP3_ Invoke-ISE_1.ps1
Set-Alias ISE Invoke-ISE function Invoke-ISE () <# .SYNOPSIS start ISE from the PS-commandline .DESCRIPTION start ISE provide files as parameters or per pipe-line .NOTES Author : Bernd Kriszio - http://pauerschell.blogspot.com/ Requires : PowerShell V2 CTP3 .EXAMPLE Invoke-ISE $foo...
combined_dataset/train/non-malicious/SharePoint UserID grab_1.ps1
SharePoint UserID grab_1.ps1
## .\\SharePoint_Users_Read.ps1 "http://some.urlname.com/" "User Information List" "" ## .\\SharePoint_Users_Read.ps1 "http://some.urlname.com/" "User Information List" "user, someone" param( [string] $rqurdstrPath = $(Throw "--SharePoint Core Path required."), #required parameter [string] $rqurdstrListName = $(T...
combined_dataset/train/non-malicious/976.ps1
976.ps1
$SubscriptionId = '' $resourceGroupName = "myResourceGroup-$(Get-Random)" $location = "westeurope" $adminSqlLogin = "SqlAdmin" $password = "ChangeYourAdminPassword1" $serverName = "server-$(Get-Random)" $databaseName = "myImportedDatabase" $storageAccountName = "sqlimport$(Get-Random)" $storageContainerName = "i...
combined_dataset/train/non-malicious/sample_12_12.ps1
sample_12_12.ps1
ConvertFrom-StringData @' id_filever=Collecting critical file versions '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC5Phm1j+58Cc4T # lUIb...
combined_dataset/train/non-malicious/Creating Bulk users.ps1
Creating Bulk users.ps1
The final.csv file is the name of file which i created and its located on the desktop of the window server. after running the script i received this error Import-Csv : Cannot open file "C:\\Users\\Administrator\\final.csv". At line:1 char:23 + $Password = Import-Csv <<<< final.csv| foreach { New-Mailbox -alias $_.A...
combined_dataset/train/non-malicious/1860.ps1
1860.ps1
Import-Module HelpersCommon try { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() $originalWarningPreference = $WarningPreference $WarningPreference = "SilentlyContinue" $IsNotSkipped = ($IsWindows -and $IsCoreCLR -and (Test-IsElevated) -and (Test-CanWriteToPsHome)) ...
combined_dataset/train/non-malicious/sample_46_76.ps1
sample_46_76.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ###########################################################...
combined_dataset/train/non-malicious/sample_63_73.ps1
sample_63_73.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 License...
combined_dataset/train/non-malicious/sample_34_81.ps1
sample_34_81.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_43_49.ps1
sample_43_49.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> Import-Module $PSScriptRoot\Tracer.psm1 <# ...
combined_dataset/train/non-malicious/Check Modules path..ps1
Check Modules path..ps1
function Update-ModulePath { <# .Synopsis Command insures that path and the name of psm1 file are alike. .Description This function should help to troubleshoot modules. It loooks up path that should contain modules. For each .psm1 file found it checks if parent folder containing th...
combined_dataset/train/non-malicious/sample_16_16.ps1
sample_16_16.ps1
# # Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker' # # Generated by: Microsoft Corporation # # Generated on: 19/01/2022 # @{ # Script module or binary module file associated with this manifest. RootModule = '' # Version number of this module. ModuleVersion = '1.2100.25...
combined_dataset/train/non-malicious/Get-VMHostVersions.ps1
Get-VMHostVersions.ps1
#======================================================================== # Created on: 5/17/2012 2:03 PM # Created by: Clint Jones # Organization: Virtually Genius! # Filename: Get-VMHostVersions #======================================================================== #Import modules Add-PSSnapin "Vm...
combined_dataset/train/non-malicious/sample_52_2.ps1
sample_52_2.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/sample_29_28.ps1
sample_29_28.ps1
$url = $args[0] Write-Host "Downloading Microsoft Edge" $wc = New-Object net.webclient $msiInstaller = "$env:temp\microsoft-edge-stable.msi" $wc.Downloadfile($url, $msiInstaller) Write-Host "Installing Microsoft Edge" $arguments = "/i `"$msiInstaller`" /quiet" Start-Process msiexec.exe -ArgumentList $arguments -Wait ...
combined_dataset/train/non-malicious/sample_49_64.ps1
sample_49_64.ps1
ConvertFrom-StringData @' IPAddressDisplayNameFormat=IP-adres: {0} NetworkNameDisplayNameFormat=Naam: {0} NetworkNameOfflineDisplayNameFormat=IP-adres: het adres in {0} CreateClusterProgressValidationStart=De geschiktheid van servers voor een failovercluster wordt gevalideerd. CreateClusterProgressValidationEnd=De...
combined_dataset/train/non-malicious/107.ps1
107.ps1
function Get-AuthToken { [cmdletbinding()] param ( [Parameter(Mandatory=$true)] $User ) $userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User $tenant = $userUpn.Host Write-Host "Checking for AzureAD module..." $AadModule = Get-Module -Name "AzureAD" -ListAvailable if ($Aa...
combined_dataset/train/non-malicious/sample_26_38.ps1
sample_26_38.ps1
# # Module manifest for module 'OCI.PSModules.Loggingingestion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported...
combined_dataset/train/non-malicious/sample_30_20.ps1
sample_30_20.ps1
Get-WsusServer Get-WsusServer | Invoke-WsusServerCleanup -CleanupObsoleteUpdates -CleanupUnneededContentFiles cd C:\Users\sampler-win_2022_x64\Desktop\ sqlcmd stop-service WSUSService, W3SVC get-service WSUSService, W3SVC stop-service WSUSService stop-service wsusservice get-service wsusservice stop-service ws...
combined_dataset/train/non-malicious/sample_14_1.ps1
sample_14_1.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-ExecutionPolicy", "Set-E...
combined_dataset/train/non-malicious/sample_38_82.ps1
sample_38_82.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Dns.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.Dns.Module]::Instance # Export nothing to clear implicit exports Export-...
combined_dataset/train/non-malicious/sample_10_53.ps1
sample_10_53.ps1
'This script has been deprecated. Please use the PowerShell version TS_Virtualization.ps1 '' SIG '' Begin signature block '' SIG '' MIIoUAYJKoZIhvcNAQcCoIIoQTCCKD0CAQExDzANBglg '' SIG '' hkgBZQMEAgEFADB3BgorBgEEAYI3AgEEoGkwZzAyBgor '' SIG '' BgEEAYI3AgEeMCQCAQEEEE7wKRaZJ7VNj+Ws4Q8X66sC '' SIG '' AQACAQACAQACAQAC...
combined_dataset/train/non-malicious/sample_2_95.ps1
sample_2_95.ps1
ConvertFrom-StringData @' id_sccm_activity_cm07serverinfo=Gathering Site Server Information id_sccm_cm07serverinfo_serverinfo=Obtaining Site Server Information id_sccm_cm07serverinfo_hierarchy=Obtaining Site Hierarchy id_sccm_cm07serverinfo_filever=Obtaining File Versions '@ # SIG # Begin signature block # MII...
combined_dataset/train/non-malicious/DHCP Failover Script.ps1
DHCP Failover Script.ps1
:: Purpose: DHCP server Watchdog & Failover script. Read notes below :: Requirements: 1. Domain administrator credentials & "Logon as a batch job" rights :: 2. Proper firewall configuration to allow connection :: 3. Proper permissions on the DHCP backup directory :: Auth...
combined_dataset/train/non-malicious/2118.ps1
2118.ps1
Describe 'Test for conversion b/w script block and delegate' -Tags "CI" { BeforeAll { function lineno { $myInvocation.ScriptLineNumber } function Generate-ArgumentTypesAndParameters { param([int] $num, [ref] $parameters, [ref]$argumentTypes, [bool]$...
combined_dataset/train/non-malicious/Set-LocalPassword_2.ps1
Set-LocalPassword_2.ps1
param( [switch]$Help , [string] $User , [string] $Password , [string[]] $ComputerNames = @() ) $usage = @' Get-OUComputerNames usage : [computerName1,computerName2,... | ] ./Set-LocalPassword.ps1 [-user] <userName> [-password] <password> [[-computers] computerName1,computerName2,...] returns : Sets lo...
combined_dataset/train/non-malicious/sample_37_29.ps1
sample_37_29.ps1
function GetSuccessAsEnumType { param ( $result ) if($null -eq $result) { return [Microsoft.AzureStack.ArcHci.Ubercrud.Observability.Events.EventConstants+Status]::SKIPPED } elseif($true -eq $result) { return [Microsoft.AzureStack.ArcHci.Ubercrud.Observability.Event...
combined_dataset/train/non-malicious/1712.ps1
1712.ps1
function Get-ServiceNowChangeRequest { [OutputType([System.Management.Automation.PSCustomObject])] [CmdletBinding(DefaultParameterSetName, SupportsPaging)] Param( [Parameter(Mandatory = $false)] [string]$OrderBy = 'opened_at', [Parameter(Mandatory = $false)] ...
combined_dataset/train/non-malicious/446.ps1
446.ps1
Register-PSFConfigValidation -Name "integerpositive" -ScriptBlock { Param ( $Value ) $Result = New-Object PSOBject -Property @{ Success = $True Value = $null Message = "" } try { [int]$number = $Value } catch { $Result.Message = "Not an integer: $Value" $Result.Success = $False return $Result...
combined_dataset/train/non-malicious/sample_64_38.ps1
sample_64_38.ps1
# # Module manifest for module 'OCI.PSModules.Identity' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Identity.dll' # Version number of this module. ModuleVersion = '85.2.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_62_78.ps1
sample_62_78.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/sample_32_30.ps1
sample_32_30.ps1
# # Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker' # # Generated by: Microsoft Corporation # # Generated on: 19/01/2022 # @{ # Script module or binary module file associated with this manifest. RootModule = '' # Version number of this module. ModuleVersion = '1.2100.25...
combined_dataset/train/non-malicious/2319.ps1
2319.ps1
param ( $OmnifocusTaskFile = 'C:\Users\Adam Bertram\Dropbox\OmniFocus.csv' ) $script:DefaultWeekdayTimeAvail = @{ 'Monday' = 10 'Tuesday' = 10 'Wednesday' = 10 'Thursday' = 10 'Friday' = 9 'Saturday' = 6 'Sunday' = 3 } $TotalReportWeeksOut = 8 $script:Today = Get-Date function Get-WeeklyWorkTime([switch]...
combined_dataset/train/non-malicious/1913.ps1
1913.ps1
Describe "Add-Type" -Tags "CI" { BeforeAll { $guid = [Guid]::NewGuid().ToString().Replace("-","") $CSharpCode1 = @" namespace Test.AddType { public class CSharpTest1$guid { public static int Add1(int a, int b) { ...
combined_dataset/train/non-malicious/sample_53_82.ps1
sample_53_82.ps1
<#PSScriptInfo .VERSION 1.0 .COMPANYNAME Microsoft .COPYRIGHT (c) 2022 ES365 FUNDAMENTALS SECURITY AND COMPLIANCE <es365funsandc@microsoft.com>. .PROJECTURI https://aka.ms/Wiki_ES365ConfFetch #> <# .SYNOPSIS .\Fetch-ES365FunSecurityConfig.ps1 .DESCRIPTION This scripts fetches all the requi...
combined_dataset/train/non-malicious/3838.ps1
3838.ps1
function TopicTypeTests_Operations { Write-Debug "Getting topic types" $topicTypes = Get-AzEventGridTopicType Assert-True {$topicTypes.Count -ge 3} $storage = "Microsoft.Storage.StorageAccounts" Write-Debug "Getting topic type info for Storage" $returnedTopicTypes1 = Get-AzEvent...
combined_dataset/train/non-malicious/sample_0_77.ps1
sample_0_77.ps1
<# .SYNOPSIS Scenario module for collecting Microsoft AVD App Attach related data .DESCRIPTION Collect App Attach related troubleshooting data .NOTES Author : Robert Klemencz Requires : MSRD-Collect.ps1 Version : See MSRD-Collect.ps1 version Feedback : https://aka.ms/MSRD-Colle...
combined_dataset/train/non-malicious/1060.ps1
1060.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) Describe "Carbon Website" { $tags = Get-Content -Raw -Path (Join-Path -Path $PSScriptRoot -ChildPath '..\tags.json' -Resolve) | ConvertFrom-Json $taggedCommands = @{ } $tags | ForEach-Object { $taggedCommands[$_....
combined_dataset/train/non-malicious/sample_9_39.ps1
sample_9_39.ps1
#************************************************ # DC_RDSSH.ps1 # Version 1.0.1 # Date: 21-01-2012 # Author: Daniel Grund - dgrund@microsoft.com # Description: # This script gets the RDSSH config and # checks vital signs to inform user. # 1.0.0 Beta release #************************************************...
combined_dataset/train/non-malicious/sample_14_54.ps1
sample_14_54.ps1
# This script has dependencies on utils_CTS and utils_DSD # param ( [Object[]] $instances ) # 2023-02-20 WalterE mod Trap #we# trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($...
combined_dataset/train/non-malicious/sample_27_59.ps1
sample_27_59.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_16_62.ps1
sample_16_62.ps1
# # Module manifest for module 'PSScriptAnalyzer' # @{ # Author of this module Author = 'Microsoft Corporation' # Script module or binary module file associated with this manifest. RootModule = 'PSScriptAnalyzer.psm1' # Version number of this module. ModuleVersion = '1.22.0' # ID used to uniquely identify this mod...
combined_dataset/train/non-malicious/sample_46_53.ps1
sample_46_53.ps1
# # Module manifest for module 'OCI.PSModules.Osmanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osmanagement.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/sample_12_15.ps1
sample_12_15.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 = '73.1.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/Log ports used by app.ps1
Log ports used by app.ps1
####################################################################################################################### # File: LogPortsUsedByApplication.ps1 # # Version: 1.1 ...
combined_dataset/train/non-malicious/4479.ps1
4479.ps1
configuration PSModule_UninstallModuleConfig { param ( [Parameter()] [System.String[]] $NodeName = 'localhost', [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [System.String] $ModuleName ) Import-DscResource -ModuleName 'PowerShel...
combined_dataset/train/non-malicious/Send-Growl 3.0.ps1
Send-Growl 3.0.ps1
## This is the first version of a Growl module (just dot-source to use in PowerShell 1.0) ## v 1.0 supports a very simple notice, and no callbacks ## v 2.0 supports registering multiple message types ## supports callbacks ## v 2.1 redesigned to be a module used from apps, rather than it's own "PowerGrowler" a...
combined_dataset/train/non-malicious/Get-PrinterInfo.ps1
Get-PrinterInfo.ps1
$strComputer = "PrinterName" $Ports = get-wmiobject -class "win32_tcpipprinterport" -namespace "root\\CIMV2" -computername $strComputer $Printers = get-wmiobject -class "Win32_Printer" -namespace "root\\CIMV2" -computername $strComputer $ports | Select-Object Name,Hostaddress | Set-Variable port $Printers | Select-...
combined_dataset/train/non-malicious/Boots UI Update Sample.ps1
Boots UI Update Sample.ps1
Import-Module PowerBoots # This simulates a download function, say Jaykul's Get-Webfile # You can output current progress for a large file, or if it's an array of links then out put the current (index/length)% # You will need to run the function as a background thread in order for it to not interfere with the UI t...
combined_dataset/train/non-malicious/sample_51_76.ps1
sample_51_76.ps1
@{ IncludeRules=@('PSDSC*') } # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB4py8/3f6n2koR # USF+SZkmUhBEJfwl8TGS1Tis3232TKCCDXYwggX0MIID3KAD...
combined_dataset/train/non-malicious/isMSDTC.ps1
isMSDTC.ps1
#MSDTC is needed by SQL Server Linked Servers #This script checks whether MSDTC has been configured for network access #See KB http://support.microsoft.com/default.aspx?scid=kb;en-us;816701 for steps to enable #All values except AllowOnlySecureRpcCalls should be true param($computerName=$env:computerName) #On an...
combined_dataset/train/non-malicious/sample_3_19.ps1
sample_3_19.ps1
#************************************************ # DC_NetworkConnections-Component.ps1 # Version 1.0 # Version 1.1: Altered the runPS function correctly a column width issue. # Version 1.2 (4/26/14): Added table of contents. # Date: 2012-2014 # Author: Boyd Benson (bbenson@microsoft.com) # Description: # Call...
combined_dataset/train/non-malicious/Get Network Utilization_1.ps1
Get Network Utilization_1.ps1
$cnt = 'Bytes Total/sec' $cat = 'Network Interface' $cnt2 = 'Current Bandwidth' foreach ($inst in ((new-object System.Diagnostics.PerformanceCounterCategory("network interface")).GetInstanceNames())){ $cur = New-Object system.Diagnostics.PerformanceCounter($cat,$cnt,$inst) $max = New-Object system.Diagnostics.Pe...
combined_dataset/train/non-malicious/Get-ScriptDirectory.ps1
Get-ScriptDirectory.ps1
function Get-ScriptDirectory { $invocation = (Get-Variable MyInvocation -Scope 1).Value $script = [IO.FileInfo] $invocation.MyCommand.Path if ([IO.File]::Exists($script)) { Return (Split-Path $script.Fullname) } else { return $null } }
combined_dataset/train/non-malicious/sample_17_68.ps1
sample_17_68.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_30_40.ps1
sample_30_40.ps1
# # Module manifest for module 'OCI.PSModules.Loadbalancer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loadbalancer.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/sample_26_5.ps1
sample_26_5.ps1
# # Module manifest for module 'OCI.PSModules.Autoscaling' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Autoscaling.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_31_42.ps1
sample_31_42.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/sample_26_68.ps1
sample_26_68.ps1
# # Module manifest for module 'OCI.PSModules.Opa' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opa.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_63_77.ps1
sample_63_77.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # # ModifyProxySettings.ps1 - To be used by the installer - Mo...
combined_dataset/train/non-malicious/Stored Credential Code.ps1
Stored Credential Code.ps1
#STORED CREDENTIAL CODE $AdminName = Read-Host "Enter your Admin AD username" $CredsFile = "C:\\$AdminName-PowershellCreds.txt" $FileExists = Test-Path $CredsFile if ($FileExists -eq $false) { Write-Host 'Credential file not found. Enter your password:' -ForegroundColor Red Read-Host -AsSecureString | ConvertF...
combined_dataset/train/non-malicious/1473.ps1
1473.ps1
function Get-ModuleReleaseNotes { param( [Parameter(Mandatory=$true)] [string] $ManifestPath, [Parameter(Mandatory=$true)] [string] $ReleaseNotesPath ) Set-StrictMode -Version 'Latest' $Version = Test-ModuleManifest -Path $ManifestPat...
combined_dataset/train/non-malicious/sample_61_78.ps1
sample_61_78.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_39_30.ps1
sample_39_30.ps1
<# .SYNOPSIS Deploys a Service Fabric application type to a cluster. .DESCRIPTION This script deploys a Service Fabric application type to a cluster. It is invoked by Visual Studio when deploying a Service Fabric Application project. .NOTES WARNING: This script file is invoked by Visual Studio. Its paramet...
combined_dataset/train/non-malicious/Get-GroupMembership_2.ps1
Get-GroupMembership_2.ps1
## Get-DistinguishedName -- look up a DN from a user's (login) name function Get-DistinguishedName { Param($UserName) $ads = New-Object System.DirectoryServices.DirectorySearcher([ADSI]'') $ads.filter = "(&(objectClass=Person)(samAccountName=$UserName))" $s = $ads.FindOne() return $s.GetDirectoryEnt...
combined_dataset/train/non-malicious/426.ps1
426.ps1
Register-PSFTeppScriptblock -Name "PSFramework-config-module" -ScriptBlock { [PSFramework.Configuration.ConfigurationHost]::Configurations.Values.Module | Select-Object -Unique }
combined_dataset/train/non-malicious/Get-CryptoBytes_1.ps1
Get-CryptoBytes_1.ps1
function Get-CryptoBytes { #.Synopsis # Generate Cryptographically Random Bytes #.Description # Uses RNGCryptoServiceProvider to generate arrays of random bytes #.Parameter Count # How many bytes to generate #.Parameter AsString # Output hex-formatted strings instead of byte arrays param( [Parameter(Va...
combined_dataset/train/non-malicious/sample_32_5.ps1
sample_32_5.ps1
# # Module manifest for module 'OCI.PSModules.Osuborganizationsubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll' # Version number of this module. ModuleVersion...
combined_dataset/train/non-malicious/sample_15_62.ps1
sample_15_62.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.SecurityInsights.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.SecurityInsights.internal.psm1' if(Test-Path $internalModul...
combined_dataset/train/non-malicious/Read-InputBox.ps1
Read-InputBox.ps1
##############################################################################\n##\n## Read-InputBox\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 user ...
combined_dataset/train/non-malicious/sample_66_34.ps1
sample_66_34.ps1
# Import the helper functions Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [parameter(Mandatory = $true)] [System.String] $Category ) #Write-Verbose "Use this cmdlet t...
combined_dataset/train/non-malicious/691.ps1
691.ps1
function Get-ShouldProcessTargetWmi { [CmdletBinding()] Param ( [AllowNull()] [object] $BoundParameters, [string] $Target ) if ($BoundParameters["ComputerName"]) { $Server = $BoundParameters["ComputerName"] } elseif ([Microso...
combined_dataset/train/non-malicious/sample_21_96.ps1
sample_21_96.ps1
function Add-WACLGUserToLocalGroups { <# .SYNOPSIS Adds a local or domain user to one or more local groups. .DESCRIPTION Adds a local or domain user to one or more local groups. The supported Operating Systems are Window Server 2012, Windows Server 2012R2, Windows Server 2016. .ROLE Administrators #> ...
combined_dataset/train/non-malicious/Get-MailboxImportRequest_1.ps1
Get-MailboxImportRequest_1.ps1
# .Synopsis # Use the Get-MailboxImportRequestProgress cmdlet to view detailed information about pst import progress. # .Description # The Get-MailboxImportRequestProgress cmdlet displays statistics on imports currently in progress that help determine if a import is likely to complete successfully. To accureatel...
combined_dataset/train/non-malicious/ActiveDirectoryFunctions_2.ps1
ActiveDirectoryFunctions_2.ps1
#.SYNOPSIS # Gets a directory entry from ActiveDirectory based on the login user name function Get-ADUser { [CmdletBinding()] param([string]$UserName=${Env:userName}) $ads = New-Object System.DirectoryServices.DirectorySearcher([ADSI]'') $ads.filter = "(&(objectClass=Person)(samAccountName=$UserName))" ...
combined_dataset/train/non-malicious/sample_45_39.ps1
sample_45_39.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_37_18.ps1
sample_37_18.ps1
# # Module manifest for module 'OCI.PSModules.Accessgovernancecp' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Accessgovernancecp.dll' # Version number of this module. ModuleVersion = '82.0.0' # Suppo...
combined_dataset/train/non-malicious/3d3bbfa8-777b-4374-9eac-5350569d2cba.ps1
3d3bbfa8-777b-4374-9eac-5350569d2cba.ps1
param($Issue, $Credentials = $(Get-Credential), $BaseURI = "https://your.jira.server/jira") function ConvertTo-UnsecureString( [System.Security.SecureString][parameter(mandatory=$true)]$SecurePassword) { $unmanagedString = [System.IntPtr]::Zero; try { $unmanagedString = [Runtime.Interop...
combined_dataset/train/non-malicious/Fix for datastore.ps1
Fix for datastore.ps1
#Generated Form Function function GenerateForm { ######################################################################## # THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK # OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER. # # Code Generated By: Richard ...
combined_dataset/train/non-malicious/sample_38_59.ps1
sample_38_59.ps1
function Get-PerformanceProfile { Param( [Parameter(Mandatory = $false)] $LaunchConfig ) $ServiceUrl = Get-ServiceUrl -Method 'GetPerformanceProfile' -LaunchConfig $LaunchConfig $Credential = Get-ALTestRunnerCredential -LaunchConfig $LaunchConfig $PerformanceProfilePath = ...
combined_dataset/train/non-malicious/1917.ps1
1917.ps1
Describe "Get-PSCallStack DRT Unit Tests" -Tags "CI" { BeforeAll { $scriptFileName = "GetTryCatchCallStack.ps1" $scriptFilePath = Join-Path $TestDrive -ChildPath $scriptFileName } It "Verifies that the script block of a catch clause does not show up on the call stack" { $fileStream...
combined_dataset/train/non-malicious/862a7a2f-5e6b-4cca-95e3-31247e664396.ps1
862a7a2f-5e6b-4cca-95e3-31247e664396.ps1
#Get information on everybodies inbox and spit it out with total sizes #in MB. Sorts the list by StorageLimitStatus #NOTE THAT I HAD TO USE ASCII WITH OUT-FILE AS NO OTHER ENCODING WOULD #PROPERLY IMPORT CSV INTO EXCEL #create a date var to stick in the filename $date = get-date -Format MM-dd-yyyy #create a ou...
combined_dataset/train/non-malicious/sample_17_62.ps1
sample_17_62.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_27_68.ps1
sample_27_68.ps1
data LocalizedData { # culture="en-US" ConvertFrom-StringData @' PathNotFoundError=The path '{0}' either does not exist or is not a valid file system path. ExpandArchiveInValidDestinationPath=The path '{0}' is not a valid file system directory path. InvalidZipFileExtensionError={0} is not a su...
combined_dataset/train/non-malicious/init_repoclones.ps1
init_repoclones.ps1
<# .SYNOPSIS Makes a local copy of one or more remote svn repositories. .DESCRIPTION Makes a local copy of one or more remote svn repositories. .INPUTS None You cannot pipe objects to init-repoclones.ps1 .OUTPUTS None .EXAMPLE #> param ( [string[]] $Repos = @('protobuf', 'mb-unit', 'opennod...
combined_dataset/train/non-malicious/sample_2_79.ps1
sample_2_79.ps1
########################################### INFO ################################################################ #This script assumes it is being executed from inside a clone of the DSC Service Repo. #If this is not the case, then relational Paths will break if not adapted #This script can be executed from inside ...
combined_dataset/train/non-malicious/Install-Patches.ps1
Install-Patches.ps1
<# Save this with a .PSM1 extension and use Import-Module to properly load the functions. ie: Install-Patches.psm1 Import-Module Install-Patches.psm1 #> #Validate user is an Administrator Write-Verbose "Checking Administrator credentials" If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.Window...
combined_dataset/train/non-malicious/exclude properties_.ps1
exclude properties_.ps1
$server = "dcserver1.mafoberg.net" $session = new-pssession -computer $server -cred $creds icm -Session $session -ScriptBlock { import-module activedirectory (get-ADUser -filter "*" -properties GivenName, SurName, EmailAddress | select -ExcludeProperty PSComputerName, RunspaceId, PSShowComputerName ) ...
combined_dataset/train/non-malicious/Check-LotusHealth.ps1
Check-LotusHealth.ps1
# ============================================================================================== # # Microsoft PowerShell Source File -- Created with SAPIEN Technologies PrimalScript 4.1 # # NAME: Check-LotusHealth.ps1 # # AUTHOR: Jeremy D. Pavleck , Pavleck.NET # DATE : 5/19/2008 # # COMMENT: This script...
combined_dataset/train/non-malicious/Enable_Configure SNMP_3.ps1
Enable_Configure SNMP_3.ps1
#Powershell Script To Install SNMP Services (SNMP Service, SNMP WMI Provider) #Variables :) $pmanagers = "ADD YOUR MANAGER(s)" $commstring = "ADD YOUR COMM STRING" #Import ServerManger Module Import-Module ServerManager #Check If SNMP Services Are Already Installed $check = Get-WindowsFeature | Where-Objec...
combined_dataset/train/non-malicious/sample_21_0.ps1
sample_21_0.ps1
# Copyright 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 use, modify, copy, publish, distribute, discl...