full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_58_32.ps1
sample_58_32.ps1
$version="0.54.3" $fzf_base=Split-Path -Parent $MyInvocation.MyCommand.Definition function check_binary () { Write-Host " - Checking fzf executable ... " -NoNewline $output=cmd /c $fzf_base\bin\fzf.exe --version 2>&1 if (-not $?) { Write-Host "Error: $output" $binary_error="Invalid binary" } else { ...
combined_dataset/train/non-malicious/1176.ps1
1176.ps1
Set-StrictMode -Version 'Latest' & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) Describe 'Get-User' { It 'should get all users' { $users = Get-User try { $users | Should -Not -BeNullOrEmpty $users.Length | Should -BeGre...
combined_dataset/train/non-malicious/sample_42_35.ps1
sample_42_35.ps1
# # Module manifest for module 'OCI.PSModules.Loganalytics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loganalytics.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/4071.ps1
4071.ps1
[CmdletBinding()] param ( [switch] $OutputFile, [string] $TextFileLocation = '\\drfs1\DesktopApplications\ProductionApplications\Waller\MappedDrivesReport\Reports', [string] $UNCPathExclusionsFile = "\\drfs1\DesktopApplications\ProductionApplications\Waller\MappedDrivesReport\UNCPathExclusions.txt", [switch] $...
combined_dataset/train/non-malicious/Xml Module 4.ps1
Xml Module 4.ps1
#requires -version 2.0 # Improves over the built-in Select-XML by leveraging Remove-XmlNamespace http://poshcode.org/1492 # to provide a -RemoveNamespace parameter -- if it's supplied, all of the namespace declarations # and prefixes are removed from all XML nodes (by an XSL transform) before searching. # IMPO...
combined_dataset/train/non-malicious/sample_51_83.ps1
sample_51_83.ps1
@{ GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @( 'MSFT_MpComputerStatus.cdxml', 'MSFT_Mp...
combined_dataset/train/non-malicious/DefaultParameterValues_1.ps1
DefaultParameterValues_1.ps1
function Export-DefaultParameter { #.Synopsis # Exports the current default parameter values [CmdletBinding()] param( # The path to export default parameter values to (defaults to "DefaultParameterValues.clixml" in your profile directory) [String]$Path = $(Join-Path (Split-Path $Profile.CurrentUserAllHos...
combined_dataset/train/non-malicious/Get-Weather_2.ps1
Get-Weather_2.ps1
Function Get-Weather { <# .SYNOPSIS Display weather data for a specific country and city. .DESCRIPTION Display weather data for a specific country and city. There is a possibility for this to fail if the web service being used is unavailable. .PARAMETER Country URL of the website to test access to....
combined_dataset/train/non-malicious/3394.ps1
3394.ps1
function Test-AddVhd { $rgname = Get-ComputeTestResourceName try { $loc = Get-ComputeVMLocation; New-AzureRmResourceGroup -Name $rgname -Location $loc -Force; $stoname = 'sto' + $rgname; $stotype = 'Standard_GRS'; New-AzureRmSto...
combined_dataset/train/non-malicious/File navigator.ps1
File navigator.ps1
$empty = "<NULL>" $itmType = "Directory", "File" function LoadTreeView { $nodes = [IO.Directory]::GetLogicalDrives() $trvRoot.Nodes.Clear() foreach ($nod in $nodes) { $node = New-Object Windows.Forms.TreeNode $node = $trvRoot.Nodes.Add($nod) $node.Nodes.Add($empty) } } function ...
combined_dataset/train/non-malicious/2518.ps1
2518.ps1
param( [Parameter(Mandatory = $true)] $StartupParameter ) $hklmRootNode = "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server" $props = Get-ItemProperty "$hklmRootNode\Instance Names\SQL" $instances = $props.psobject.properties | ?{$_.Value -like 'MSSQL*'} | select Value $instances | %{ $inst ...
combined_dataset/train/non-malicious/sample_51_5.ps1
sample_51_5.ps1
@{ IncludeRules=@('PSAvoidUsingCmdletAliases', 'PSAvoidUsingWMICmdlet', 'PSAvoidUsingEmptyCatchBlock', 'PSUseCmdletCorrectly', 'PSUseShouldProcessForStateChangingFunctions', 'PSAvoidUsingPositionalParameters', ...
combined_dataset/train/non-malicious/sample_21_2.ps1
sample_21_2.ps1
<# # .DESCRIPTION # Run powershell scripts using scheduled task. # # .PARAMETER taskName # The task name. # # .PARAMETER script # The inlined script to execute on remote machine. # #> $ScriptFile = Join-Path -Path $env:LocalAppData -ChildPath "$taskName.ps1" $ResultFile = Join-Path -Path $env:...
combined_dataset/train/non-malicious/sample_36_54.ps1
sample_36_54.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/663.ps1
663.ps1
Function Get-ExistingDataExtension { $proxy = New-RsWebServiceProxy return $proxy.ListExtensions("Data")[0].Name } Describe "Get-RsDataSource" { Context "Get RsDataSource with ReportServerUri parameter"{ $dataSourceName = 'SutGetDataSourceReportServerUri' + [guid]::NewGuid() $extension...
combined_dataset/train/non-malicious/sample_7_83.ps1
sample_7_83.ps1
ConvertFrom-StringData @' id_ctssmbclient=SMB Client Component id_ctssmbclientdescription=Collects information about the SMB Client component. '@ # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG #...
combined_dataset/train/non-malicious/sample_33_58.ps1
sample_33_58.ps1
# # Module manifest for module 'OCI.PSModules.Servicecatalog' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicecatalog.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSE...
combined_dataset/train/non-malicious/1482.ps1
1482.ps1
function Publish-NuGetPackage { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $ManifestPath, [Parameter(Mandatory=$true)] [string] $NuspecPath, [Parameter(Mandatory=$true)] [string] ...
combined_dataset/train/non-malicious/sample_14_93.ps1
sample_14_93.ps1
ConvertFrom-StringData @' id_proliantdl385nmicrashdump_sd=NMICrashDump is set to 1 on this HP ProLiant DL385 G5. This setting may block machine dumps via NMI to be generated. '@ # SIG # Begin signature block # MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEe...
combined_dataset/train/non-malicious/MainulatingCustomObjects.ps1
MainulatingCustomObjects.ps1
function JoinTwoCustomObjs($Parent,$Child,$Key) { $CurrentErrorSetting = $ErrorActionPreference $ErrorActionPreference = 'SilentlyContinue' $new = New-Object -TypeName PsObject $ParentProps = Get-Member -InputObject $Parent -MemberType NoteProperty foreach($prop in $ParentProps) { $PropName = $prop...
combined_dataset/train/non-malicious/sample_1_57.ps1
sample_1_57.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/sample_16_22.ps1
sample_16_22.ps1
##---------------------------------------------------------------------------- ## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved. ##--------------------------------------------------------------------------- # Import shared functions and vars . .\Commonalities.ps1 . .\StringConstants.ps1 Wr...
combined_dataset/train/non-malicious/2819.ps1
2819.ps1
if (Get-Command logparser.exe) { $lpquery = @" SELECT COUNT(Type, Subtype, Data) as ct, ServiceName, Action, Type, Subtype, Data FROM *svctrigs.tsv GROUP BY ServiceName, Action, Type, Subtype, Dat...
combined_dataset/train/non-malicious/sample_11_9.ps1
sample_11_9.ps1
# # Module manifest for module 'OCI.PSModules.Containerinstances' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Containerinstances.dll' # Version number of this module. ModuleVersion = '75.1.0' # Suppo...
combined_dataset/train/non-malicious/4137.ps1
4137.ps1
[CmdletBinding()] param ( [string] $AppsFile = $null, [string] $AppName = $null, [ValidateNotNullOrEmpty()][boolean] $GetAppList = $false, [ValidateNotNullOrEmpty()][boolean] $Log = $false ) Import-Module Appx function Get-AppName { [CmdletBinding()] param ( [Parameter(Mandatory = $true)][ValidateNotN...
combined_dataset/train/non-malicious/sample_3_15.ps1
sample_3_15.ps1
ConvertFrom-StringData @' id_pstat=Process and Driver Information (pstat) id_pstatrunning=Running pstat tool to obtain process information id_pstatoutput=Pstat Output '@ # SIG # Begin signature block # MIIoQgYJKoZIhvcNAQcCoIIoMzCCKC8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAw...
combined_dataset/train/non-malicious/finddupe_10.ps1
finddupe_10.ps1
function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.MD5CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.OpenRead(); $hashByteArray = $hashA...
combined_dataset/train/non-malicious/Exchange AutoReply Admin.ps1
Exchange AutoReply Admin.ps1
<# .NOTES Name : Exchange Automatic Replies Administrator.ps1 Author : Bryan Jaudon <bryan.jaudon@gmail.com> Version : 1.0 Date : 11/23/2012 .SYNOPSIS Provides a graphical front-end to the Get-MailboxAutoReplyConfiguration and Set-MailboxAutoReplyConfiguration Exch...
combined_dataset/train/non-malicious/sample_6_5.ps1
sample_6_5.ps1
ConvertFrom-StringData @' id_rdsserverprogress=Gathering RDS Information: id_rdsls=Getting License Server configuration. id_rdslssenetworklogonright=Check if SeNetworkLogonRight is preventing network connectivity to License server id_rdslssenetworklogonrightsolution=Please make sure that the RDS servers can 'access...
combined_dataset/train/non-malicious/Get_Set Signature _1.0.ps1
Get_Set Signature _1.0.ps1
#Requires -version 2.0 ## Authenticode.psm1 updated for PowerShell 2.0 (with time stamping) #################################################################################################### ## Wrappers for the Get-AuthenticodeSignature and Set-AuthenticodeSignature cmdlets ## These properly parse paths, so they...
combined_dataset/train/non-malicious/sample_17_35.ps1
sample_17_35.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-LocalGroupMembers_1.ps1
Get-LocalGroupMembers_1.ps1
function Get-LocalGroupMembers { param($groupname) $pattern = "*Name=`"$groupname`"" $groupusers = gwmi Win32_GroupUser | Where { $_.GroupComponent -like $pattern } # Now extract the usernames. foreach ($user in $groupusers) { if ($user.PartComponent -match 'Name="([^"]+)') { Write-Output $matches[...
combined_dataset/train/non-malicious/sample_37_56.ps1
sample_37_56.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_15_17.ps1
sample_15_17.ps1
##------------------------------------------------------------------ ## <copyright file="Uninstall-Extension.ps1" company="Microsoft"> ## Copyright (C) Microsoft. All rights reserved. ## </copyright> ##------------------------------------------------------------------ $ErrorActionPreference = "Stop" $funct...
combined_dataset/train/non-malicious/508.ps1
508.ps1
function Write-PPEventLog{ param( [Parameter(Mandatory=$true)] $Message, [Parameter(Mandatory=$false)] $EventLog, [Parameter(Mandatory=$false)] $EventId, [Parameter(Mandatory=$false)] $Source, [Param...
combined_dataset/train/non-malicious/3050.ps1
3050.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "Should -BeIn" { It "passes if value is in the collection" { 'a' | Should BeIn @(1, 'a', 3) 'a' | Should -BeIn @(1, 'a', 3) } It "fails if value is not in the collection" { { 'b' | Should BeI...
combined_dataset/train/non-malicious/1504.ps1
1504.ps1
function Assert-Null { [CmdletBinding()] param( [Parameter(Position=0)] [object] $Value, [Parameter(Position=1)] [string] $Message ) Set-StrictMode -Version 'Latest' if( $Value -ne $null ) { Fail "Va...
combined_dataset/train/non-malicious/1470.ps1
1470.ps1
function Split-MarkdownTopic { [CmdletBinding()] param( [Parameter(Mandatory=$true)] $ConfigFileRoot, [Parameter(Mandatory=$true,ValueFromPipeline=$true)] $TopicInfo ) process { Set-StrictMode -Version Latest $path = $TopicInf...
combined_dataset/train/non-malicious/3140.ps1
3140.ps1
if(-not([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { $Arguments = "& '" + $MyInvocation.MyCommand.Definition + "'" Start-Process PowerShell.exe -Verb RunAs -ArgumentList $Arguments Break }
combined_dataset/train/non-malicious/sample_58_3.ps1
sample_58_3.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/Get-WebPage.ps1
Get-WebPage.ps1
function Get-WebPage { <# .SYNOPSIS Downloads web page from site. .DESCRIPTION Downloads web page from site and displays source code or displays total bytes of webpage downloaded .PARAMETER Url URL of the website to test access to. .PARAMETER UseDefaultCredentials Use the currently authentica...
combined_dataset/train/non-malicious/4051.ps1
4051.ps1
param([hashtable]$Theme) Set-StrictMode -Version Latest if ($Pscx:IsAdmin -and ([System.Environment]::OSVersion.Version.Major -gt 5)) { $Theme.PromptForegroundColor = 'Red' } $Theme.PromptScriptBlock = { param($nextCommandId) $nestingLevel = '' if ($nestedpromptlevel -ge ...
combined_dataset/train/non-malicious/sample_27_56.ps1
sample_27_56.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_17_39.ps1
sample_17_39.ps1
# *********************************************************************************************** # File: utils_ConfigMgr12-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 variables/functions. View utils_ConfigM...
combined_dataset/train/non-malicious/751.ps1
751.ps1
param( [Parameter(Mandatory)] [semver] $Version, [Parameter(Mandatory)] [string] $GitHubToken, [Parameter(Mandatory)] [string] $Repository, [Parameter()] [string] $TargetFork = 'PowerShell', [Parameter()] [string] $ChangelogPath = "$PSScriptRoot/../.....
combined_dataset/train/non-malicious/946.ps1
946.ps1
$uniqueId=$(-join ((97..122) + (48..57) | Get-Random -Count 15 | % {[char]$_})) $apiVersion = "2015-04-08" $location = "West US 2" $resourceGroupName = "myResourceGroup" $accountName = "mycosmosaccount-$uniqueId" $databaseName = "database1" $containerName = "container1" $databaseResourceName = $accountName + "/sql...
combined_dataset/train/non-malicious/GET-Remoteapps.ps1
GET-Remoteapps.ps1
# Original posting on how to access a remote Registry from The Powershell Guy # # http://thepowershellguy.com/blogs/posh/archive/2007/06/20/remote-registry-access-and-creating-new-registry-values-with-powershell.aspx # # This script will Query the Uninstall Key on a computer specified in $computername and list the...
combined_dataset/train/non-malicious/sample_45_16.ps1
sample_45_16.ps1
# # Module manifest for module 'OCI.PSModules.Computeinstanceagent' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Computeinstanceagent.dll' # Version number of this module. ModuleVersion = '75.1.0' # S...
combined_dataset/train/non-malicious/1772.ps1
1772.ps1
Describe "Acl cmdlets are available and operate properly" -Tag CI { It "Get-Acl returns an ACL object" -pending:(!$IsWindows) { $ACL = get-acl $TESTDRIVE $ACL | Should -BeOfType "System.Security.AccessControl.DirectorySecurity" } It "Set-Acl can set the ACL of a directory" -pending { ...
combined_dataset/train/non-malicious/2964.ps1
2964.ps1
properties { $testMessage = 'Executed Test!' $compileMessage = 'Executed Compile!' $cleanMessage = 'Executed Clean!' } task default -depends Test task Test -depends Compile, Clean { $testMessage } task Compile -depends Clean { $compileMessage } task Clean { $cleanMessage } task ? -Description "Helper t...
combined_dataset/train/non-malicious/2701.ps1
2701.ps1
function Get-AssemblyResources { Param ( [Parameter(Mandatory = $True, ParameterSetName = 'AssemblyPath', ValueFromPipeline = $True)] [ValidateScript({Test-Path $_})] [Alias('Path')] [String] $AssemblyPath, [Parameter(Mandatory = $True, ParameterSetName = 'Assemb...
combined_dataset/train/non-malicious/sample_20_49.ps1
sample_20_49.ps1
# # Module manifest for module 'OCI.PSModules.Servicemanagerproxy' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemanagerproxy.dll' # Version number of this module. ModuleVersion = '80.0.0' # Sup...
combined_dataset/train/non-malicious/115.ps1
115.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 i...
combined_dataset/train/non-malicious/7697c70c-75c8-4a8e-86cd-5e8f3f2f1eb7.ps1
7697c70c-75c8-4a8e-86cd-5e8f3f2f1eb7.ps1
Function PowerOn-VM($vm){ Start-VM -VM $vm -Confirm:$false -RunAsync | Out-Null do { $vmview = get-VM $vm | Get-View $status = $vmview.Guest.ToolsStatus Write-Host $vm is starting! -ForegroundColor Yellow sleep 5 }until(($status -match "toolsOld") -or ($status -match "toolsOk")) ...
combined_dataset/train/non-malicious/717.ps1
717.ps1
function New-RsRestCredentialsInServerObject { [CmdletBinding()] param( [Parameter(Mandatory = $True)] [System.Management.Automation.PSCredential] $Credential, [Alias('UseAsWindowsCredentials')] [switch] $WindowsCredentials, [Alias('ImpersonateAu...
combined_dataset/train/non-malicious/1569.ps1
1569.ps1
function Get-MrInternetConnectionSharing { [CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [Alias('Name')] [string[]]$InternetInterfaceName ) BEGIN { regsvr32.exe /s hnetcfg.dl...
combined_dataset/train/non-malicious/sample_37_47.ps1
sample_37_47.ps1
<# .SYNOPSIS Script that builds Python from source using the Relative Environment for Python project (relenv): https://github.com/saltstack/relative-environment-for-python .DESCRIPTION This script builds python from Source. It then creates the directory structure as created by the Python installer. This includes all ...
combined_dataset/train/non-malicious/sample_50_10.ps1
sample_50_10.ps1
ConvertFrom-StringData @' FailoverClustersModuleRequired=The required PowerShell module (FailoverClusters) was not found. Use Roles & Features Tool to install: Remote Server Administration Tools | Feature Administration Tools | Failover Clustering Tools | Failover Cluster Module for Windows PowerShell. HyperVModuleRe...
combined_dataset/train/non-malicious/sample_3_58.ps1
sample_3_58.ps1
#************************************************ # TS_2K3CLSIDUserACLCheck.ps1 # Version 1.0.1 # Date: 6/12/2012 # Author: v-kaw # Description: [Idea ID 4368] [Windows] Windows Logon Slow and Explorer Slow # Rule number: 4368 # Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.aspx?ID=4...
combined_dataset/train/non-malicious/sample_23_1.ps1
sample_23_1.ps1
param ( [Parameter(Mandatory = $true)] [PSObject] $Session ) # Export Certificate Invoke-Command -Session $Session -ScriptBlock { param() try { function Set-FolderPermissions([string]$folder, [string]$account) { Write-Host "Adding permissions to folder '$folder'" ...
combined_dataset/train/non-malicious/sample_53_99.ps1
sample_53_99.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/sample_5_96.ps1
sample_5_96.ps1
ConvertFrom-StringData @' id_clustervalidationreport=Cluster Validation Report id_clustervalidationreportobtaining=Obtaining Cluster Validation Report id_clustervalidationreportstatus=Connecting to %Node% Service Control Manager id_clustervalidationreporttestnet=Testing Networking and obtaining Cluster Validation r...
combined_dataset/train/non-malicious/827.ps1
827.ps1
$cred = Get-Credential New-AzVmss ` -ResourceGroupName "myResourceGroup" ` -VMScaleSetName "myScaleSet" ` -Location "EastUS" ` -VirtualNetworkName "myVnet" ` -SubnetName "mySubnet" ` -PublicIpAddressName "myPublicIPAddress" ` -LoadBalancerName "myLoadBalancer" ` -Credential $cred ` -ImageName...
combined_dataset/train/non-malicious/3907.ps1
3907.ps1
function Test-ComputeNodeUserEndToEnd { param([string]$poolId, [string]$computeNodeId) $context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext $userName = "userendtoend" $password1 = ConvertTo-SecureString "Password1234!" -AsPlainText -Force ...
combined_dataset/train/non-malicious/284.ps1
284.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$TRUE, HelpMessage="Name of capacity for scaling or target for workspaces migration.")] [string]$CapacityName, [Parameter(Mandatory=$TRUE, HelpMessage="ResourceGroup of capacity for scaling or tar...
combined_dataset/train/non-malicious/sample_5_20.ps1
sample_5_20.ps1
ConvertFrom-StringData @' id_remotedesktoplserverkb2512845_sd=The version of Terminal Services Licensing installed on this computer is incompatible with Windows Server 2008 (or newer) Remote Desktop Services '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgE...
combined_dataset/train/non-malicious/Test-Host V1.ps1
Test-Host V1.ps1
Param($property,$tport=135,$timeout=1000,[switch]$port,[switch]$verbose) Begin{ function TestPort { Param($srv) $error.Clear() $ErrorActionPreference = "SilentlyContinue" $tcpclient = new-Object system.Net.Sockets.TcpClient $iar = $tcpclient.BeginConnect($srv,$tport,$n...
combined_dataset/train/non-malicious/sample_22_87.ps1
sample_22_87.ps1
# # Module manifest for module 'OCI.PSModules.Mediaservices' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Mediaservices.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/2744.ps1
2744.ps1
Get-NetIPInterface
combined_dataset/train/non-malicious/sample_51_77.ps1
sample_51_77.ps1
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. #Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may n...
combined_dataset/train/non-malicious/sample_9_24.ps1
sample_9_24.ps1
# diag_dnd.psm1 # Created by tdimli # March 2020 # # Diagnostic functions for DND area # version $DND_version = "1.0.240710.0" # Area and Area/Component arrays $DND = @("xray_dnd_pnp", "xray_dnd_powermgmt") #Component/Diagnostic Function arrays $xray_dnd_pnp = @("dnd_pnp_KB5017275") $xray_dnd_powermgmt...
combined_dataset/train/non-malicious/sample_48_59.ps1
sample_48_59.ps1
@{ GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @('MSFT_MpPerformanceRecording.psm1') FormatsToProcess = @(...
combined_dataset/train/non-malicious/sample_62_92.ps1
sample_62_92.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 = '85.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/Convert-ToCHexString_1.ps1
Convert-ToCHexString_1.ps1
function Convert-ToCHexString { param([String] $input) $ans = '' [System.Text.Encoding]::ASCII.GetBytes($str) | % { $ans += "0x{0:X2}, " -f $_ } return $ans.Trim(',',' ') }
combined_dataset/train/non-malicious/sample_23_93.ps1
sample_23_93.ps1
######################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # Common/Shared Functions, Types, and Variables # ######################################################################################### #requires -runasa...
combined_dataset/train/non-malicious/sample_17_7.ps1
sample_17_7.ps1
ConvertFrom-StringData @' id_fileacl=Determining file ACL's '@ # SIG # Begin signature block # MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA6VsPfmmzM00am # qvD0ITk80rX9ws5...
combined_dataset/train/non-malicious/sample_57_92.ps1
sample_57_92.ps1
# # Module manifest for module 'OCI.PSModules.Fleetsoftwareupdate' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Fleetsoftwareupdate.dll' # Version number of this module. ModuleVersion = '87.0.0' # Sup...
combined_dataset/train/non-malicious/3731.ps1
3731.ps1
function Test-TestStreamingAnalyticsE2E { $resourceGroup = "ASASDK" $jobName = "TestJobPS" $inputName = "Input" $outputName = "Output" $transformationName = "transform1" $functionName = "scoreTweet" $expectedContainerName = "samples" $expectedTableName = "Samples" $expectedStreamingUnits =...
combined_dataset/train/non-malicious/Get-LocalGroupMember_1.ps1
Get-LocalGroupMember_1.ps1
function Get-LocalGroupMember { param( # The name of the local group to retrieve members of [Parameter(Position=0,Mandatory=$true)] [String]$GroupName = "administrators", # A filter for the user name(s) [Parameter(Position=1)] [String]$UserName = "*", # The computer to query (defaults ...
combined_dataset/train/non-malicious/3524.ps1
3524.ps1
function QueryOptions-QueryResultsWithFrom { $from = Get-TestQueryIntervalStart $policyStates = Get-AzPolicyState -From $from -Top 10 Validate-PolicyStates $policyStates 10 } function QueryOptions-QueryResultsWithTo { $to = Get-TestQueryIntervalEnd $policyStates = Get-AzPolicyState -To $to...
combined_dataset/train/non-malicious/sample_5_57.ps1
sample_5_57.ps1
#************************************************ # TS_DCOMEnabledk.ps1 # Version 1.0.0 # Date: 03-23-2012 # Author: Jeremy LaBorde - jlaborde # Description: Checks to see if DCOM is enabled #************************************************ . .\DistSvcs_Utils.ps1 Import-LocalizedData -BindingVariable Scrip...
combined_dataset/train/non-malicious/Save-Credentials_6.ps1
Save-Credentials_6.ps1
<# .SYNOPSIS The script saves a username and password, encrypted with a custom key to to a file. .DESCRIPTION The script saves a username and password, encrypted with a custom key to to a file. The key is coded into the script but should be changed before use. The key allows the password to be decrypted ...
combined_dataset/train/non-malicious/sample_40_53.ps1
sample_40_53.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/4204.ps1
4204.ps1
[CmdletBinding()] param () function Get-Architecture { [CmdletBinding()][OutputType([string])] param () $OSArchitecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture $OSArchitecture = $OSArchitecture.OSArchitecture Return $OSArchitecture } function Get-MSIInformation { ...
combined_dataset/train/non-malicious/WinFirewall-Stoped.ps1
WinFirewall-Stoped.ps1
function WinFirewall-Stoped(){ param ( $computer ) c:\\PsTools\\PsExec.exe \\\\"$computer" sc stop sharedaccess }
combined_dataset/train/non-malicious/1716db2c-bd83-404b-b8ec-beb189e225b4.ps1
1716db2c-bd83-404b-b8ec-beb189e225b4.ps1
$mykey = "xxx" $newkey = "yyy" $OFS = "" cd C:\\Users\\kagami\\Downloads ls | % { if ($_.name -match "^\\[rutracker\\.org\\].*\\.torrent") { $file = $_.name $data = cat -en byte -LiteralPath $file $data2 = ([string][char[]]$data) -replace "ann\\?uk=$mykey", "ann?uk=$newkey" ...
combined_dataset/train/non-malicious/1850.ps1
1850.ps1
Describe "ForEach-Object" -Tags "CI" { BeforeAll { $testModulePsd1 = Join-Path $TestDrive "ForEachObjectTest.psd1" $testModulePsm1 = Join-Path $TestDrive "ForEachObjectTest.psm1" Set-Content -Path $testModulePsm1 -Value @' function Zoo { "ForEachObjectTest-Zoo" } function GetScrip...
combined_dataset/train/non-malicious/4182.ps1
4182.ps1
[CmdletBinding()] param () function Get-RelativePath { [CmdletBinding()][OutputType([string])] param () $Path = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent) + "\" Return $Path } $RelativePath = Get-RelativePath $InstalledVersion = [string]((Get-WmiObject Win32_BIOS).SMBIOSBIOSVersion) $Model = ((...
combined_dataset/train/non-malicious/967.ps1
967.ps1
$resourceGroup = "myResourceGroup" $location = "westeurope" $vmName = "myVM" $cred = Get-Credential -Message "Enter a username and password for the virtual machine." New-AzResourceGroup -Name $resourceGroup -Location $location $subnetConfig = New-AzVirtualNetworkSubnetConfig -Name mySubnet -AddressPrefix 192.168...
combined_dataset/train/non-malicious/sample_16_39.ps1
sample_16_39.ps1
# # Module manifest for module 'PowerShellEditorServices' # # Generated by: daviwil # # Generated on: 5/12/2016 # @{ # Script module or binary module file associated with this manifest. RootModule = if ($PSEdition -eq 'Core') { 'bin/Core/Microsoft.PowerShell.EditorServices.Hosting.dll' }...
combined_dataset/train/non-malicious/sample_39_92.ps1
sample_39_92.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=Proměnná prostředí s tímto názvem a typem už existuje. EnvironmentErrorDoesNotExists=Proměnná prostředí s tímto názvem a typem neexistuje. '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGs...
combined_dataset/train/non-malicious/sample_32_95.ps1
sample_32_95.ps1
@{ ModuleVersion = '7.0.1' GUID = '3859ddf6-1713-4701-adf3-477aeaa06333' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Microsoft® Corporation. All rights reserved." NestedModules="Newtonsoft.Json.dll" } # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDz...
combined_dataset/train/non-malicious/1976.ps1
1976.ps1
Describe "Get-Verb" -Tags "CI" { It "Should get a list of Verbs" { Get-Verb | Should -Not -BeNullOrEmpty } It "Should get a specific verb" { @(Get-Verb -Verb Add).Count | Should -Be 1 @(Get-Verb -Verb Add -Group Common).Count | Should -Be 1 } It "Should get a specific gr...
combined_dataset/train/non-malicious/sample_34_44.ps1
sample_34_44.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_37_42.ps1
sample_37_42.ps1
# # Module manifest for module 'OCI.PSModules.Core' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Core.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/Set-IPAddress_9.ps1
Set-IPAddress_9.ps1
function Set-IPAddress { param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"), [string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"), [string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"), [string]$gateway = $(read-host "Enter...
combined_dataset/train/non-malicious/1136.ps1
1136.ps1
[CmdletBinding()] param( [Switch] $ForDsc ) Set-StrictMode -Version 'Latest' if( $env:COMPUTERNAME -eq $env:USERNAME ) { throw ('Can''t run Carbon tests. The current user''s username ({0}) is the same as the computer name ({1}). This causes problems with resolving identities, getting items fr...
combined_dataset/train/non-malicious/Trim Working Set for PID.ps1
Trim Working Set for PID.ps1
## Trim Working set Function TrimWorkingSet { param([int] $procid) <#.NOTES AUTHOR: Sunny Chakraborty(sunnyc7@gmail.com) WEBSITE: http://tekout.wordpress.com CREATED: 9/20/2012 This starts the Evil Monkey series of scripts. .DESCRIPTION MSDN - http://msdn.microsoft.com/en-us/library/windows/desktop/ms6862...
combined_dataset/train/non-malicious/sample_25_40.ps1
sample_25_40.ps1
# # Module manifest for module 'OCI.PSModules.Threatintelligence' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Threatintelligence.dll' # Version number of this module. ModuleVersion = '83.2.0' # Suppo...
combined_dataset/train/non-malicious/sample_34_84.ps1
sample_34_84.ps1
@{ GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" NestedModules="Microsoft.PowerShell.Commands.Management.dll" HelpInfoURI = 'https://aka...