full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/1538.ps1
1538.ps1
function New-MrFunction { [CmdletBinding()] [OutputType('System.IO.FileInfo')] param ( [ValidateScript({ If ((Get-Verb -Verb ($_ -replace '-.*$')).Verb) { $true } else { Throw "'$_' does NOT use an approved Verb." } })] ...
combined_dataset/train/non-malicious/sample_12_21.ps1
sample_12_21.ps1
#************************************************ # TS_ServicingPendingXml.ps1 # Version 1.0.1 # Date: 6/6/2012 # Author: v-alyao # Description: [Idea ID 3472] [Windows] Pending Transactions Rule Idea - Pending.xml # Rule number: 3472 # Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.a...
combined_dataset/train/non-malicious/The PowerShell Talk 2.ps1
The PowerShell Talk 2.ps1
#The PowerShell Talk #Demo 2 - VM Easy Bake Oven #VMware #Connect to vCenter Get-Credential | connect-viserver -Server "Your vCenter Here" #Create the new VM get-vmhost -Name "ESX Server" | New-VM -Name Dave -DiskMB "10240" -GuestId "otherGuest" -MemoryMB 512 -NumCpu 1 -resourcepool "Demo" #Get some info ...
combined_dataset/train/non-malicious/sample_21_93.ps1
sample_21_93.ps1
name: Setup Windows description: Set up for windows jobs inputs: cuda-version: description: which cuda version to install, 'cpu' for none required: true runs: using: composite steps: - name: Display EC2 information shell: bash run: | set -euo pipefail function get_ec2_me...
combined_dataset/train/non-malicious/sample_37_40.ps1
sample_37_40.ps1
# # Module manifest for module 'OCI.PSModules.Rover' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Rover.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/1759.ps1
1759.ps1
python -c "print('Hi!')" $data = python -c "print('Hi!')" $data 5 + (python -c "print(2 + 3)") + 7 @" print('Hi!') "@ | out-file -encoding ascii hi chmod +x hi ./hi cat class1.py ./class1.py $data = ./class1.py | ConvertFrom-JSON $data[0] $data[1] $data[1].buz[1] cat class1.ps1 (./cl...
combined_dataset/train/non-malicious/sample_66_99.ps1
sample_66_99.ps1
Function Get-UninstallString { param ( $DisplayName, $Path ) if ($Path -eq "Wow32") { $Path = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall' Get-ChildItem $Path | Where-Object{ $_.GetValue('DisplayName') -match $DisplayName } | ForEach-Object{ ...
combined_dataset/train/non-malicious/ac3d3fd4-f5da-4eeb-8a26-50cf89f15d26.ps1
ac3d3fd4-f5da-4eeb-8a26-50cf89f15d26.ps1
<# .SYNOPSIS Pulls down the leaderboards for the 2011 Scripting Games .DESCRIPTION Quick and dirty script to pull down the leaderboards for the 2011 scripting games. Can choose either beginner or advanced via a command line switch. .PARAMETER Level The leaderboard to parse .EXAMPLE Get...
combined_dataset/train/non-malicious/sample_15_75.ps1
sample_15_75.ps1
#************************************************ # DC_WebClient-Component.ps1 # Version 1.0 # Date: 2009-2014 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about WebClient/WebDAV. # Called from: Networking Diagnostics #******************************************************* ...
combined_dataset/train/non-malicious/3077.ps1
3077.ps1
$global:ValidatorRoot = Split-Path $MyInvocation.MyCommand.Path BeforeEachFeature { if ($GherkinOrderTests) { Add-Content -Path $global:GherkinOrderTests -Value "BeforeEachFeature" } New-Module -Name ValidatorTest { . $global:ValidatorRoot\Validator.ps1 -Verbose } | Import-Module -Globa...
combined_dataset/train/non-malicious/2688.ps1
2688.ps1
param($ProjectDir, $ConfigurationName, $TargetDir, $TargetFileName, $SolutionDir) if($ConfigurationName -like "Debug*") { $documentsFolder = [environment]::getfolderpath("mydocuments"); if($TargetDir -like "*Core*") { $DestinationFolder = "$documentsFolder\PowerShell\Modules\SharePointPnPPowerShellCore" } else {...
combined_dataset/train/non-malicious/2047.ps1
2047.ps1
Describe "Resolve types in additional referenced assemblies" -Tag CI { It "Will resolve DirectoryServices type <name>" -TestCases @( @{ typename = "[System.DirectoryServices.AccountManagement.AdvancedFilters]"; name = "AdvancedFilters" } ){ param ($typename, $name) pwsh -noprofile -co...
combined_dataset/train/non-malicious/2556.ps1
2556.ps1
param ( [string]$tfsServer = "TFSServerName", [string]$tfsLocation = "$/TFS/Project", [string]$localFolder ="c:\scripts", [string]$file, [string]$checkInComments = "Checked in from PowerShell" ) $clientDll = "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft....
combined_dataset/train/non-malicious/Find Local Group Members_1.ps1
Find Local Group Members_1.ps1
# Author: Hal Rottenberg # Purpose: Find matching members in a local group # Used tip from RichS here: http://powershellcommunity.org/Forums/tabid/54/view/topic/postid/1528/Default.aspx # Change these two to suit your needs $ChildGroups = "Domain Admins", "Group Two" $LocalGroup = "Administrators" $MemberName...
combined_dataset/train/non-malicious/sample_41_53.ps1
sample_41_53.ps1
@{ GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Get-WinEvent", "New-WinEvent", "Get-C...
combined_dataset/train/non-malicious/3628.ps1
3628.ps1
function Test-CreateServerDNSAlias { $location = "East US 2 EUAP" $rg = Create-ResourceGroupForTest $location $server = Create-ServerForTest $rg $location $serverDnsAliasName = Get-ServerDnsAliasName try { $job = New-AzSqlServerDnsAlias -ResourceGroupName $rg.ResourceGroupName -ServerName ...
combined_dataset/train/non-malicious/sample_60_17.ps1
sample_60_17.ps1
# # Module manifest for module 'OCI.PSModules.Loggingsearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loggingsearch.dll' # Version number of this module. ModuleVersion = '89.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/1791.ps1
1791.ps1
Describe "Set-Location" -Tags "CI" { BeforeAll { $startDirectory = Get-Location if ($IsWindows) { $target = "C:\" } else { $target = "/" } } AfterAll { Set-Location $startDirectory } It "Should be able to b...
combined_dataset/train/non-malicious/Findup_30.ps1
Findup_30.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; using System.Text.RegularExpressions; namespace Findup { public class FileLengthComparer : I...
combined_dataset/train/non-malicious/1606.ps1
1606.ps1
function Get-FolderSize { [cmdletbinding()] param ( $Path = $PWD, [validateset('GCI', 'Robocopy', 'FSO', 'All')] $Use = 'Robocopy' ) begin { function Resolve-FullPath ($Path = $PWD) { if ( -not ([IO.Path]::IsPathRooted($Path)) ) { ...
combined_dataset/train/non-malicious/sample_65_58.ps1
sample_65_58.ps1
# Localized 05/01/2024 11:12 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=はい(&Y) PromptNoString=いいえ(&N) BundleFound=見つかったバンドル: {0} PackageFound=パッケージが見つかりました: {0} EncryptedBundleFound=暗号化されたバンドルが見つかりました: {0} EncryptedPackageFound=暗号化されたパッ...
combined_dataset/train/non-malicious/sample_59_7.ps1
sample_59_7.ps1
# # Module manifest for module 'OCI.PSModules.Osubbillingschedule' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osubbillingschedule.dll' # Version number of this module. ModuleVersion = '85.1.0' # Sup...
combined_dataset/train/non-malicious/sample_1_41.ps1
sample_1_41.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/1872.ps1
1872.ps1
Describe "Get-Host DRT Unit Tests" -Tags "CI" { It "Should works proper with get-host" { $results = Get-Host $results | Should -Be $Host $results.PSObject.TypeNames[0] | Should -BeExactly "System.Management.Automation.Internal.Host.InternalHost" } }
combined_dataset/train/non-malicious/1234.ps1
1234.ps1
param( [Parameter(Mandatory=$true)] [string] $OutputPath ) Set-StrictMode -Version 'Latest' $OutputPath = Join-Path -Path $OutputPath -ChildPath '*' Get-ChildItem -Path $OutputPath -Include 'pester*.xml','*blade*.xml' | Get-Content -Raw | ForEach-Object { [xml]$_ } | ForEach...
combined_dataset/train/non-malicious/Format-Column.ps1
Format-Column.ps1
function global:Format-Column { ################################################################ #.Synopsis # Formats incoming data to columns. #.Description # It works similarly as Format-Wide but it works vertically. Format-Wide outputs # the data row by row, but Format-Columns outputs them column by column....
combined_dataset/train/non-malicious/884.ps1
884.ps1
$rgname = "CustomRulesTest" $location = "East US" $appgwName = "WAFCustomRules" $resourceGroup = New-AzResourceGroup -Name $rgname -Location $location $sub1 = New-AzVirtualNetworkSubnetConfig -Name "appgwSubnet" -AddressPrefix "10.0.0.0/24" $sub2 = New-AzVirtualNetworkSubnetConfig -Name "backendSubnet" -AddressPre...
combined_dataset/train/non-malicious/Get-HostsFile_2.ps1
Get-HostsFile_2.ps1
Function Get-HostsFile { <# .SYNOPSIS Retrieves the contents of a hosts file on a specified system. .DESCRIPTION Retrieves the contents of a hosts file on a specified system. .PARAMETER ComputerName The computers to access. .NOTES Name: Get-HostsFile Author: Boe Prox DateCreated: 15Ma...
combined_dataset/train/non-malicious/Set-Opacity.ps1
Set-Opacity.ps1
#.Synopsis\n # Mess with the transparency and blur of the PowerShell window\n #.Parameter color\n # The color to treat as transparent (you can set this to your foreground or background for best effect, but you must pass an actual [Drawing.Color]\n #.Parameter opacity\n # On a scale of 0 to 255, how opaque ...
combined_dataset/train/non-malicious/sample_7_76.ps1
sample_7_76.ps1
ConvertFrom-StringData @' id_printsettmpsystem32check_st=One or more TMP file found under system32 folder and this may cause problems to install printer drivers '@ # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8...
combined_dataset/train/non-malicious/Get-WebFile _2.7.3.ps1
Get-WebFile _2.7.3.ps1
function Get-WebFile { <# .SYNOPSIS Downloads a file or page from the web. .DESCRIPTION Downloads a file or page from the web (aka wget for PowerShell). .PARAMETER URL The URL to download. .PARAMETER FileName Download file path. If ommitted, the name is autmaitcally determined and down...
combined_dataset/train/non-malicious/sample_34_34.ps1
sample_34_34.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\practice\demo\quick-reference\node_modules\.pnpm\node_modules" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux ...
combined_dataset/train/non-malicious/3215.ps1
3215.ps1
using module 'PoshBot' class MockLogger : Logger { MockLogger() { } hidden [void]CreateLogFile() { Write-Debug -Message "[Logger:Logger] Creating log file [$($this.LogFile)]" } [void]Log([LogMessage]$Message) { Write-Debug -Message $Message.ToJson() } [void]Log([LogMessa...
combined_dataset/train/non-malicious/sample_62_19.ps1
sample_62_19.ps1
# # Module manifest for module 'OCI.PSModules.Dts' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dts.dll' # Version number of this module. ModuleVersion = '89.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_16_27.ps1
sample_16_27.ps1
export function setControlAttribute(id, attrName, value) { const fieldElement = document.querySelector("#" + id)?.shadowRoot?.querySelector(".selected-value"); if (!!fieldElement) { fieldElement?.setAttribute(attrName, value); } } // SIG // Begin signature block // SIG // MIIoNwYJKoZIhvcN...
combined_dataset/train/non-malicious/Search-WmiNamespace.ps1
Search-WmiNamespace.ps1
##############################################################################\n##\n## Search-WmiNamespace\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nSear...
combined_dataset/train/non-malicious/sample_37_52.ps1
sample_37_52.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> function Register-EditorCommand { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$Name, ...
combined_dataset/train/non-malicious/4480.ps1
4480.ps1
configuration PSModule_InstallModuleTrustedConfig { param ( [Parameter()] [System.String[]] $NodeName = 'localhost', [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [System.String] $ModuleName ) Import-DscResource -ModuleName 'Powe...
combined_dataset/train/non-malicious/254.ps1
254.ps1
function Remove-StringDiacritic { [CMdletBinding()] PARAM ( [ValidateNotNullOrEmpty()] [Alias('Text')] [System.String[]]$String, [System.Text.NormalizationForm]$NormalizationForm = "FormD" ) FOREACH ($StringValue in $String) { Write-Verbose -Message "$StringValue" try { $Normalized = $Strin...
combined_dataset/train/non-malicious/3075.ps1
3075.ps1
function MyValidator($thing_to_validate) { return $thing_to_validate.StartsWith("s") } function Invoke-SomethingThatUsesMyValidator { param( [ValidateScript( {MyValidator $_})] $some_param ) }
combined_dataset/train/non-malicious/sample_25_63.ps1
sample_25_63.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 Remove-ServiceFabric...
combined_dataset/train/non-malicious/Select-ViaGUI.ps1
Select-ViaGUI.ps1
## Select-ViaGui.ps1 ## Use a graphical interface to select (and pass-through) pipeline objects ## originally by Lee Holmes (http://www.leeholmes.com/blog), although he might not recognize it now ;-) Import-Module ShowUI ## Get the item as it would be displayed by Format-Table ## Generate the window Show-UI -Ti...
combined_dataset/train/non-malicious/sample_24_81.ps1
sample_24_81.ps1
# # Module manifest for module 'OCI.PSModules.Managementdashboard' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Managementdashboard.dll' # Version number of this module. ModuleVersion = '80.0.0' # Sup...
combined_dataset/train/non-malicious/318.ps1
318.ps1
function Get-PSFMessage { [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFMessage')] param ( [string] $FunctionName = "*", [string] $ModuleName = "*", [AllowNull()] $Target, [string[]] $Tag, [int] $Last, [int] $Skip = 0, [guid] ...
combined_dataset/train/non-malicious/1809.ps1
1809.ps1
Describe "Resolve-Path returns proper path" -Tag "CI" { BeforeAll { $driveName = "RvpaTest" $root = Join-Path $TestDrive "fakeroot" $file = Join-Path $root "file.txt" $null = New-Item -Path $root -ItemType Directory -Force $null = New-Item -Path $file -ItemType File -Force ...
combined_dataset/train/non-malicious/585.ps1
585.ps1
function Connect-VM{ param ( [parameter(Mandatory=$true)] [string[]]$Name ) if((Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue) -eq $Null){Add-PSSnapin VMware.VimAutomation.Core} if((Get-PSSnapin VMware.VimAutomation.Vds -ErrorAction SilentlyConti...
combined_dataset/train/non-malicious/3375.ps1
3375.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$False, Position=0)] [String]$Folder, [Parameter(Mandatory=$False)] [bool]$Major, [Parameter(Mandatory=$False)] [bool]$Minor, [Parameter(Mandatory=$False)] [bool]$Patch ) function IncrementVersion([string]$FilePath) { $psd1Path = Join-Path $FilePath "\Services\Comman...
combined_dataset/train/non-malicious/New-StoredProcFunction_2.ps1
New-StoredProcFunction_2.ps1
# New-StoredProcFunction.ps1 # Steven Murawski # http://blog.usepowershell.com # 04/08/2009 # Example: ./New-StoredProcFunction.ps1 'Data Source=MySqlServer;Database=Northwind;User=AnythingButSa;Password=abc123' sp_createnewcustomer # Example 'sp_createnewcustomer | ./New-StoredProcFunction.ps1 'Data Source=MySq...
combined_dataset/train/non-malicious/sample_30_99.ps1
sample_30_99.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 = '77.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/4183.ps1
4183.ps1
Set-Variable -Name CurrentTime -Scope Local -Force Set-Variable -Name Difference -Scope Local -Force Set-Variable -Name Output1 -Scope Local -Force Set-Variable -Name Output2 -Scope Local -Force Set-Variable -Name Output3 -Scope Local -Force Set-Variable -Name Process -Value $null -Scope Local -Force Set-Variable -...
combined_dataset/train/non-malicious/sample_26_42.ps1
sample_26_42.ps1
# # Module manifest for module 'OCI.PSModules.Devops' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Devops.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/4.ps1
4.ps1
$ModuleBasePath = Split-Path $MyInvocation.MyCommand.Path -Parent $invokeErrors = New-Object System.Collections.ArrayList 256 function Invoke-NullCoalescing { $result = $null foreach ($arg in $args) { if ($arg -is [ScriptBlock]) { $result = & $arg } else { ...
combined_dataset/train/non-malicious/47.ps1
47.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/1669.ps1
1669.ps1
function Get-Lines ([string]$file) { begin { $file = (Resolve-Path $file).ToString() if (!(Test-Path $file)) { Throw "File not found: $file" } try { $stream = [System.IO.File]::OpenText($file) } catch { Throw $_ ...
combined_dataset/train/non-malicious/Reflection Module_1.ps1
Reflection Module_1.ps1
#requires -version 2.0 # ALSO REQUIRES Autoload for some functionality # You should create a Reflection.psd1 with the contents: @{ RequiredModules = @("Autoload"); GUID="64b5f609-970f-4e65-b02f-93ccf3e60cbb"; ModuleVersion="3.5.0.0" } #History: # 1.0 - First public release (March 19, 2010) # 2.0 - Private Build ...
combined_dataset/train/non-malicious/sample_51_46.ps1
sample_51_46.ps1
# # Module manifest for module 'OCI.PSModules.Analytics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Analytics.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_30_36.ps1
sample_30_36.ps1
--- - name: Get Storage information. ansible.builtin.uri: url: "https://{{ hostname }}:{{ https_port }}{{ api_system }}/Storage" register: virtual_disk_result delegate_to: "{{ idrac_gather_facts_delegate }}" - name: Get all storage controller ids. ansible.builtin.set_fact: storage_ids_list: "{{ virtual...
combined_dataset/train/non-malicious/sample_18_38.ps1
sample_18_38.ps1
@{ GUID="{52832d3a-17d8-48ff-a5bc-f5078492ecbe}" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="© Microsoft Corporation. All rights reserved." ModuleVersion="2.0.0.0" PowerShellVersion="3.0" CLRVersion="4.0" HelpInfoUri="https://aka.ms/winsvr-2025-p...
combined_dataset/train/non-malicious/out-form with sort colum_1.ps1
out-form with sort colum_1.ps1
I think OUT-FORM is a very usefull function. I've added code to sort columns by clicking on headers. You nedd just add the columnTag parameters specifing if colunm value is text or numeric: out-form -data (get-process) -columnNames ("Name", "ID" ) -columnProperties ("Name", "ID") -columnTag ("Text", "Numeric") ...
combined_dataset/train/non-malicious/Set-WLWAutoLink.ps1
Set-WLWAutoLink.ps1
#requires -version 2 function Set-WLWAutoLink{ param( [Parameter( Position=0,Mandatory=$true,ValueFromPipelineByPropertyName=$true )] [String]$Name, [Parameter( Position=1,Mandatory=$true,ValueFromPipelineByPropertyName=$true )] ...
combined_dataset/train/non-malicious/sample_28_60.ps1
sample_28_60.ps1
function PSConsoleHostReadLine { Microsoft.PowerShell.Core\Set-StrictMode -Off [Microsoft.PowerShell.PSConsoleReadLine]::ReadLine($host.Runspace, $ExecutionContext) } # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE...
combined_dataset/train/non-malicious/sample_25_98.ps1
sample_25_98.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/2495.ps1
2495.ps1
param( $SQLServer = 'STGSQLDOC710', $ScriptDir = '\\messano338\e$\dexma\logs\', $FilePrefix = 'Log', [switch]$Log ) $IndicesUnused = Get-ChildItem -Path $ScriptDir -Filter *IndexesUnused*.xlsx | sort-object -desc $IndicesMissing = Get-ChildItem -Path $ScriptDir -Filter *IndexesMissing*.xlsx | sort-object -des...
combined_dataset/train/non-malicious/488.ps1
488.ps1
function Unzip-File{ [CmdletBinding()] param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [ValidateScript({ If((Test-Path -Path $_ -PathType Leaf) -and ($_ -like "*.zip")){ $true }else{ Throw "$_ is not a valid...
combined_dataset/train/non-malicious/sample_56_80.ps1
sample_56_80.ps1
# # Module manifest for module 'OCI.PSModules.Generativeaiinference' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Generativeaiinference.dll' # Version number of this module. ModuleVersion = '84.0.0' #...
combined_dataset/train/non-malicious/sample_58_90.ps1
sample_58_90.ps1
mΔεν είναι δυνατή η εκτέλεση της μεθόδου όταν είναι απενεργοποιημένος ο χώρος αποθήκευσης πολλών στιγμιοτύπων.†Η αίτηση επιταχύνθηκε, πάρα πολλές αιτήσεις για ενημέρωση προέλευσης δεδομένων που ξεκίνησε από το χρήστη σε σύντομο χρονικό διάστημα.sΑνεπαρκές δικαίωμα για ανανέωση του πίνακα Direct Lake, επικοινωνήστε με τ...
combined_dataset/train/non-malicious/sample_38_53.ps1
sample_38_53.ps1
Коллекция пар ключ и значение, предоставляющее быстрое получение значения по ключу, доступная только для чтения. Не содержит дубликатов ключей. Каждому ключу соответствует только одно значение. -------------------- **Видимость:** @Глобально **Литералы:** Синтаксис (краткий): `{ ключ_0 : значение_0, ..., ключ_n :...
combined_dataset/train/non-malicious/Get-ActivesyncUsers.ps1
Get-ActivesyncUsers.ps1
#Get all mailboxes that have an active sync partnership: $Mailboxes = Get-CASMailbox -Filter{HasActiveSyncDevicePartnership -eq $true}| select name, servername, DistinguisheDName, ActiveSyncMailboxPolicy $NumberWiped = 0 $NumberSent =0 $TotalCount = 0 Foreach ($mailbox in $Mailboxes) { $Name = $mailbox.Name $...
combined_dataset/train/non-malicious/sample_37_91.ps1
sample_37_91.ps1
# region Generated # ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obt...
combined_dataset/train/non-malicious/3069.ps1
3069.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "Should -Contain" { It "passes if collection contains the value" { @(1, 'a', 3) | Should -Contain 'a' } It "fails collection does not contain the value" { { @(1, 'a', 3) | Should -Contain 'g' } | Verify...
combined_dataset/train/non-malicious/sample_62_65.ps1
sample_62_65.ps1
# # Module manifest for module 'OCI.PSModules.Loadbalancer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loadbalancer.dll' # Version number of this module. ModuleVersion = '90.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/Get-UnityLicense.ps1
Get-UnityLicense.ps1
# # get-unitylicense.ps1 # # Returns license information for a Cisco Unity environment # Usage: get-unitylicense <server> # # Author: Robbie Foust (rfoust@duke.edu) # function global:get-unitylicense ([string]$server = $(throw "Please provide a server name!")) { $webContent = new-object net.webclient ...
combined_dataset/train/non-malicious/sample_23_34.ps1
sample_23_34.ps1
# # Module manifest for module 'OCI.PSModules.Sch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Sch.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/Backup-ModifiedGPOs.ps1
Backup-ModifiedGPOs.ps1
###########################################################################" # # NAME: Backup-ModifiedGPOs.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # # COMMENT: All Group Policy Objects modified in the specified timespan are backup up to the specified backup path. # For more d...
combined_dataset/train/non-malicious/Get-Hostname_4.ps1
Get-Hostname_4.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/sample_32_6.ps1
sample_32_6.ps1
ConvertFrom-StringData @' FailoverClustersModuleRequired=Det gick inte att hitta den nödvändiga PowerShell-modulen (FailoverClusters). Använd verktyget Roller & funktioner för att installera: Verktyg för fjärrserveradministration | Funktionsadministrationsverktyg | Redundansklusterverktyg | Redundansklustermodulen för...
combined_dataset/train/non-malicious/sample_45_4.ps1
sample_45_4.ps1
# # Module manifest for module 'OCI.PSModules.Secrets' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Secrets.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/1799.ps1
1799.ps1
Describe "Clear-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { BeforeAll { $defaultParamValues = $PSdefaultParameterValues.Clone() $PSDefaultParameterValues["it:skip"] = !$IsWindows -or $IsCoreCLR } AfterAll { $global:PSDefaultParameterValues = $defaultParamValue...
combined_dataset/train/non-malicious/Invoke-Generic_3.ps1
Invoke-Generic_3.ps1
function Invoke-Generic { #.Synopsis # Invoke Generic method definitions via reflection: [CmdletBinding()] param( [Parameter(Position=0,Mandatory=$true,ValueFromPipelineByPropertyName=$true)] [Alias('On')] $InputObject , [Parameter(Position=1,ValueFromPipelineByPropertyName=$true)] [Alias('Na...
combined_dataset/train/non-malicious/sample_6_4.ps1
sample_6_4.ps1
##---------------------------------------------------------------------------- ## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved. ##---------------------------------------------------------------------------- # Import string constants . ./StringConstants.ps1 # Import shared functions and var...
combined_dataset/train/non-malicious/4067.ps1
4067.ps1
[CmdletBinding()] param () function Get-MSIInformation { [CmdletBinding()] param ( [ValidateNotNullOrEmpty()] [System.IO.FileInfo]$MSI, [ValidateSet('ProductCode', 'ProductVersion', 'ProductName', 'Manufacturer', 'ProductLanguage', 'FullVersion')] [string]$Property ) $WindowsInstaller = New-Objec...
combined_dataset/train/non-malicious/sample_17_16.ps1
sample_17_16.ps1
ConvertFrom-StringData @' id_dirs=Collecting Directory Output '@ # SIG # Begin signature block # MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDRy8kiReDoGdLC # nmSgV1SViLYbd...
combined_dataset/train/non-malicious/sample_2_96.ps1
sample_2_96.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_60_25.ps1
sample_60_25.ps1
# # Module manifest for module 'Az.Functions' # # Generated by: Microsoft Corporation # # Generated on: 7/4/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.Functions.psm1' # Version number of this module. ModuleVersion = '4.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_15_53.ps1
sample_15_53.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 = '74.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/Monitor-FileSize.ps1
Monitor-FileSize.ps1
function Monitor-FileSize { <# .Synopsis Checks the file size of a given file until it reaches the specified size .Description Checks the file size of a given file until it reaches the specified size. AT that point, it alerts the user as to what the original file-size-boundry was and what it currentl...
combined_dataset/train/non-malicious/sample_48_42.ps1
sample_48_42.ps1
# # Module manifest for module 'OCI.PSModules.Certificatesmanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Certificatesmanagement.dll' # Version number of this module. ModuleVersion = '77.0.0' ...
combined_dataset/train/non-malicious/4332.ps1
4332.ps1
function ValidateAndGet-NuspecVersionString { param( [Parameter(Mandatory=$true)] [string] $Version ) $versionPattern = '^((?<MinRule>[\[\(])?((?<MinVersion>[^:\(\[\)\]\,]+))?((?<Comma>[\,])?(?<MaxVersion>[^:\(\[\)\]\,]+)?)?(?<MaxRule>[\]\)])?)$' $VersionInfo = @{} if ( -no...
combined_dataset/train/non-malicious/4111.ps1
4111.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()] [string]$SCCMModule, [ValidateNotNullOrEmpty()] [string]$SCCMServer, [ValidateNotNullOrEmpty()] [string]$SCCMSiteDescription, [ValidateNotNullOrEmpty()] [string]$SiteCode, [ValidateNotNullOrEmpty()] [string]$Collection, [ValidateNotNullOrEmpty()] [string...
combined_dataset/train/non-malicious/Logger.psm1.ps1
Logger.psm1.ps1
<# Name : Universal Log4Net Logging Module (Logger.psm1) Version : 0.1 Author : Joel Bennett (MVP) Site : http://www.HuddledMasses.org/ See Also : http://poshcode.org/1743 You should download this config and put it in your Modules\\Logger folder with this Logger.psm1 Uses L...
combined_dataset/train/non-malicious/sample_8_22.ps1
sample_8_22.ps1
if (Test-Path "HKLM:\System\CurrentControlSet\Services\MSiSCSI") { $MSiSCSIService = Get-Service "MSiSCSI" if ($MSiSCSIService.Status.value__ -eq 4) { Import-LocalizedData -BindingVariable ISCSIInfoStrings Write-DiagProgress -Activity $ISCSIInfoStrings.ID_ISCSIInfo -Status $ISCSIInfoStrings.ID_...
combined_dataset/train/non-malicious/sample_30_53.ps1
sample_30_53.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/3881.ps1
3881.ps1
function Test-DataSourceCreateUpdateDelete { $wsname = Get-ResourceName $dsName = Get-ResourceName $rgname = Get-ResourceGroupName $subId1 = "0b88dfdb-55b3-4fb0-b474-5b6dcbe6b2ef" $subId2 = "bc8edd8f-a09f-499d-978d-6b5ed2f84852" $wslocation = Get-ProviderLocation New-AzResour...
combined_dataset/train/non-malicious/528.ps1
528.ps1
function Backup-AllSPLists{ [CmdletBinding()] param( [Parameter(Position=0, Mandatory=$true)] [String] $Path ) if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Microsoft.SharePoint.PowerShell"} $SPSites = $SPWebApp | Get-SPsite -Lim...
combined_dataset/train/non-malicious/sample_62_22.ps1
sample_62_22.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 = '88.1.0' # S...
combined_dataset/train/non-malicious/sample_62_98.ps1
sample_62_98.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 = '87.0.0' # Supported P...
combined_dataset/train/non-malicious/Disconnect-VMHost_1.ps1
Disconnect-VMHost_1.ps1
#requires -version 2 #requires -pssnapin VMware.VimAutomation.Core Function Disconnect-VMHost { <# .Summary Used to Disconnect a Connected host from vCenter. .Parameter VMHost VMHost to Disconnect to virtual center .Example Get-VMHost | Where-Object {$_.state -eq "Conn...
combined_dataset/train/non-malicious/2990.ps1
2990.ps1
function Context { param( [Parameter(Mandatory = $true, Position = 0)] [string] $Name, [Alias('Tags')] [string[]] $Tag = @(), [Parameter(Position = 1)] [ScriptBlock] $Fixture ) if ($Fixture -eq $null) { if ($Name.Contains("`n")) { th...
combined_dataset/train/non-malicious/sample_48_18.ps1
sample_48_18.ps1
# # Module manifest for module 'OCI.PSModules.Events' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Events.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/2839.ps1
2839.ps1
function CreateConfigurationForNewContext { param( [string] $buildFile, [string] $framework ) $previousConfig = GetCurrentConfigurationOrDefault $config = new-object psobject -property @{ buildFileName = $previousConfig.buildFileName; framework = $previousConfig.framewo...