full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_41_73.ps1
sample_41_73.ps1
# # Module manifest for module 'OCI.PSModules.Marketplace' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Marketplace.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_42_14.ps1
sample_42_14.ps1
##------------------------------------------------------------------ ## <copyright file="Install-Extension.ps1" company="Microsoft"> ## Copyright (C) Microsoft. All rights reserved. ## </copyright> ##------------------------------------------------------------------ $ErrorActionPreference = "Stop" $functio...
combined_dataset/train/non-malicious/sample_56_91.ps1
sample_56_91.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ function Publish-UpgradedServ...
combined_dataset/train/non-malicious/118.ps1
118.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/Get-FSMORoleOwner_1.ps1
Get-FSMORoleOwner_1.ps1
Function Get-FSMORoleOwner { <# .SYNOPSIS Retrieves the list of FSMO role owners of a forest and domain .DESCRIPTION Retrieves the list of FSMO role owners of a forest and domain .NOTES Name: Get-FSMORoleOwner Author: Boe Prox DateCreated: 06/9/2011 .EXAMPLE ...
combined_dataset/train/non-malicious/sample_59_20.ps1
sample_59_20.ps1
# # Module manifest for module 'OCI.PSModules.Managementagent' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Managementagent.dll' # Version number of this module. ModuleVersion = '83.3.0' # Supported P...
combined_dataset/train/non-malicious/Set-PSObjectDefaultPrope.ps1
Set-PSObjectDefaultPrope.ps1
function Set-PSObjectDefaultProperties { param( [PSObject]$Object, [string[]]$DefaultProperties ) $name = $Object.PSObject.TypeNames[0] $xml = "<?xml version='1.0' encoding='utf-8' ?><Types><Type>" $xml += "<Name>$($name)</Name>" $xml...
combined_dataset/train/non-malicious/Get-Tomorrow.ps1
Get-Tomorrow.ps1
##############################################################################\n## Get-Tomorrow\n##\n## Get the date that represents tomorrow\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n######################################################################...
combined_dataset/train/non-malicious/sample_33_12.ps1
sample_33_12.ps1
# # Script module for module 'Az.ManagedServices' that is executed when 'Az.ManagedServices' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 04/23/2024 13:01:41 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try...
combined_dataset/train/non-malicious/sample_58_30.ps1
sample_58_30.ps1
# # Module manifest for module 'OCI.PSModules.Licensemanager' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll' # Version number of this module. ModuleVersion = '83.3.0' # Supported PSE...
combined_dataset/train/non-malicious/3999.ps1
3999.ps1
$rg = "mms-wcus" $aa = "JemalOMSAutomation" $azureVMIdsW = @( "/subscriptions/cd45f23b-b832-4fa4-a434-1bf7e6f14a5a/resourceGroups/mms-wcus/providers/Microsoft.Compute/virtualMachines/JemalCmdlet1", "/subscriptions/cd45f23b-b832-4fa4-a434-1bf7e6f14a5a/resourceGroups/...
combined_dataset/train/non-malicious/sample_48_14.ps1
sample_48_14.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/Add-FormatTableIndexPara.ps1
Add-FormatTableIndexPara.ps1
##############################################################################\n##\n## Add-FormatTableIndexParameter\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPS...
combined_dataset/train/non-malicious/sample_51_17.ps1
sample_51_17.ps1
<# .SYNOPSIS Demonstrates how to write a command that works with paths that do not allow wildards and do not have to exist. .DESCRIPTION This command does not require a LiteralPath parameter because the Path parameter can handle paths that use wildcard characters. That's because this command...
combined_dataset/train/non-malicious/NTFS Streams 1.0.ps1
NTFS Streams 1.0.ps1
#requires -version 2.0 ## Version 1.0 - First release outside of the PoshCode module. $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent function Set-DownloadFlag { <# .Synopsis Sets the ZoneTransfer flag which marks a file as being downloaded from the internet. .Description Creates a Zone.Id...
combined_dataset/train/non-malicious/1296.ps1
1296.ps1
function Install-CMsmqMessageQueue { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $Name, [Switch] $Private, [Switch] $Transactional ) Set-StrictMod...
combined_dataset/train/non-malicious/2382.ps1
2382.ps1
[CmdletBinding(DefaultParameterSetName = 'Neither')] param ( [Parameter(Mandatory)] [datetime]$StartTimestamp, [Parameter(Mandatory)] [datetime]$EndTimestamp, [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] [string]$ComputerName = 'localhost', [Parameter()] [System.Mana...
combined_dataset/train/non-malicious/sample_0_73.ps1
sample_0_73.ps1
ConvertFrom-StringData @' id_clusterinfo=Cluster Information id_clusterinforesquery=Processing Resources: %ResourceName% (%Current% of %top%) id_clusterinfoquery=Cluster Group %GroupName% - Querying resources '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # ...
combined_dataset/train/non-malicious/sample_39_42.ps1
sample_39_42.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/4198.ps1
4198.ps1
Function InitializeGlobalMemory { Set-Variable -Name Computers -Scope Global -Force Set-Variable -Name Logfile -Scope Global -Force Set-Variable -Name RelativePath -Scope Global -Force Set-Variable -Name Webroot -Scope Global -Force $Global:Failures = @() $Global:RelativePath = (split-path $SCRIPT:MyInvocation....
combined_dataset/train/non-malicious/sample_37_9.ps1
sample_37_9.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 = '81.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/Start-Encryption_1.ps1
Start-Encryption_1.ps1
## Start-Encryption ################################################################################################## ## Rijndael symmetric key encryption ... with no passes on the key. Very lazy. ## USAGE: ## $encrypted = Encrypt-String "Oisin Grehan is a genius" "P@ssw0rd" ## Decrypt-String $encrypted "P@ssw0rd...
combined_dataset/train/non-malicious/sample_58_5.ps1
sample_58_5.ps1
class AzStackHciConnectivityTarget { # Attributes for Azure Monitor schema [string]$Name #Name of the individual test/rule/alert that was executed. Unique, not exposed to the customer. [string]$Title #User-facing name; one or more sentences indicating the direct issue. [string]$Severity #Severity o...
combined_dataset/train/non-malicious/1031.ps1
1031.ps1
$subscriptionId = 'yourSubscriptionId' $certpwd="Password $certfolder="c:\mycertificates\" $adminuser="vmadmin" $adminpwd="Password $clusterloc="SouthCentralUS" $clustername = "mysfcluster" $groupname="mysfclustergroup" $vmsku = "Standard_D2_v2" $vaultname = "mykeyvault" $subname="$clustername.$clusterloc...
combined_dataset/train/non-malicious/3038.ps1
3038.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "Should -MatchExactly" { It "returns true for things that match exactly" { 'foobar' | Should MatchExactly 'ob' 'foobar' | Should -MatchExactly 'ob' 'foobar' | Should -CMATCH 'ob' } It "return...
combined_dataset/train/non-malicious/sample_44_91.ps1
sample_44_91.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .Synopsis Registers or unregisters the PowerShell ETW manifest .Parameter Path The fully qualified path to the PowerShell.Core.Instrumentation.man manifest file. The default value is the location of this script. .Paramet...
combined_dataset/train/non-malicious/Stop service and wait_1....ps1
Stop service and wait_1....ps1
<# This script stops the service, then waits for the service to stop before continuing with the reboot/shutdown The scritp can be pushed to a server/Pc using Group Policy or Registry or run manually. The shutdown script Registry key is: HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Group Policy\\State\\Ma...
combined_dataset/train/non-malicious/sample_8_71.ps1
sample_8_71.ps1
#************************************************ # DC_ChkSym_DPM.ps1 # Version 1.0.0 # Date: 12-07-2010 # Author: Patrick Lewis - patlewis@microsoft.com # Description: This script calls chksym to get file version information from DPM files and other files #************************************************ PARAM(...
combined_dataset/train/non-malicious/64d622dd-3de1-4904-8512-d2f40cde9914.ps1
64d622dd-3de1-4904-8512-d2f40cde9914.ps1
#This scripts compares the agents that are installed in two zones and #gives the agents that are not common. #Usage: #Compare-Agents.ps1 -server1 RMSServer1.contoso.com -server2 RMSServer2.contoso.com -output c:\\Temp.txt #RMSServer1 is the one whose agents are to be moved. param([string] $Server1,$Server2,$outp...
combined_dataset/train/non-malicious/Create random strings_1.ps1
Create random strings_1.ps1
# =============================================================== # / Author: Marcus L. Farmer # / Script: createRandomStrings.ps1 # / Date: 2-04-2009 # / Purpose: generate pseudorandomly generated strings for passwords or other uses # / Usage: ./createRandomStrings.ps1 # / Reqs.: none...
combined_dataset/train/non-malicious/sample_15_84.ps1
sample_15_84.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ param ( [Parameter(Mand...
combined_dataset/train/non-malicious/Set-Prompt.ps1
Set-Prompt.ps1
# This should go OUTSIDE the prompt function, it doesn't need re-evaluation\n# We're going to calculate a prefix for the window title \n# Our basic title is "PoSh - C:\\Your\\Path\\Here" showing the current path\nif(!$global:WindowTitlePrefix) {\n # But if you're running "elevated" on vista, we want to show that ...\...
combined_dataset/train/non-malicious/Get-XamlControlTemplate.ps1
Get-XamlControlTemplate.ps1
## Get-XamlControlTemplate\n## Dump a WPF control's default XAML template\n########################################################################################################################\n## Usage:\n## Get-XamlControlTemplate System.Windows.Navigation.NavigationWindow\n## Get-XamlControlTemplate MenuItem\n## G...
combined_dataset/train/non-malicious/sample_34_53.ps1
sample_34_53.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/666.ps1
666.ps1
$reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl } Function Set-FolderReportDataSource { param ( [string] $NewFolderPath ) $tempProxy = New-RsWebServiceProxy -ReportServerUri $reportServerUri $localResources...
combined_dataset/train/non-malicious/sample_18_65.ps1
sample_18_65.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=此名稱和類型的環境變數已存在。 EnvironmentErrorDoesNotExists=此名稱和類型的環境變數不存在。 '@ # SIG # Begin signature block # MIIoOwYJKoZIhvcNAQcCoIIoLDCCKCgCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIB...
combined_dataset/train/non-malicious/sample_51_9.ps1
sample_51_9.ps1
Add-Type -Assembly PresentationCore $noImage = "no image" $img = [Windows.Clipboard]::GetImage() if ($img -eq $null) { [Console]::WriteLine($noImage) Exit 1 } try { # 将图像转换格式以备编码 $fcb = New-Object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null...
combined_dataset/train/non-malicious/1153.ps1
1153.ps1
$username = 'CarbonInstallUser' $password = 'IM33tRequ!rem$' function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { Remove-TestUser } function Stop-Test { Remove-TestUser } function Remove-TestUser { Unins...
combined_dataset/train/non-malicious/sample_57_58.ps1
sample_57_58.ps1
<# .SYNOPSIS Data collection tool for printing-related troubleshooting by Marius Porcolean (maporcol). .DESCRIPTION The Print-Collect.ps1 script simplifies the collection of Printing related troubleshooting data, making action plans easier. The tool is compliant with company policies, is signed & pu...
combined_dataset/train/non-malicious/sample_12_59.ps1
sample_12_59.ps1
#Collect Event Logs for Slow Logon/ Slow Boot troubleshooter $EventLogNames = "Setup" Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription "Event Logs" # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorB...
combined_dataset/train/non-malicious/sample_16_52.ps1
sample_16_52.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_6_8.ps1
sample_6_8.ps1
# # Module manifest for module 'OCI.PSModules.Databasetools' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasetools.dll' # Version number of this module. ModuleVersion = '93.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_13_40.ps1
sample_13_40.ps1
# Load Common Library # Load Reporting Utilities #_#$debug = $false . ./utils_cts.ps1 #_#. ./TS_RemoteSetup.ps1 $FirstTimeExecution = FirstTimeExecution trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_....
combined_dataset/train/non-malicious/Show-ConsoleMenu.ps1
Show-ConsoleMenu.ps1
function Show-ConsoleMenu { #.Synopsis # Displays a menu in the console and returns the selection #.Description # Displays a numbered list in the console, accepts a typed number from the user, and returns it. #.Example # ls | Show-ConsoleMenu -Title "Please pick a file to delete:" -Passthru | rm -whatif # # ...
combined_dataset/train/non-malicious/622.ps1
622.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "http://sourceforge.net/projects/cpuminer/files/pooler-cpuminer-2.3.3-win64.zip" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" } $Configs | ForEach-Object{ try{ ...
combined_dataset/train/non-malicious/Local Software Inventory.ps1
Local Software Inventory.ps1
# Create a new Excel object using COM $Excel = New-Object -ComObject Excel.Application $Excel.Visible = $True $Excel.DisplayAlerts = $False # Counter variable for rows $intRow = 1 $Excel = $Excel.Workbooks.Add() $Sheet = $Excel.Worksheets.Item(1) #Create column headers $Sheet.Cells.Item($intRow,1) = "So...
combined_dataset/train/non-malicious/sample_31_86.ps1
sample_31_86.ps1
# # Script module for module 'Az.DnsResolver' that is executed when 'Az.DnsResolver' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 05/16/2024 06:33:07 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try { ...
combined_dataset/train/non-malicious/Thin provisioning with P.ps1
Thin provisioning with P.ps1
function ConvertVMDiskToThin($vm, $datastore) { $vmView = Get-View $vm $dsView = Get-View $datastore $relocateSpec = New-Object VMware.Vim.VirtualMachineRelocateSpec $relocateSpec.Datastore = $dsView.MoRef $relocateSpec.Transform = "sparse" $vmView.RelocateVM($relocateSpec, $null) }
combined_dataset/train/non-malicious/sample_48_31.ps1
sample_48_31.ps1
# # Module manifest for module 'OCI.PSModules.Containerengine' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Containerengine.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported P...
combined_dataset/train/non-malicious/Get-Dirty Extended.ps1
Get-Dirty Extended.ps1
## NAME: Get-Dirty.ps1 ## AUTHOR: Barry Morrison ## LASTEDIT: 07/05/2011 16:18:33 <# .Synopsis Get's files from today's date. Will also return narrowed results based on keyword .Description Get's files from today's date. Will also return narrowed results based on keyword .Parameter...
combined_dataset/train/non-malicious/8c6c6bed-3b96-4711-a7b1-2bce64494698.ps1
8c6c6bed-3b96-4711-a7b1-2bce64494698.ps1
Function Test-Server{ [cmdletBinding()] param( [parameter(Mandatory=$true,ValueFromPipeline=$true)] [string[]]$ComputerName, [parameter(Mandatory=$false)] [switch]$CredSSP, [Management.Automation.PSCredential] $Credential) begin{ $total = Get-Date $results = @() if($credssp){if(!($credential)){Wri...
combined_dataset/train/non-malicious/4348.ps1
4348.ps1
function Get-InstalledScriptDetails { [CmdletBinding()] param ( [Parameter()] [string] $Name, [Parameter()] [string] $RequiredVersion, [Parameter()] [string] $MinimumVersion, [Parameter()] [string] $MaximumVer...
combined_dataset/train/non-malicious/sample_57_0.ps1
sample_57_0.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 = '83.3.0' # Supported...
combined_dataset/train/non-malicious/4159.ps1
4159.ps1
Function UninstallApplication($Application,$GUID) { Set-Variable -Name Code -Scope Local -Force Set-Variable -Name Arguments -Scope Local -Force Write-Host $Application"...." -NoNewline $Arguments = "/x "+$GUID+" /qb- /norestart" $Code = (Start-Process -Fil...
combined_dataset/train/non-malicious/sample_61_67.ps1
sample_61_67.ps1
/*! For license information please see 7562.wv.js.LICENSE.txt */ "use strict";(self.webpackChunktheneo_vscode_extension=self.webpackChunktheneo_vscode_extension||[]).push([[7562],{7562:(e,n,s)=>{s.r(n),s.d(n,{conf:()=>t,language:()=>o});var t={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"...
combined_dataset/train/non-malicious/sample_51_62.ps1
sample_51_62.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.DnsResolver.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Module]::Instance # Export nothing to clear implicit ex...
combined_dataset/train/non-malicious/1078.ps1
1078.ps1
& (Join-Path -Path $PSScriptRoot 'Initialize-CarbonTest.ps1' -Resolve) Describe 'Write-File' { $file = '' BeforeEach { $Global:Error.Clear() $file = Join-Path -Path 'TestDrive:' -ChildPath ([IO.Path]::GetRandomFileName()) New-Item -Path $file -ItemType 'File' $...
combined_dataset/train/non-malicious/sample_37_39.ps1
sample_37_39.ps1
# # Module manifest for module 'OCI.PSModules.Onesubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported P...
combined_dataset/train/non-malicious/sample_35_40.ps1
sample_35_40.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_22_73.ps1
sample_22_73.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.apa...
combined_dataset/train/non-malicious/sample_34_95.ps1
sample_34_95.ps1
using namespace System.Management.Automation using namespace System.Management.Automation.Language # This is an example profile for PSReadLine. # # This is roughly what I use so there is some emphasis on emacs bindings, # but most of these bindings make sense in Windows mode as well. Import-Module PSReadLine ...
combined_dataset/train/non-malicious/sample_32_97.ps1
sample_32_97.ps1
# # PInvoke functions # function CreateWinEvent ( $name, $manualReset, $initialState ) { $signature = @' [DllImport("kernel32.dll")] public static extern IntPtr CreateEvent(IntPtr lpEventAttributes, bool bManualReset, bool bInitialState, string lpName); '@ $type = Add-Type -MemberDefinit...
combined_dataset/train/non-malicious/3253.ps1
3253.ps1
class Room { [string]$Id [string]$Name [string]$Topic [bool]$Exists [bool]$Joined [hashtable]$Members = @{} Room() {} [string]Join() { throw 'Must Override Method' } [string]Leave() { throw 'Must Override Method' } [string]Cr...
combined_dataset/train/non-malicious/CommandTranscript.ps1
CommandTranscript.ps1
if(!$global:CommandTranscriptPrompt) { ## Record the original prompt so we can put it back if they change their minds... $global:CommandTranscriptPrompt = ${Function:Prompt} } function Start-CommandTranscript { #.Synopsis # Start a transcript recording the commands you enter, and optionally, the success ...
combined_dataset/train/non-malicious/1002.ps1
1002.ps1
$myEndpoint = "<your-endpoint-URL>" $myResourceGroup="<resource-group-name>" New-AzResourceGroup -Name $myResourceGroup -Location westus2 New-AzEventGridSubscription ` -Endpoint $myEndpoint ` -EventSubscriptionName demoSubscriptionToResourceGroup ` -ResourceGroupName $myResourceGroup
combined_dataset/train/non-malicious/1898.ps1
1898.ps1
Describe "Unimplemented Utility Cmdlet Tests" -Tags "CI" { $Commands = @( "Unblock-File", "ConvertFrom-SddlString" ) foreach ($Command in $Commands) { It "$Command should only be available on Windows" { [bool](Get-Command $Command -ErrorAction SilentlyContinue) | Shou...
combined_dataset/train/non-malicious/sample_54_43.ps1
sample_54_43.ps1
# Localized 06/28/2023 08:09 AM (GMT) 303:7.0.30723 rs_adjustwirelessadaptersettings.psd1 ConvertFrom-StringData @' ###PSLOC reset_Wirelessadaptersettings=Rétablissement des paramètres de carte sans fil Report_name_Wirelessadaptersettings_AC_result=Résultat du rétablissement des paramètres de carte sans fil pour l...
combined_dataset/train/non-malicious/sample_22_59.ps1
sample_22_59.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.DevCenterdata.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.DevCenterdata.internal.psm1' if(Test-Path $internalModulePath)...
combined_dataset/train/non-malicious/sample_57_5.ps1
sample_57_5.ps1
.$psScriptRoot\Set-Dell1stBootdevice.ps1 .$psScriptRoot\Get-DellBiosSettings.ps1 .$psScriptRoot\Clear-DellAdminPassword.ps1 .$psScriptRoot\Set-DellAutoOnForSelectDays.ps1 # SIG # Begin signature block # MIIqwQYJKoZIhvcNAQcCoIIqsjCCKq4CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAA...
combined_dataset/train/non-malicious/sample_47_98.ps1
sample_47_98.ps1
// // Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rig...
combined_dataset/train/non-malicious/1231.ps1
1231.ps1
[CmdletBinding()] param( [Parameter(Mandatory)] [string] $Configuration ) $ErrorActionPreference = 'Stop' Set-StrictMode -Version 'Latest' Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\PSModules\VSSetup' -Resolve) $instances = Get-VSSetupInstance $instances | Format-Li...
combined_dataset/train/non-malicious/sample_9_62.ps1
sample_9_62.ps1
#************************************************ # TS_KernelAuthRPCCheck.ps1 # Version 1.0 # Date: 5-1-2012 # Author: davidcop # Description: Checks for kernel-mode authentication mismatch between server, web site, and /rpc virtual directory #************************************************ $varx = Get-Cim...
combined_dataset/train/non-malicious/sample_56_14.ps1
sample_56_14.ps1
# # Module manifest for module 'OCI.PSModules.Osubusage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osubusage.dll' # Version number of this module. ModuleVersion = '85.2.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/Transcript sessions.ps1
Transcript sessions.ps1
# Create the transcript file and start the transcript new-item -path ([Environment]::GetFolderPath('MyDocuments')) -name "PowerShell_Transcripts" -type directory -ea "silentlycontinue" $transcriptFolder = [Environment]::GetFolderPath('MyDocuments') + "\\PowerShell_Transcripts\\" $filedate = get-date -format yyyyMMdd...
combined_dataset/train/non-malicious/sample_51_19.ps1
sample_51_19.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/4371.ps1
4371.ps1
function Test-ModuleSxSVersionSupport { $PSVersionTable.PSVersion -ge '5.0.0' }
combined_dataset/train/non-malicious/400.ps1
400.ps1
$scriptBlock = { try { $script:___ScriptName = 'PSFramework.Logging' Import-Module (Join-Path ([PSFramework.PSFCore.PSFCoreHost]::ModuleRoot) 'PSFramework.psd1') while ($true) { if ([PSFramework.Runspace.RunspaceHost]::Runspaces[$___ScriptName.ToLower()].State -notlike "Running") { break ...
combined_dataset/train/non-malicious/sample_35_51.ps1
sample_35_51.ps1
# # Module manifest for module 'OCI.PSModules.Apmcontrolplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmcontrolplane.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported P...
combined_dataset/train/non-malicious/sample_31_43.ps1
sample_31_43.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Stop-AMTUserConsent { <# .Synopsis Stops the Intel Active Management Technology user consent process .Description This CmdLet stops the user consent process on clients that have Intel Active Management Technology (AMT) fir...
combined_dataset/train/non-malicious/sample_63_82.ps1
sample_63_82.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/Update web.config.ps1
Update web.config.ps1
Function Update-WCContents($File,$SearchString,$NewValue){ $Contents = Get-Content -Path $File $Contents | %{$_.Replace($SearchString,$NewValue)} | Set-Content $File } # End Update-WCContents Function
combined_dataset/train/non-malicious/sample_23_9.ps1
sample_23_9.ps1
using module ..\..\Config.psm1 param( [switch]$TestStatus ) Import-Module (Join-Path $PSScriptRoot "..\..\Events.psm1") Set-Variable -Option Constant -Name SkypeSettingsPath -Value "Registry::HKLM\SOFTWARE\Microsoft\PPI\SkypeSettings" Set-Variable -Option Constant -Name IsInstalled -Value "IsT21Installe...
combined_dataset/train/non-malicious/sample_67_65.ps1
sample_67_65.ps1
<# This example demonstrates working with various resources in Database Service. This example requires: 1) Modules OCI.PSModules.Database,OCI.PSModules.Identity,OCI.PSModules.Core. Install the modules from Powershell Gallery. 2) Setting up the environment variable CompartmentId to a Compartment OCID. #> $UserErrorActi...
combined_dataset/train/non-malicious/sample_10_67.ps1
sample_10_67.ps1
<# .SYNOPSIS MSRD-Collect graphical user interface (Lite version) .DESCRIPTION Module for the MSRD-Collect graphical user interface (Lite version) .NOTES Author : Robert Klemencz Requires : MSRD-Collect.ps1 Version : See MSRD-Collect.ps1 version Feedback : https://aka.ms/MSRD-C...
combined_dataset/train/non-malicious/1388.ps1
1388.ps1
function Initialize-CLcm { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true,ParameterSetName='Push')] [Switch] $Push, [Parameter(Mandatory=$true,ParameterSetName='PullWebDownloadManager')] [string] ...
combined_dataset/train/non-malicious/sample_55_56.ps1
sample_55_56.ps1
# # Module manifest for module 'OCI.PSModules.Datalabelingservicedataplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datalabelingservicedataplane.dll' # Version number of this module. ModuleVersion...
combined_dataset/train/non-malicious/614.ps1
614.ps1
param( [string]$Version, [string]$Path, [switch]$Force, [switch]$Update, [switch]$Uninstall ) $Configs = @{ Url = "https://chocolatey.org/install.ps1" ConditionExclusion = "Get-Command `"cinst`" -ErrorAction SilentlyContinue" } $Configs | ForEach-Object{ try{ $_.Result = $null if(-not...
combined_dataset/train/non-malicious/ConvertFrom-Property_3.ps1
ConvertFrom-Property_3.ps1
function ConvertFrom-PropertyString { <# .SYNOPSIS Converts data from flat or single-level property files into PSObjects .DESCRIPTION Converts delimited string data such as .ini files, or the format-list output of PowerShell, into objects .EXAMPLE netsh http show sslcert | join-string "`n" | Conver...
combined_dataset/train/non-malicious/Findup.ps1
Findup.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 ConsoleApplication1 { public class FileInfoExt { pu...
combined_dataset/train/non-malicious/sample_50_85.ps1
sample_50_85.ps1
# # Module manifest for module 'OCI.PSModules.Osubsubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osubsubscription.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported...
combined_dataset/train/non-malicious/487.ps1
487.ps1
function Get-Path { param( [Parameter(Mandatory=$true)] [string] $Path ) $Path = [System.Environment]::ExpandEnvironmentVariables($Path) if($Path.contains("$")){ $Path = Invoke-Expression "`"$Path`"" } if($Path.StartsWith("\")){$Path =...
combined_dataset/train/non-malicious/sample_21_80.ps1
sample_21_80.ps1
Import-Module (Join-Path $PSScriptRoot "Events.psm1") Set-Variable -Option Constant -Name OemScriptPath -Value "$Env:SystemDrive\Rigel\AdminHookScripts\OEMOOBE.ps1" Set-Variable -Option Constant -Name OemOobeHasRunPath -Value "$Env:SystemDrive\Users\Skype\OEMOOBE-ran.txt" function OemScriptExists { ...
combined_dataset/train/non-malicious/New-XVM_13.ps1
New-XVM_13.ps1
#EXAMPLES <# New-XVM -ComputerName HYPERVSVR02 -Name "WS2012-TESTSVR01" -SwitchName "External(192.168.1.0/24)" -VhdType NoVHD New-XVM -ComputerName HYPERVSVR02 -Name "WS2012-TESTSVR02" -SwitchName "External(192.168.1.0/24)" -VhdType ExistingVHD -VhdPath D:\\vhds\\WS2012-TESTSVR02.vhdx New-XVM -ComputerName HYPERVSV...
combined_dataset/train/non-malicious/sample_30_17.ps1
sample_30_17.ps1
param([string]$user, [string]$packageName) Get-AppxPackage -User $user -Name $packageName # SIG # Begin signature block # MIIn2gYJKoZIhvcNAQcCoIInyzCCJ8cCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDr0bXuusM...
combined_dataset/train/non-malicious/Set account password_1.ps1
Set account password_1.ps1
Function Set-Password { #requires -version 2.0 <# .Synopsis Allows the changing of the local account password on a local or remote machine. .Description Allows the changing of the local account password on a local or remote machine. .Parameter computer Computer that the password will be changed on...
combined_dataset/train/non-malicious/sample_46_77.ps1
sample_46_77.ps1
None
combined_dataset/train/non-malicious/sample_7_24.ps1
sample_7_24.ps1
# # Module manifest for module 'OCI.PSModules.Delegateaccesscontrol' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Delegateaccesscontrol.dll' # Version number of this module. ModuleVersion = '92.1.0' #...
combined_dataset/train/non-malicious/My $Profile.ps1
My $Profile.ps1
<# Set some Variables and start transcript. $MaximumHistoryCount is used to set the number of commands that are stored in History. Defaults to 64. Maximum 32767. $Transcript is used to set the path for Start-Transcript. I am logging everthing to my SkyDrive folder, using a file name like: username...
combined_dataset/train/non-malicious/3099.ps1
3099.ps1
[CmdletBinding()] param ( ) end { $modulePath = Join-Path -Path $env:ProgramFiles -ChildPath WindowsPowerShell\Modules $targetDirectory = Join-Path -Path $modulePath -ChildPath Pester $scriptRoot = Split-Path -Path $MyInvocation.MyCommand.Path -Parent $sourceDirectory = Join-Path -Path $scriptRoot -Chi...
combined_dataset/train/non-malicious/1034.ps1
1034.ps1
Set-StrictMode -Version Latest & (Join-Path $PSScriptRoot Carbon\Import-Carbon.ps1 -Resolve) $websitePath = Join-Path $PSScriptRoot Website -Resolve Install-IisWebsite -Name 'get-carbon.org' -Path $websitePath -Bindings 'http/*:80:' Grant-Permission -Identity Everyone -Permission ReadAndExecute -Path $...