full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_52_80.ps1
sample_52_80.ps1
@{ # Script module or binary module file associated with this manifest. RootModule = 'Plaster.psm1' # ID used to uniquely identify this module GUID = 'cfce3c5e-402f-412a-a83a-7b7ee9832ff4' # Version number of this module. ModuleVersion = '1.1.3' # Private data to pass to the module specif...
combined_dataset/train/non-malicious/sample_41_74.ps1
sample_41_74.ps1
# # Module manifest for module 'OCI.PSModules.Datalabelingservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datalabelingservice.dll' # Version number of this module. ModuleVersion = '83.2.0' # Sup...
combined_dataset/train/non-malicious/fc2365e4-98a7-4ee6-89b0-65c32dfbe01a.ps1
fc2365e4-98a7-4ee6-89b0-65c32dfbe01a.ps1
#You'll need admin perms on all the servers to run this... Write-Host "ComputerName in White, then Local Groups in Green, Local Groups' Members in White" #This feeds the script a list of server names (ServerList.txt, placed in the same directory) #for which I want the Local Groups and all those groups' Members. ...
combined_dataset/train/non-malicious/sample_28_64.ps1
sample_28_64.ps1
# # Module manifest for module 'OCI.PSModules.Appmgmtcontrol' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Appmgmtcontrol.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSE...
combined_dataset/train/non-malicious/sample_39_91.ps1
sample_39_91.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/591.ps1
591.ps1
function Mount-TrueCyptContainer{ [CmdletBinding()] param( [Parameter(Mandatory=$true)] [String] $Name ) if(-not (Get-Command TrueCrypt)){ throw ("Command TrueCrypt not available, try `"Install-PPApp TrueCrypt`"") } $MountedContainers = Get-P...
combined_dataset/train/non-malicious/182.ps1
182.ps1
function Set-NetworkLevelAuthentication { [CmdletBinding()] PARAM ( [Parameter(ValueFromPipeline,ValueFromPipelineByPropertyName)] [System.String[]]$ComputerName = $env:ComputerName, [Parameter(Mandatory)] [System.Boolean]$EnableNLA, [Alias("RunAs")] [Syst...
combined_dataset/train/non-malicious/sample_53_62.ps1
sample_53_62.ps1
var state = command.getTrait("state"); var manipData = services.manipulators.getManipulatorData("CameraManipulator"); var mode = manipData.getTrait("CameraManipulationMode"); var tool = new Object(); tool.activate = function () { state.value = 2; mode.value = 2; // Orbit mode } tool.deactivate = fun...
combined_dataset/train/non-malicious/ConvertFrom-CliXml_2.ps1
ConvertFrom-CliXml_2.ps1
function ConvertFrom-CliXml { param( [Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)] [ValidateNotNullOrEmpty()] [String[]]$InputObject ) begin { $OFS = "`n" [String]$xmlString = "" } process { $xmlString += $Input...
combined_dataset/train/non-malicious/ConvertTo-RelativeTime.ps1
ConvertTo-RelativeTime.ps1
function ConvertTo-RelativeTimeString { #.Synopsis # Calculates a relative text version of a duration #.Description # Generates a string approximation of a timespan, like "x minutes" or "x days." Note this method does not add "about" to the front, nor "ago" to the end unless you pass them in. #.Parameter Span ...
combined_dataset/train/non-malicious/Invoke-SSH Wrapper.ps1
Invoke-SSH Wrapper.ps1
function Invoke-SSH { param ( [string]$Server = "$(throw 'Server is a mandatory parameter.')", $Credential = "$(throw 'Credential is a mandatory parameter.')", [switch]$Echo = $true, [string]$Command = "$(throw 'Command is a mandatory parameter.')" ) # Since function name is same as cmdlet, we have to...
combined_dataset/train/non-malicious/sample_42_85.ps1
sample_42_85.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(Manda...
combined_dataset/train/non-malicious/148.ps1
148.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-DetailedSystemInform.ps1
Get-DetailedSystemInform.ps1
##############################################################################\n##\n## Get-DetailedSystemInformation\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_24_8.ps1
sample_24_8.ps1
# # Module manifest for module 'OCI.PSModules.Mysql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Mysql.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/2705.ps1
2705.ps1
$Mod = New-InMemoryModule -ModuleName Win32 $ImageDosSignature = psenum $Mod PE.IMAGE_DOS_SIGNATURE UInt16 @{ DOS_SIGNATURE = 0x5A4D OS2_SIGNATURE = 0x454E OS2_SIGNATURE_LE = 0x454C VXD_SIGNATURE = 0x454C } $ImageFileMachine = psenum $Mod PE.IMAGE_FILE_MACHINE UInt16 @{ UNKNOWN = 0x...
combined_dataset/train/non-malicious/Get-Dependency_1.ps1
Get-Dependency_1.ps1
############################################################################## #.AUTHOR # Josh Einstein # Einstein Technologies, LLC ############################################################################## $BuiltInAliases = @{} $BuiltInCmdlets = @{} $BuiltInFunctions = @{} $BuiltInVariables = @{} ...
combined_dataset/train/non-malicious/sample_30_57.ps1
sample_30_57.ps1
@{ GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" FunctionsToExport = @() CmdletsToExport = "Get-Credential", "Get-ExecutionP...
combined_dataset/train/non-malicious/hex2dec_2.ps1
hex2dec_2.ps1
@echo off ::unequal symbols for %%i in ("!", "x") do if "%1" equ "%%~i" goto:error ::display help information args for %%i in ("-h", "/h", "-help", "/help") do ( if "%1" equ "%%~i" if not defined run goto:help ) if "%1" equ "-?" if not defined run goto:help if "%1" equ "/?" if not defined run goto:hel...
combined_dataset/train/non-malicious/sample_31_4.ps1
sample_31_4.ps1
# # Module manifest for module 'OCI.PSModules.Datascience' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datascience.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_55_8.ps1
sample_55_8.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2021 v5.8.194 Created on: 10/19/2021 3:50 PM Created by: ksarens Updated 10/26/2102 fixing error in help information adding support for offline...
combined_dataset/train/non-malicious/2678.ps1
2678.ps1
Add-Type -assembly "System.IO.Compression.FileSystem" Write-Host "------------------------------------------------------------" Write-Host "| Creating WebJob zip files" Write-Host "------------------------------------------------------------" $webJobs = @("governance-daily","provisioning") $dir = $(Get-Location).Path ...
combined_dataset/train/non-malicious/sample_11_67.ps1
sample_11_67.ps1
ConvertFrom-StringData @' id_sandev=Computer Storage Information id_sanstorageinfooutput=SAN utility output id_sanstorageinfooutputdesc=Storage Information '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7Y...
combined_dataset/train/non-malicious/sample_12_67.ps1
sample_12_67.ps1
ConvertFrom-StringData @' id_tcpipsettingscheck=Checking for KB 967224 id_tcpipsettingscheckdesc=Checking for modified TcpIp Reg Parameters '@ # SIG # Begin signature block # MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX...
combined_dataset/train/non-malicious/sample_36_32.ps1
sample_36_32.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'...
combined_dataset/train/non-malicious/sample_17_40.ps1
sample_17_40.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_25_47.ps1
sample_25_47.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\sucrase@3.35.0\node_modules\sucrase\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\sucrase@...
combined_dataset/train/non-malicious/2364.ps1
2364.ps1
$aDisabledAdComputers = Get-ADComputer -Filter * | Where-Object { $_.Enabled -eq $false }; foreach ($oAccount in $aDisabledAdComputers) { Remove-ADObject -Identity $oAccount -Confirm:$false -Recursive; }
combined_dataset/train/non-malicious/sample_13_30.ps1
sample_13_30.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # RemoveMDS.ps1 # Kill all Monitoring processes and clean up tra...
combined_dataset/train/non-malicious/sample_41_92.ps1
sample_41_92.ps1
# # Module manifest for module 'OCI.PSModules.Aispeech' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aispeech.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_62_40.ps1
sample_62_40.ps1
# # Copyright 2018-2024 HP Development Company, L.P. # All Rights Reserved. # # NOTICE: All information contained herein is, and remains the property of HP Development Company, L.P. # # The intellectual and technical concepts contained herein are proprietary to HP Development Company, L.P # and may be covered...
combined_dataset/train/non-malicious/sample_52_20.ps1
sample_52_20.ps1
# # Module manifest for module 'OCI.PSModules.Dataintegration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dataintegration.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported P...
combined_dataset/train/non-malicious/scriptable telnet client.ps1
scriptable telnet client.ps1
function read-stream ([Parameter(Posistion=0,Mandatory=$true)][validatenotnull()] [System.Net.Sockets.NetworkStream]$stream, [String]$expect = "") { $buffer = new-object system.byte[] 1024 $enc = new-object system.text.asciiEncoding ## Read all the data available from the stream, writing it to the ## ...
combined_dataset/train/non-malicious/Findup_4.ps1
Findup_4.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; namespace ConsoleApplication1 { public class FileInfoExt { public FileInfoExt(Fil...
combined_dataset/train/non-malicious/sample_5_61.ps1
sample_5_61.ps1
// =========================================================================================================================== // class DCIM_ExternalAccountProvider // =========================================================================================================================== [ Description ("A remot...
combined_dataset/train/non-malicious/sample_21_71.ps1
sample_21_71.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=Zmienna środowiskowa o tej nazwie i typie już istnieje. EnvironmentErrorDoesNotExists=Zmienna środowiskowa o tej nazwie i typie nie istnieje. '@ # SIG # Begin signature block # MIIoLAYJKoZIhvcNAQcCoIIoHTCCKBkCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEE...
combined_dataset/train/non-malicious/sample_47_34.ps1
sample_47_34.ps1
NKhông thể sử dụng hạn chế PrintAllTranslations với Hạn chế IgnoreTranslations.tBạn không thể thêm cột được tính '%{ccon_column/}' vào bảng kết hợp '%{ccon_table/}'. Vui lòng xóa cột được tính đó.|Bạn không thể thêm cột 'alternateOf' dùng cho các tập hợp vào bảng kết hợp '%{ccon_table/}'. Vui lòng xóa cột 'alternateOf...
combined_dataset/train/non-malicious/1510.ps1
1510.ps1
function Assert-Match { param( [Parameter(Position=0,Mandatory=$true)] [string] $Haystack, [Parameter(Position=1,Mandatory=$true)] [string] $Regex, [Parameter(Position=2)] [string] ...
combined_dataset/train/non-malicious/GPRS Online log_3.ps1
GPRS Online log_3.ps1
<# .SYNOPSIS Get-GprsTime (V3.0 Update for Windows 7) Check the total connect time of any GPRS devices from a specified date. Use Get-Help .\\Get-GprsTime -full to view Help for this file. .DESCRIPTION Display all the GPRS modem Event Log entries. While applications issued by the mobile phone manufacturers wi...
combined_dataset/train/non-malicious/sample_38_84.ps1
sample_38_84.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\autoprefixer@10.4.17_postcss@8.4.33\node_modules\autoprefixer\bin\node_modules;C:\Users\abder\component-maker\web\n...
combined_dataset/train/non-malicious/sample_47_43.ps1
sample_47_43.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Register-EditorCommand ` -Name 'PowerShellEditorServices.OpenEditorProfile' ` -DisplayName 'Open Editor Profile' ` -SuppressOutput ` -ScriptBlock { param([Microsoft.PowerShell.EditorServices.Extensions.EditorContex...
combined_dataset/train/non-malicious/4275.ps1
4275.ps1
function Get-System { [CmdletBinding(DefaultParameterSetName = 'NamedPipe')] param( [Parameter(ParameterSetName = "NamedPipe")] [Parameter(ParameterSetName = "Token")] [String] [ValidateSet("NamedPipe", "Token")] $Technique = 'NamedPipe', [Parameter(ParameterSet...
combined_dataset/train/non-malicious/sample_14_92.ps1
sample_14_92.ps1
# # Module manifest for module 'OCI.PSModules.Artifacts' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Artifacts.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/Start-TimeoutDialog.ps1
Start-TimeoutDialog.ps1
<# \n .Synopsis\n Displays a message box that will timeout after a set number of seconds.\n This script was written because WSHShell.Popup has a bug.\n \n Platform: Windows 7 32bit, Windows 2008 R2 64bit\n Author: Grant Carthew.\n Date: Apr 2011\n Updated: \n\n .Description\n When ...
combined_dataset/train/non-malicious/sample_42_29.ps1
sample_42_29.ps1
# # Module manifest for module 'OCI.PSModules.Datascience' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datascience.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEdition...
combined_dataset/train/non-malicious/New-Script 1.1.ps1
New-Script 1.1.ps1
## New-Script function ## Creates a new script from the most recent commands in history ################################################################################################## ## Example Usage: ## New-Script ScriptName 4 ## creates a script from the most recent four commands ## New-Script...
combined_dataset/train/non-malicious/sample_7_72.ps1
sample_7_72.ps1
# # Module manifest for module 'OCI.PSModules.Networkloadbalancer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Networkloadbalancer.dll' # Version number of this module. ModuleVersion = '93.0.0' # Sup...
combined_dataset/train/non-malicious/1181.ps1
1181.ps1
Set-StrictMode -Version 'Latest' & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) $publicKeyFilePath = Join-Path -Path $PSScriptRoot -ChildPath 'Cryptography\CarbonTestPublicKey.cer' -Resolve $privateKeyFilePath = Join-Path -Path $PSScriptRoot -ChildPath 'Cryptography\Carb...
combined_dataset/train/non-malicious/1064.ps1
1064.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldConvertToBase64 { $value = 'YAAxADIAMwA0ADUANgA3ADgAOQAwAC0APQBxAHcAZQByAHQAeQB1AGkAbwBwAFsAXQBcAGEAcwBkAGYAZwBoAGoAawBsADsAJwB6AHgAYwB2AGIAbgBtACwALgAvACAAfgAhAEA...
combined_dataset/train/non-malicious/2478.ps1
2478.ps1
[CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$VMName, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$VMResourceGroupName, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateScript({ $_ -in (Get-AzureRmLocation).DisplayName })] [string]$VMResource...
combined_dataset/train/non-malicious/HttpRest 1.2.ps1
HttpRest 1.2.ps1
#requires -version 2.0 ## HttpRest module version 1.2 #################################################################################################### ## Still only the initial stages of converting to a full v2 module ## Based on the REST api from MindTouch's Dream SDK ## ## INSTALL: ## You need mindtouch.dr...
combined_dataset/train/non-malicious/sample_2_39.ps1
sample_2_39.ps1
#************************************************ # DC_NfsClient-Component.ps1 # Version 1.0.06.26.14: Created script. # Version 1.1.08.14.14: Updated comments. TFS264083 # Date: 2014 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about NFS Client. # Called from: Main Networkin...
combined_dataset/train/non-malicious/sample_62_39.ps1
sample_62_39.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 = '86.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_23_6.ps1
sample_23_6.ps1
[CmdletBinding()] param() function findExistingImportModuleDirectives([Parameter(Mandatory=$true)][string]$path) { if (!(Test-Path $path)) { return } $fileContents = Get-Content $path $fileContents -match 'Import-Module.+?(?=posh-vcpkg)' return } $scriptsDir = split-path -parent $scri...
combined_dataset/train/non-malicious/2396.ps1
2396.ps1
function Get-UserProfilePath { [OutputType([string])] [CmdletBinding(DefaultParameterSetName = 'None')] param ( [Parameter(ParameterSetName = 'SID')] [string]$Sid, [Parameter(ParameterSetName = 'Username')] [string]$Username ) process { try { if ($Sid) { $WhereBlock = { $_.PSChildName...
combined_dataset/train/non-malicious/1537.ps1
1537.ps1
function Remove-MrUserVariable { [CmdletBinding(SupportsShouldProcess)] param () if ($StartupVars) { $UserVars = Get-Variable -Exclude $StartupVars -Scope Global foreach ($var in $UserVars){ try { Remove-Variable -Name $var.Name -Force -Scope Global ...
combined_dataset/train/non-malicious/sample_27_11.ps1
sample_27_11.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 = '74.1.0' # Supported PSEdi...
combined_dataset/train/non-malicious/2350.ps1
2350.ps1
function convertDsnToPathFormat($sDsn) { $sDsn = $sDsn.Replace(',<domainDNhere>',''); $sDsn = $sDsn.Replace('OU=',''); $aDsn = $sDsn.Split(','); [array]::Reverse($aDsn); $sPath = $aDsn -join '/'; return '<domain name>/' + $sPath; } $aAllGpos = Get-GPOReport -all -ReportType XML; $aFilteredGpos = @(); $aLinkedOuG...
combined_dataset/train/non-malicious/sample_6_49.ps1
sample_6_49.ps1
ConvertFrom-StringData @' id_memorydumprelated=Memory Dump Related Issues id_memorydumpcollecting=Collecting Memory Dump Related Information id_memorydumprelatedinfo=Memory dump related information id_memorydumpreport=Memory Dump Report id_memorydumpfile=Memory Dump File '@ # SIG # Begin signature block # MII...
combined_dataset/train/non-malicious/sample_20_29.ps1
sample_20_29.ps1
@{ GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" FunctionsToExport = @() CmdletsToExport = "Get-Credential", "Get-ExecutionP...
combined_dataset/train/non-malicious/sample_0_34.ps1
sample_0_34.ps1
#Collect files for VSSBackup package Import-LocalizedData -BindingVariable VSSBackupFilesStrings Write-DiagProgress -Activity $VSSBackupFilesStrings.ID_VSSBackupPkgFiles -Status $VSSBackupFilesStrings.ID_VSSBackupPkgFilesObtaining $filesToCollect = "$Env:windir\Logs\WindowsServerBackup\*.*" $filesDescription...
combined_dataset/train/non-malicious/sample_14_76.ps1
sample_14_76.ps1
let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl(); let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/web.eventHandlers.js"]; let currentScriptElement = document.querySelector("script[src='Scripts/web.plugin.js']"); if (currentScriptElement !== null) { scripts.for...
combined_dataset/train/non-malicious/sample_52_95.ps1
sample_52_95.ps1
function Disable-WACAFFeatures { <# .SYNOPSIS Disables all features that are not already disabled in the selected list. .DESCRIPTION Disables all features that are not already disabled in the selected list. .ROLE Administrators #> Param([object[]] $Features) Set-StrictMode -Version 5.0; $Succes...
combined_dataset/train/non-malicious/sample_6_94.ps1
sample_6_94.ps1
# Load Common Library # Load Reporting Utilities #_#$debug = $false . ./utils_cts.ps1 . ./TS_RemoteSetup.ps1 # 2023-02-20 WalterE mod Trap #we# trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationIn...
combined_dataset/train/non-malicious/Hash Checker On One Line.ps1
Hash Checker On One Line.ps1
# to make it readable, I've wrapped the lines, but you can remove all the line breaks: &{ PARAM($FileName,$HashFileName) ((Get-Content $HashFileName) -match $FileName)[0].split(" ")[0] -eq [string]::Join("", ( [Security.Cryptography.HashAlgorithm]::Create( ([IO.Path]::GetExtension($HashFileName...
combined_dataset/train/non-malicious/886.ps1
886.ps1
$managedRgId = (Get-AzManagedApplication -ResourceGroupName DemoApp).Properties.managedResourceGroupId $locationPolicyDefinition = Get-AzPolicyDefinition -Id /providers/Microsoft.Authorization/policyDefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c $locationsArray = @("northeurope", "westeurope") $policyParameters ...
combined_dataset/train/non-malicious/2423.ps1
2423.ps1
[CmdletBinding()] param ( [string]$SiteCode = 'UHP', [ValidateScript({Test-Connection $_ -Quiet -Count 1})] [string]$SiteDbServer = 'CONFIGMANAGER', [ValidateScript({ Test-Path $_ -PathType 'Container' })] [string]$DestDbBackupFolderPath = '\\sanstoragea\lt_archive\30_Days\ConfigMgr', [ValidateScript({ Test...
combined_dataset/train/non-malicious/3035.ps1
3035.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "Should -BeLike" { It "passes for things that are like wildcard" { "foobar" | Should BeLike "*ob*" "foobar" | Should -BeLike "*ob*" } It "passes for strings with different case" { "foobar" | ...
combined_dataset/train/non-malicious/sample_26_51.ps1
sample_26_51.ps1
# # Module manifest for module 'OCI.PSModules.Osuborganizationsubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll' # Version number of this module. ModuleVersion...
combined_dataset/train/non-malicious/2779.ps1
2779.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$True,Position=0)] [String]$Path ) $files = ls -r $Path | ? { $_.Name -match ".*\-.*" } $files | Select-Object BaseName, Length | Sort-Object Length | ConvertTo-Csv -Delimiter "`t"
combined_dataset/train/non-malicious/3985.ps1
3985.ps1
function ServiceBusRuleTests { $location = Get-Location $resourceGroupName = getAssetName "RGName-" $namespaceName = getAssetName "Namespace1-" $nameTopic = getAssetName "Topic-" $subName = getAssetName "Subscription-" $ruleName = getAssetName "Rule-" $ruleName1 = getAsse...
combined_dataset/train/non-malicious/sample_32_4.ps1
sample_32_4.ps1
# # Module manifest for module 'msft.sme.sdn.route-tables' # @{ # Script module or binary module file associated with this manifest. RootModule = 'msft.sme.sdn.route-tables.psm1' # Version number of this module. ModuleVersion = '3.3.0' # Supported PSEditions # CompatiblePSEditions = @() # ID used to...
combined_dataset/train/non-malicious/List AddRemovePrograms.ps1
List AddRemovePrograms.ps1
if(!(gwmi -list Win32_AddRemovePrograms)) { set-content $pwd\\RegProgs.mof @' #pragma namespace("\\\\\\\\.\\\\root\\\\cimv2") instance of __Win32Provider as $Instprov { Name ="RegProv" ; ClsID = "{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}" ; }; instance of __InstanceProviderRegistration { Provider =$InstProv; ...
combined_dataset/train/non-malicious/4033.ps1
4033.ps1
function Test-ManagedApplicationDefinitionCRUD { $rgname = Get-ResourceGroupName $appDefName = Get-ResourceName $rglocation = "EastUS2EUAP" $display = "myAppDefPoSH" New-AzResourceGroup -Name $rgname -Location $rglocation $actual = New-AzManagedApplicationDefinition -Name $appDefName -Resourc...
combined_dataset/train/non-malicious/Find-String.ps1
Find-String.ps1
## Find-String.ps1\n########################################################################################################################\n## Find-String is basically a PowerShell 1.0 wrapper around { select-string } which will append the "Matches" to it\n## Highlight-Matches takes a collections of MatchInfo objects...
combined_dataset/train/non-malicious/Connect-AccessDB.ps1
Connect-AccessDB.ps1
# Functions for connecting to and working with Access databases # Matt Wilson # May 2009 function Connect-AccessDB ($global:dbFilePath) { # Test to ensure valid path to database file was supplied if (-not (Test-Path $dbFilePath)) { Write-Error "Invalid Access database path specified. Please supply full a...
combined_dataset/train/non-malicious/sample_66_76.ps1
sample_66_76.ps1
# Localized 06/27/2024 06:02 AM (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=找到加密的包: {0} CertificateFound=找到证书: ...
combined_dataset/train/non-malicious/1bcb760e-1da1-47f8-9433-4a6a544b6c98.ps1
1bcb760e-1da1-47f8-9433-4a6a544b6c98.ps1
/* * Schreiben sie ein Programm,dass ihnen für eine bestimmte Stelle, * die zugehörige Fibonacci Zahl ausgibt. */ package fibonacci; /* * @author Tobias Günther */ public class Fibonacci { public static void main(String[] args) { int fragestelle = 9; //Gefragte Stelle ...
combined_dataset/train/non-malicious/sample_41_26.ps1
sample_41_26.ps1
name: Install Dependencies description: "" inputs: target-platform: description: 'The platform to install dependencies for. #See available values at https://platform.uno/docs/articles/external/uno.check/doc/using-uno-check.html' required: false default: 'all' dotnet-version: description: '...
combined_dataset/train/non-malicious/1284.ps1
1284.ps1
function Set-CHostsEntry { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [Net.IPAddress] $IPAddress, [Parameter(Mandatory=$true)] [string] $HostName, [string] $Description, ...
combined_dataset/train/non-malicious/sample_32_11.ps1
sample_32_11.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/sample_48_85.ps1
sample_48_85.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/1933.ps1
1933.ps1
Describe "Get-Alias DRT Unit Tests" -Tags "CI" { It "Get-Alias Bogus Scope Name should throw PSArgumentException"{ { Get-Alias -Name "ABCD" -Scope "bogus" } | Should -Throw -ErrorId "Argument,Microsoft.PowerShell.Commands.GetAliasCommand" } It "Get-Alias OutOfRange Scope"{ { Get-Alias -Na...
combined_dataset/train/non-malicious/Search-Help.ps1
Search-Help.ps1
##############################################################################\n##\n## Search-Help\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\nSearch the P...
combined_dataset/train/non-malicious/4003.ps1
4003.ps1
$script:AutomationAccountName = "mirichmo-aatest-WUS2" $script:ResourceGroupName = "mirichmo-aatest-wus2-rg" $script:TestRunbookName = "TestRunbookName" $script:TestRunbookTwoParamsName = "TestRunbookTwoParamsName" function Create-PublishedRunbook { param( [Parameter (Mandatory = $true)] [Stri...
combined_dataset/train/non-malicious/sample_29_72.ps1
sample_29_72.ps1
# # Script module for module 'Az.DataBoxEdge' that is executed when 'Az.DataBoxEdge' 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/sample_9_60.ps1
sample_9_60.ps1
#************************************************ # TS_MCALite.ps1 # Version 1.0.1 # Date: 7/17/2012 # Author: tspring # Description: [Idea ID 4796] [Windows] MaxConcurrentApi Problem Detection Lite # Rule number: 4796 # Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.aspx?ID=4796 #**...
combined_dataset/train/non-malicious/sample_28_26.ps1
sample_28_26.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_67_26.ps1
sample_67_26.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/Get-SQLSaturdaySessions.ps1
Get-SQLSaturdaySessions.ps1
function Get-SQLSaturdaySessionList { param( [string] $Number = "111", $GetUnscheduled ) $baseUrl = "http://sqlsaturday.com/" + $Number $url = $baseUrl + "/schedule.aspx" $page = $null try { Write-Verbose "Initiating WebClient" ...
combined_dataset/train/non-malicious/PowerShell Talk Xen1.ps1
PowerShell Talk Xen1.ps1
#The PowerShell Talk #Demo 1 - Hypervisors #Xen! #Connect to XenServer Get-Credential | connect-Xenserver -Url http://XenServer_URL/sdk #Create Our Network Create-XenServer:Network -NameLabel "Test Network" #Change it's description Get-XenServer:Network -NameFilter "Test Network" | Set-XenServer:Network.N...
combined_dataset/train/non-malicious/sample_20_89.ps1
sample_20_89.ps1
--- # # Get VM hosts and write information to a .csv file # - name: Get VM hosts and write information to a .csv file hosts: localhost connection: local gather_facts: false vars: # Create an anchor for api_info that can be used throughout the file api_info: &api_info # if api_key vars are omitted,...
combined_dataset/train/non-malicious/sample_24_33.ps1
sample_24_33.ps1
# For more information, please refer to https://aka.ms/vscode-docker-python FROM python:3-slim {{#if (isRootPort ports)}} # Warning: A port below 1024 has been exposed. This requires the image to run as a root user which is not a best practice. # For more information, please refer to https://aka.ms/vscode-docker-...
combined_dataset/train/non-malicious/sample_25_35.ps1
sample_25_35.ps1
# Include helper scripts . ".\Utils\HelperFunctions.ps1" . ".\Utils\AwsSentinelTag.ps1" # Validate AWS configuration Test-AwsConfiguration Write-Output `n`n'Setting up your AWS environment' Write-Output `n'This script enables additional VPC Flow Logs if you have already set up the required resources Bucket S3...
combined_dataset/train/non-malicious/g.ps1
g.ps1
function Get-User($user) { $dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() $root = [ADSI] "LDAP://$($dom.Name)" $searcher = New-Object System.DirectoryServices.DirectorySearcher $root $searcher.filter = "(&(objectCategory=person)(objectClass=user)(cn=$user))" $user = $searcher.F...
combined_dataset/train/non-malicious/45.ps1
45.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/Test-Server.ps1
Test-Server.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/3327.ps1
3327.ps1
function Update-Plugin { [PoshBot.BotCommand( Aliases = ('up', 'updateplugin'), Permissions = 'manage-plugins' )] [cmdletbinding()] param( [parameter(Mandatory)] $Bot, [parameter(Mandatory, Position = 0)] [string[]]$Name, [parameter(Positio...
combined_dataset/train/non-malicious/762.ps1
762.ps1
function Import-FileWildcard { [CmdletBinding(SupportsShouldProcess=$true, DefaultParameterSetName='Path')] param( [Parameter(Mandatory=$true, Position=0, ParameterSetName="Path", ValueFromPipeline=$true, ValueFromPipe...
combined_dataset/train/non-malicious/2932.ps1
2932.ps1
task TaskAFromModuleB { 'Executing [TaskA] from module [TaskModuleB] version [0.1.0]' } task TaskBFromModuleB { 'Executing [TaskB] from module [TaskModuleB] version [0.1.0]' }