full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/1449.ps1
1449.ps1
function Get-CServiceAcl { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Name ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $rawSD = Get-CServiceSecurityDescriptor -Nam...
combined_dataset/train/non-malicious/IP Scan_Local User admin.ps1
IP Scan_Local User admin.ps1
# The trigger $obj = New-Object system.Net.NetworkInformation.Ping 100..200 | % { $ip = "10.1.1.$_" $ping = $obj.send($ip,100) write-host "." -noNewLine if ($ping.status -eq "Success"){ C:\\Powershell\\Finduser.ps1 $ping.address.ipaddresstostring }} #-------------------------------- # Finduser.ps1 para...
combined_dataset/train/non-malicious/sample_6_92.ps1
sample_6_92.ps1
# # Module manifest for module 'OCI.PSModules.Apmsynthetics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmsynthetics.dll' # Version number of this module. ModuleVersion = '93.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/2979.ps1
2979.ps1
$VerbosePreference = 'Continue' $ErrorActionPreference = 'Stop' try { $nugetPath = "$psScriptRoot\vendor\tools\nuget.exe" Write-Host Nuget path $nugetPath $nugetFound = Test-Path $nugetPath if ($nugetFound) { Write-Host Found local nuget.exe running it $nugetRunnable = ...
combined_dataset/train/non-malicious/25a74c84-07ab-45d9-a031-0aaf972b8522.ps1
25a74c84-07ab-45d9-a031-0aaf972b8522.ps1
select * from sys.dm_db_index_physical_stats(db_id('vCenter'),null,null,null,null) order by avg_fragmentation_in_percent desc
combined_dataset/train/non-malicious/sample_40_63.ps1
sample_40_63.ps1
@{ GUID="eb74e8da-9ae2-482a-a648-e96550fb8733" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="© Microsoft Corporation. All rights reserved." Description='PowerShell module for working with ZIP archives.' ModuleVersion="1.2.5" PowerShellVersion="3.0" FunctionsToExport = @('Compress...
combined_dataset/train/non-malicious/Sendmail for PoSh V1.0.ps1
Sendmail for PoSh V1.0.ps1
#region vars $global:maileditor = "C:\\Programme\\vim\\vim72\\vim.exe" $global:encryption = "C:\\Programme\\GNU\\GnuPG\\gpg.exe" $global:enckey = "s.patrick1982@gmail.com" $global:tempmail = "C:\\temp\\psmail.txt" $global:sigmail = "C:\\temp\\halten\\sig.txt" $global:mailbody = "" #endregion vars #region init...
combined_dataset/train/non-malicious/Hack ESXi.ps1
Hack ESXi.ps1
$screen = " You see here a virtual switch. ------------ ------ #...........| |....| --------------- ###------------ |...(| |..%...........|########## ###-@...| ...
combined_dataset/train/non-malicious/1065.ps1
1065.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) $servicePath = Join-Path -Path $PSScriptRoot -ChildPath 'Service\NoOpService.exe' -Resolve $serviceNamePrefix = 'CarbonTestService' $serviceName = $null $serviceAcct = 'CrbnInstllSvcTstAcct' $servicePassword = "a1""'~!@ $inst...
combined_dataset/train/non-malicious/sample_12_28.ps1
sample_12_28.ps1
ConvertFrom-StringData @' id_wga=Collecting MGADiag id_wgastatus=Running MGADiag.exe '@ # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBtMYXMG...
combined_dataset/train/non-malicious/sample_57_12.ps1
sample_57_12.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # # Azure File Sync: List per item sync errors # # Version 2.4...
combined_dataset/train/non-malicious/Start-BootsTimer.ps1
Start-BootsTimer.ps1
function Start-BootsTimer { #.Syntax # Creates a stay-on-top countdown timer #.Description # A WPF borderless count-down timer, with audio/voice alarms and visual countdown + colored progress indication #.Parameter EndMessage # The message to be spoken by a voice when the time is up... #.Parameter StartMessag...
combined_dataset/train/non-malicious/sample_51_38.ps1
sample_51_38.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/Find-Replace.ps1
Find-Replace.ps1
<# .SYNOPSIS Finds and Replaces multiple entries, in multiple files. .DESCRIPTION By default, performs an ordinal (case-sensitive and culture-insensitive) search to find an old value and replace it. .PARAMETER Path One or more files Paths to process. Excepts values from the Pipeline. Will except the output fr...
combined_dataset/train/non-malicious/sample_29_45.ps1
sample_29_45.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/957.ps1
957.ps1
$apiVersion = "2015-04-08" $resourceGroupName = "myResourceGroup" $accountName = "mycosmosaccount" $databaseName = "database1" $collectionName = "collection1" $accountResourceName = $accountName + "/mongodb/" $databaseResourceName = $accountName + "/mongodb/" + $databaseName $databaseResourceType = "Microsoft.Documen...
combined_dataset/train/non-malicious/sudo for Powershell_2.ps1
sudo for Powershell_2.ps1
# sudo.ps1 # # Authors: pezhore, mrigns, This guy: http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell # Other powershell peoples. # # Sources: # http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell # http://www.ainotenshi.org/%E2%80%98sudo%E2%80%99-for...
combined_dataset/train/non-malicious/Findup_3.ps1
Findup_3.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; namespace Findup { public class FileInfoExt { public FileInfo...
combined_dataset/train/non-malicious/sample_4_99.ps1
sample_4_99.ps1
ConvertFrom-StringData @' id_regsetupperfrecoverydebuginfo=Recovery/Debug related keys id_regsetupperfistartupinfo=Startup information id_regsetupperfilocalprintkey=Local Print Key id_regsetupperfipolicies=Policies System id_regsetupperfregtimezoneinfo=Time Zone keys id_regsetupperfregts=Terminal Services ID_Reg...
combined_dataset/train/non-malicious/sample_61_26.ps1
sample_61_26.ps1
# # Module manifest for module 'OCI.PSModules.Dns' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dns.dll' # Version number of this module. ModuleVersion = '88.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/99.ps1
99.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/3481.ps1
3481.ps1
function Test-CreateSqlVirtualMachine { $location = Get-LocationForTest $rg = Create-ResourceGroupForTest $location $vmName = 'vm' $previousErrorActionPreferenceValue = $ErrorActionPreference $ErrorActionPreference = "SilentlyContinue" try { Create-VM $rg.ResourceGroupName $vmName $location ...
combined_dataset/train/non-malicious/sample_1_31.ps1
sample_1_31.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/Get-MX.ps1
Get-MX.ps1
#Returns the priority mail server (SMTP) for a particular email address. function Get-MX { param([string] $domain = $( Throw "Query required in the format domain.com or email@domain.com.") ) #rip domain out of full email address if necessary: if ($domain.IndexOf("@")) { $domain = $domain.SubString($domain.Inde...
combined_dataset/train/non-malicious/60.ps1
60.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_24_13.ps1
sample_24_13.ps1
# powershell completion for azcmagent -*- shell-script -*- function __azcmagent_debug { if ($env:BASH_COMP_DEBUG_FILE) { "$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE" } } filter __azcmagent_escapeStringWithSpecialChars { $_ -replace '\s|#|@|\$...
combined_dataset/train/non-malicious/970.ps1
970.ps1
$SubscriptionId = '' $resourceGroupName = "myResourceGroup-$(Get-Random)" $location = "westus2" $adminSqlLogin = "SqlAdmin" $password = "ChangeYourAdminPassword1" $serverName = "server-$(Get-Random)" $databaseName = "mySampleDatabase" $startIp = "0.0.0.0" $endIp = "0.0.0.0" Set-AzContext -SubscriptionId $subsc...
combined_dataset/train/non-malicious/LDAPLogging_1.ps1
LDAPLogging_1.ps1
\nfunction Private:Configure-Logging {\n<#\n .SYNOPSIS\n Enables, disables or view current LDAP Logging settings on a domain controller.\n\n .DESCRIPTION\n Enables, disables or view current LDAP Logging settings on a domain controller.\n \n Use one of the following aliases:\n \n Get-LDAPLo...
combined_dataset/train/non-malicious/2609.ps1
2609.ps1
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null $AGName = 'TestAG1' $PrimaryNode = 'SQLNODE1' $FailoverNode = 'SQLNODE2' $IPs = @('10.152.18.25','10.152.19.160','10.152.20.119') $smoprimarynode = New-Object Microsoft.SqlServer.Management.Smo.Server $PrimaryNode $smoag = New-Obj...
combined_dataset/train/non-malicious/200.ps1
200.ps1
function New-ScriptMessage { [CmdletBinding()] [OutputType([string])] param ( [String]$Message, [String]$Block, [String]$DateFormat = 'yyyy\/MM\/dd HH:mm:ss:ff', $FunctionScope = "1" ) PROCESS { $DateFormat = Get-Date -Format $DateFormat $MyCommand = (Get-Variable -Scope $FunctionScope -Name MyInv...
combined_dataset/train/non-malicious/sample_13_99.ps1
sample_13_99.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_51_37.ps1
sample_51_37.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> # Import Observability EventSource $observabili...
combined_dataset/train/non-malicious/sample_54_98.ps1
sample_54_98.ps1
# # Module manifest for module 'OCI.PSModules.Fusionapps' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Fusionapps.dll' # Version number of this module. ModuleVersion = '85.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/Add-Identity.ps1
Add-Identity.ps1
param( [Parameter(Position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$true)] [alias("Name","ComputerName")] $Computer = @($env:computername), [string] $NTDomain = ($env:UserDomain), [string[]] $LocalGroups = @("Administrators"), [string[]] $Identities, # can be domain user or group [switch] $Outpu...
combined_dataset/train/non-malicious/sample_2_30.ps1
sample_2_30.ps1
ConvertFrom-StringData @' id_virtualization=Virtualization Information id_virtualizationobtaining=Obtaining Information about Virtualization Environment '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLC...
combined_dataset/train/non-malicious/2492.ps1
2492.ps1
[CmdletBinding()] [OutputType([System.Management.Automation.PSCustomObject])] param ( [Parameter(Mandatory)] [ValidateScript({ Test-Connection -ComputerName $_ -Count 1 -Quiet})] [string[]]$Computername, [Parameter(Mandatory)] [ValidateSet('WinRm','Smb','Dns','ActiveDirectoryGeneral','ActiveDirectoryGlobalCatalo...
combined_dataset/train/non-malicious/sample_8_40.ps1
sample_8_40.ps1
#************************************************ # DC_ClusterEventLogs.ps1 # Version 2.0.2 # Date: 11-30-2009 # Author: Andre Teixeira - andret@microsoft.com # Description: This script calls TS_GetEvents.ps1 to export cluster-related event logs #************************************************ if($debug -eq $...
combined_dataset/train/non-malicious/sample_20_73.ps1
sample_20_73.ps1
# Localized 05/07/2022 03:58 AM (GMT) 303:7.0.30723 MSFT_WindowsOptionalFeature.strings.psd1 # Localized resources for MSFT_WindowsOptionalFeature ConvertFrom-StringData @' ###PSLOC DismNotAvailable=PowerShell module Dism could not be imported. NotAClientSku=This Resource is only available for Windows Client. ...
combined_dataset/train/non-malicious/sample_11_56.ps1
sample_11_56.ps1
#************************************************ # TS_ClusterValidationTests.ps1 # Version 1.0.1 # Date: 07-24-2009 # Author: Andre Teixeira - andret@microsoft.com # Hacked by Jacques Boulet - jaboulet@microsoft.com - 2019-02-21 # Description: This script is used to obtain cluster validation report. # ...
combined_dataset/train/non-malicious/sample_53_55.ps1
sample_53_55.ps1
/////////////////////////////////////////////////////////////////////////////// // Helper to set a designer prop /////////////////////////////////////////////////////////////////////////////// function setDesignerProp(tname, ttype, tvalue) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)...
combined_dataset/train/non-malicious/sample_32_36.ps1
sample_32_36.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 Li...
combined_dataset/train/non-malicious/sample_9_56.ps1
sample_9_56.ps1
#************************************************ # TS_Check_ZenographicsUI.ps1 # Version 1.0.1 # Date: 03/12/2012 13:34:20 # Author: jasonf # Description: Checks for the presence of Zenographics Device Manager User Interface version 6.1.524.0 #************************************************ Import-Localized...
combined_dataset/train/non-malicious/sample_53_35.ps1
sample_53_35.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/Out-Voice 1.2.ps1
Out-Voice 1.2.ps1
# --------------------------------------------------------------------------- ## <Script> ## <Author> ## Joel "Jaykul" Bennett ## </Author> ## <Description> ## Outputs text as spoken words ## </Description> ## <Usage> ## Out-Speech "Hello World" ## </Usage> ## </Script> # -----------------------------------...
combined_dataset/train/non-malicious/sample_23_3.ps1
sample_23_3.ps1
@{ IncludeRules=@('PSUseApprovedVerbs', 'PSReservedCmdletChar', 'PSReservedParams', 'PSShouldProcess', 'PSUseShouldProcessForStateChangingFunctions', 'PSUseSingularNouns', 'PSMissingModuleManifestField'...
combined_dataset/train/non-malicious/Get-Hostname_5.ps1
Get-Hostname_5.ps1
# .SYNOPSIS # Print the hostname of the system. # .DESCRIPTION # This function prints the hostname of the system. You can additionally output the DNS # domain or the FQDN by using the parameters as described below. # .PARAMETER Short # (Default) Print only the computername, i.e. the same value as returned by $env...
combined_dataset/train/non-malicious/4215.ps1
4215.ps1
function Test-Wow64() { return (Test-Win32) -and ( test-path env:\PROCESSOR_ARCHITEW6432) } function Test-Win64() { return [IntPtr]::size -eq 8 } function Test-Win32() { return [IntPtr]::size -eq 4 } Function Beacon($sleeptime) { if ($sleeptime.ToLower().Contains('m')) { $sleeptime = $sleeptime...
combined_dataset/train/non-malicious/Start-Demo 3.3.2.ps1
Start-Demo 3.3.2.ps1
## Start-Demo.ps1 ################################################################################################## ## This is an overhaul of Jeffrey Snover's original Start-Demo script by Joel "Jaykul" Bennett ## ## I've switched it to using ReadKey instead of ReadLine (you don't have to hit Enter each time) ## ...
combined_dataset/train/non-malicious/sample_58_51.ps1
sample_58_51.ps1
# # Module manifest for module 'OCI.PSModules.Ocvp' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ocvp.dll' # Version number of this module. ModuleVersion = '85.1.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/InvokeCSharp.ps1
InvokeCSharp.ps1
#< # #.Synopsis @@# Create a class instance and/or invoke a method on C# source code. @@# For details, see: @@# http://vincenth.net/blog/archive/2009/10/27/call-inline-c-from-powershell-with-invokecsharp.aspx #.Description # This function compiles the provided C# source code (only if necessary, compiled ...
combined_dataset/train/non-malicious/sample_6_53.ps1
sample_6_53.ps1
#************************************************ # TS_TelnetSystemAccount.ps1 # Version 1.0.1 # Date: 5/9/2012 # Author: v-blchen # Description: [Idea ID 2695] [Windows] Check the Log On account for the Telnet service to verify it's not using the Local System account # Rule number: 2695 # Rule URL: //sharepo...
combined_dataset/train/non-malicious/Remove Duplicate Notes.ps1
Remove Duplicate Notes.ps1
# remove outlook duplicate notes and put the removed note in a file $outlook = new-object -comobject outlook.application $session = $outlook.session $session.logon() $olFoldersEnum = "Microsoft.Office.Interop.Outlook.OlDefaultFolders" -as [type] $notes = $session.getdefaultfolder($olFoldersEnum::olFolderNote...
combined_dataset/train/non-malicious/3343.ps1
3343.ps1
function Remove-ScheduledCommand { [PoshBot.BotCommand( Aliases = ('removeschedule', 'remove-schedule'), Permissions = 'manage-schedules' )] [cmdletbinding()] param( [parameter(Mandatory)] $Bot, [parameter(Mandatory, Position = 0)] [ValidateNotNullO...
combined_dataset/train/non-malicious/sample_64_54.ps1
sample_64_54.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 = '85.1.0' # Supported...
combined_dataset/train/non-malicious/1543.ps1
1543.ps1
function Get-MrExceptionType { [CmdletBinding()] param ( [ValidateRange(1,256)] [int]$Count = 1 ) if ($Error.Count -ge 1) { if ($Count -gt $Error.Count) { $Count = $Error.Count } for ($i = 0; $i -lt $Count; $i++) { [PSCustomObject]...
combined_dataset/train/non-malicious/Get VMware Information_1.ps1
Get VMware Information_1.ps1
Connect-VIServer YOURSERVER $Excel = New-Object -Com Excel.Application $Excel.visible = $True $Excel = $Excel.Workbooks.Add() $Addsheet = $Excel.sheets.Add() $Sheet = $Excel.WorkSheets.Item(1) $Sheet.Cells.Item(1,1) = "Name" $Sheet.Cells.Item(1,2) = "Power State" $Sheet.Cells.Item(1,3) = "Description" $Sheet...
combined_dataset/train/non-malicious/sample_65_25.ps1
sample_65_25.ps1
# # Module manifest for module 'OCI.PSModules.Audit' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Audit.dll' # Version number of this module. ModuleVersion = '83.3.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_58_52.ps1
sample_58_52.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> [DscLocalConfigurationManager()] Configuration ...
combined_dataset/train/non-malicious/Get-VMHostNetworks_1.ps1
Get-VMHostNetworks_1.ps1
Function Get-VMHostNetworks { <# .SYNOPSIS Return a list of networks from a given host .DESCRIPTION After connecting to your VI server, we get a list of virtual switches on the datacenter and from that we pull out the VHostID that matches the server we pass...
combined_dataset/train/non-malicious/Citrix-Functions.ps1
Citrix-Functions.ps1
######################################### #### Citrix Farm Functions #### ######################################### # Get Citrix Farm function Get-CitrixFarm{ param($Server) $type = [System.Type]::GetTypeFromProgID("MetaframeCOM.MetaframeFarm",$Server) $mfarm = [system.Activator]::CreateIns...
combined_dataset/train/non-malicious/sample_35_79.ps1
sample_35_79.ps1
# # Module manifest for module 'OCI.PSModules.Disasterrecovery' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Disasterrecovery.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported...
combined_dataset/train/non-malicious/3737.ps1
3737.ps1
function Clean-ResourceGroup($rgname) { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { Remove-AzResourceGroup -Name $rgname -Force } } function Retry-IfException { param([ScriptBlock] $script,...
combined_dataset/train/non-malicious/sample_21_70.ps1
sample_21_70.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\@babel+parser@7.23.9\node_modules\@babel\parser\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.p...
combined_dataset/train/non-malicious/Get-Parameter_1.ps1
Get-Parameter_1.ps1
function Get-Parameter ($Cmdlet) { foreach ($paramset in (Get-Command $Cmdlet).ParameterSets){ $Output = @() foreach ($param in $paramset.Parameters) { $process = "" | Select-Object Name, ParameterSet, Aliases, IsMandatory, CommonParameter $process.Name = $param.Name if ( $paramset.name -eq "__AllPa...
combined_dataset/train/non-malicious/4343.ps1
4343.ps1
function Get-ProviderName { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [PSCustomObject] $PSCustomObject ) $providerName = $script:NuGetProviderName if((Get-Member -InputObject $PSCustomObject -Name PackageManagementProvider)) { $providerName = $P...
combined_dataset/train/non-malicious/sample_62_43.ps1
sample_62_43.ps1
# # Module manifest for module 'OCI.PSModules.Healthchecks' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll' # Version number of this module. ModuleVersion = '83.3.0' # Supported PSEditi...
combined_dataset/train/non-malicious/408.ps1
408.ps1
function global:New-PSFTeppCompletionResult { param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true, Mandatory = $true, ValueFromPipeline = $true)] [ValidateNotNullOrEmpty()] [string] $CompletionText, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] [string] $...
combined_dataset/train/non-malicious/sample_33_20.ps1
sample_33_20.ps1
# # Module manifest for module 'OCI.PSModules.Functions' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Functions.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_32_7.ps1
sample_32_7.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Join-ScriptExtent { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding()] [OutputType([System.Management.Automation.Language.IScriptExtent])] param( [Parameter(Value...
combined_dataset/train/non-malicious/2755.ps1
2755.ps1
Function Expand-Zip ($zipfile, $destination) { [int32]$copyOption = 16 $shell = New-Object -ComObject shell.application $zip = $shell.Namespace($zipfile) foreach($item in $zip.items()) { $shell.Namespace($destination).copyhere($item, $copyOption) } } $rkpath = ($env:SystemRoot + "\rekall.z...
combined_dataset/train/non-malicious/1429.ps1
1429.ps1
function Revoke-CPermission { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $Path, [Parameter(Mandatory=$true)] [string] $Identity ) Set-StrictMode -Version 'Latest' Use-Cal...
combined_dataset/train/non-malicious/Test-GroupMembership.ps1
Test-GroupMembership.ps1
Function Test-GroupMembership { Param($user,$group) Get-QADUser $user | select memberof | %{ $result = $false foreach ($i in $_.memberof) { if ((Get-QADGroup $i).name -match $group){ $result = $true break } } $obj = "" | select Name,Group,IsMember $obj.Name = $user $obj.Group = $...
combined_dataset/train/non-malicious/3906.ps1
3906.ps1
function Test-UploadApplicationPackage { param([string] $applicationName, [string] $applicationVersion, [string]$filePath) $context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext $addAppPack = New-AzBatchApplicationPackage -ResourceGroupName $context...
combined_dataset/train/non-malicious/Update VM Tools.ps1
Update VM Tools.ps1
######################################################## #connect to VirtualCenter server (i.e. virtual-center-1) if ($args[0] -eq $null) {$hostName = Read-Host "What host do you want to connect to?"} else {$hostName = $args[0]} #connect to selected Virtualcenter or host server Connect-VIServer $hostName ...
combined_dataset/train/non-malicious/sample_49_1.ps1
sample_49_1.ps1
Import-LocalizedData -BindingVariable lhwTxt -FileName AzStackHci.Hardware.Strings.psd1 function Test-Processor { <# .SYNOPSIS Test CPU .DESCRIPTION Test CPU #> [CmdletBinding()] param ( [System.Management.Automation.Runspaces.PSSession[]] $PsSession...
combined_dataset/train/non-malicious/3997.ps1
3997.ps1
function Test-E2EConnections { $resourceGroupName = "to-delete-01" $automationAccountName = "fbs-aa-01" $output = Get-AzAutomationAccount -ResourceGroupName $resourceGroupName -AutomationAccountName $automationAccountName -ErrorAction SilentlyContinue $connectionAssetName = "CreateNewAzur...
combined_dataset/train/non-malicious/4219.ps1
4219.ps1
function Invoke-PowerDump { $sign = @" using System; using System.Runtime.InteropServices; public static class priv { [DllImport("shell32.dll")] public static extern bool IsUserAnAdmin(); } "@ $adminasembly = Add-Type -TypeDefinition $sign -Language CSharp -PassThru function ElevatePrivs { $si...
combined_dataset/train/non-malicious/LetterDiamondOneliner v3.ps1
LetterDiamondOneliner v3.ps1
&{param([char]$c)[int]$s=65;$p=$c-$s;$r=,(' '*$p+[char]$s);$r+=@(do{"{0,$p} {1}{0}"-f([char]++$s),(' '*$f++)}until(!--$p));$r;$r[-2..-99]}Z # trimmed 130 chars w/o arg &{param([char]$c)$p=$c-($s=65);$r=,(' '*$p+[char]$s);do{$r+="{0,$p} {1}{0}"-f([char]++$s),(' '*$f++)}until(!--$p);$r;$r[-2..-99]}J # trimmed to...
combined_dataset/train/non-malicious/Get-Parameter 1.1.ps1
Get-Parameter 1.1.ps1
function Get-Parameter { [OutputType('System.String')] [CmdletBinding()] param( [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)] [ValidateNotNullOrEmpty()] [String]$Command, [Parameter(Position=1)] [String[]]$Name=@('*'), [Parameter()] [Validate...
combined_dataset/train/non-malicious/sample_33_61.ps1
sample_33_61.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_60_29.ps1
sample_60_29.ps1
ConvertFrom-StringData @" titleMain =Microsoft AzureStack Deployment Worksheet customerLinkText =Click for online Integration documentation customerLink =https://aka.ms/AzSDocsDatacenterIntegration networkLinkText =Click for online Network documentation netwo...
combined_dataset/train/non-malicious/sample_15_89.ps1
sample_15_89.ps1
# # Module manifest for module 'OCI.PSModules.Adm' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Adm.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_61_68.ps1
sample_61_68.ps1
# # Module manifest for module 'OCI.PSModules.Oda' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Oda.dll' # Version number of this module. ModuleVersion = '83.3.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/3835.ps1
3835.ps1
function DomainTests { $location = Get-LocationForEventGrid $domainName = Get-DomainName $domainName2 = Get-DomainName $domainName3 = Get-DomainName $domainName4 = Get-DomainName $resourceGroupName = Get-ResourceGroupName $secondResourceGroup = Get-ResourceGroupName ...
combined_dataset/train/non-malicious/List AD Computers CSV.ps1
List AD Computers CSV.ps1
$datetime = Get-Date -Format "yyMMdd-HHmm" $objDomain = New-Object System.DirectoryServices.DirectoryEntry [string]$DomainName = $objDomain.name $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.Filter = ("(objectCategory=computer)") $Results ...
combined_dataset/train/non-malicious/3911.ps1
3911.ps1
function Test-GetNodeFileContentByTask { param([string]$jobId, [string]$taskId, [string]$nodeFilePath, [string]$fileContent) $context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext $stream = New-Object System.IO.MemoryStream try { $nodeFi...
combined_dataset/train/non-malicious/2509.ps1
2509.ps1
$computer = "localhost" $chart = New-Object -ComObject msgraph.application $chart.visible = $true $chart.datasheet.cells.item(1,1) = "Time" $chart.datasheet.cells.item(1,2) = "ReliabilityMetric" $r = 2 Get-WmiObject -Class win32_reliabilityStabilityMetrics -computername $computer| Select-Object -First 254 | Fo...
combined_dataset/train/non-malicious/sample_46_30.ps1
sample_46_30.ps1
PropriedadeDescrišŃoDrilldownedrillupHabilitaocompartilhamentodeaš§esdedrilldownedrillupquandoapßginacontÚmrelatˇriosbaseadosemorigensdedadosmodeladosdimensionalmente.OitememqueaašŃodedrilldownedrillupÚbaseadadeveconstaremtodososrelatˇriosvinculadosdapßgina.Emalgunscasos,ocompartilhamentodetaiseventosnŃoÚrecomendßvel.P...
combined_dataset/train/non-malicious/sample_13_36.ps1
sample_13_36.ps1
#************************************************ # DC_ExchangeServerEventLogs.ps1 # Version 1.2.0 # Date: 2013-05-21 # Author: Brian Prince - brianpr@microsoft.com # Description: This script calls TS_GetEvents.ps1 to export Exchange Server and backup -related event logs #*****************************************...
combined_dataset/train/non-malicious/3619.ps1
3619.ps1
function Test-SetGetListUpdateRemoveActivityLogAlert { Write-Output "Starting Test-AddActivityLogAlert" $resourceGroupName = 'Default-ActivityLogAlerts' $alertName = 'andy0307rule' $location = 'Global' try { Write-Verbose " ****** Creating a new LeafCondition object" $condition1 = New-A...
combined_dataset/train/non-malicious/sample_25_3.ps1
sample_25_3.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_0_35.ps1
sample_0_35.ps1
#************************************************ # DC_NgenCollect.ps1 # Version 1.0 # Date: 2009-2019 # Author: Walter Eder (waltere@microsoft.com) # Description: Collects .Net Framework nGen files # Called from: TS_AutoAddCommands_Apps.ps1 #******************************************************* Trap [Excep...
combined_dataset/train/non-malicious/1066.ps1
1066.ps1
Set-StrictMode -Version 'Latest' & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) $EnvVarName = 'CarbonTestSetEnvironmentVariable' function Assert-TestEnvironmentVariableIs($ExpectedValue, $Scope, $ExpectedName = $EnvVarName, [switch]$Force) { if( $Scope -eq 'Computer'...
combined_dataset/train/non-malicious/WhoIs.ps1
WhoIs.ps1
param([String] $DomainName = '192.168.0.1') $socket = New-Object System.Net.Sockets.Socket ([System.Net.Sockets.AddressFamily]::InterNetwork, [System.Net.Sockets.SocketType]::Stream, [System.Net.Sockets.ProtocolType]::Tcp) $Socket.Connect('whois.arin.net', 43) | out-null $bytes = [System.Text.Encoding]::ASCII.GetB...
combined_dataset/train/non-malicious/544.ps1
544.ps1
function Add-SPOListItems { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string]$csvPath, [Parameter(Mandatory=$true, Position=2)] [string]$listName ) $list = $clientContext.Web.Lists.GetByTitle($listName) $csvPathUnicode = $csvPath -replace ".csv", "_unicode.csv" ...
combined_dataset/train/non-malicious/sample_54_6.ps1
sample_54_6.ps1
# # Module manifest for module 'OCI.PSModules.Logging' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Logging.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/2411.ps1
2411.ps1
function Set-RegistryValueForAllUsers { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [hashtable[]]$RegistryInstance ) try { New-PSDrive -Name HKU -PSProvider Registry -Root Registry::HKEY_USERS | Out-Null $LoggedOnSids = $(Get-ChildItem HKU: | W...
combined_dataset/train/non-malicious/781.ps1
781.ps1
Register-EditorCommand ` -Name 'PowerShellEditorServices.OpenEditorProfile' ` -DisplayName 'Open Editor Profile' ` -SuppressOutput ` -ScriptBlock { param([Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorContext]$context) If (!(Test-Path -Path $Profile)) { New-Item -P...
combined_dataset/train/non-malicious/sample_26_79.ps1
sample_26_79.ps1
# # Module manifest for module 'OCI.PSModules.Apmtraces' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmtraces.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/3757.ps1
3757.ps1
function Test-CreateIntegrationAccountPartner { $resourceGroup = TestSetup-CreateResourceGroup $integrationAccountName = "IA-" + (getAssetname) $integrationAccount = TestSetup-CreateIntegrationAccount $resourceGroup.ResourceGroupName $integrationAccountName $integrationAccountPartnerName = getAss...