full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_35_25.ps1 | sample_35_25.ps1 | #
# Module manifest for module 'OCI.PSModules.Dataflow'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dataflow.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_60_39.ps1 | sample_60_39.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_53_69.ps1 | sample_53_69.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.2.0'
# Supported PSE... |
combined_dataset/train/non-malicious/sample_29_34.ps1 | sample_29_34.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/sample_10_1.ps1 | sample_10_1.ps1 | #************************************************
# DC_PStat.PS1
# Version 1.0.1
# Date: 07-10-2009
# Author: Andre Teixeira - andret@microsoft.com
# Description: PStat.exe tool, saving output to a file named $ComputerName_PStat.txt
#************************************************
if($debug -eq $true){[void]$... |
combined_dataset/train/non-malicious/283.ps1 | 283.ps1 |
$clientId = " FILL ME IN "
function GetAuthToken
{
if(-not (Get-Module AzureRm.Profile)) {
Import-Module AzureRm.Profile
}
$redirectUri = "urn:ietf:wg:oauth:2.0:oob"
$resourceAppIdURI = "https://analysis.windows.net/powerbi/api"
$authority = "https://login.mic... |
combined_dataset/train/non-malicious/2571.ps1 | 2571.ps1 |
param(
$Environment
)
switch ($Environment)
{
PROD1 { $Server = 'PAPPBO20';
$BOService = 'BOE120SIAPAPPBO20';
$BOWebService = 'W3SVC';
$BODirectory = 'E:\Business Objects\BusinessObjects Enterprise 12.0\Data';
$BODirOld = 'E:\Business Objects\BusinessObjects Enterprise 12.0\Dat... |
combined_dataset/train/non-malicious/1315.ps1 | 1315.ps1 |
if( -not (Get-Command -Name 'Get-WindowsFeature*' | Where-Object { $_.ModuleName -ne 'Carbon' }) )
{
function Install-CWindowsFeature
{
[CmdletBinding(SupportsShouldProcess=$true,DefaultParameterSetName='ByName')]
param(
[Parameter(Mandatory=$true,ParameterSetName='ByName'... |
combined_dataset/train/non-malicious/Reset-Tray.ps1 | Reset-Tray.ps1 | function Reset-Tray {
Add-Type -Assembly UIAutomationClient
$Window = Add-Type -Name ([char[]](65..90 | Get-Random -count 10) -join "") -Member @"
[DllImport("user32")]
public static extern IntPtr PostMessage(IntPtr hWnd, UInt32 Msg, Int32 wParam, Int32 lParam);
public static void SendMouseMov... |
combined_dataset/train/non-malicious/sample_8_44.ps1 | sample_8_44.ps1 | <#
.SYNOPSIS
Collects basic information about the installed instance of WSUS Server
.DESCRIPTION
Collects basic information about the installed instance of WSUS Server and generates two files:
COMPUTERNAME_WSUS_BasicInfo.txt
(Optional) COMPUTERNAME_WSUS_UpdateApprovals.txt
.PARAMETER GetApprovedUpdates
(Opt... |
combined_dataset/train/non-malicious/sample_2_55.ps1 | sample_2_55.ps1 | ###########################################################################
# DC_Hardware
# Version 1.0
# Date: 09-26-2012
# Author: mifannin
# Description: Collects Installed Hardware Data
###########################################################################
Import-LocalizedData -BindingVariable Hardwar... |
combined_dataset/train/non-malicious/sample_47_83.ps1 | sample_47_83.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=Nie znaleziono wymaganego modułu programu PowerShell (FailoverClusters). Użyj narzędzia Role i funkcje, aby zainstalować następujące oprogramowanie: Narzędzia administracji zdalnej serwera | Narzędzia do administrowania funkcjami | Narzędzia klastra trybu failov... |
combined_dataset/train/non-malicious/351.ps1 | 351.ps1 | function Test-PSFFeature
{
[OutputType([bool])]
[CmdletBinding()]
param (
[PsfValidateSet(TabCompletion = 'PSFramework.Feature.Name')]
[parameter(Mandatory = $true)]
[string]
$Name,
[string]
$ModuleName
)
begin
{
$featureItem = Get-PSFFeature -Name $Name
}
process
{
if (-not $featureItem.... |
combined_dataset/train/non-malicious/2627.ps1 | 2627.ps1 |
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | Out-Null
[System.reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null
function Out-DataTable
{
[C... |
combined_dataset/train/non-malicious/Get-FileEncoding_1.ps1 | Get-FileEncoding_1.ps1 | function Get-FileEncoding {
<#
.SYNOPSIS
Gets file encoding.
.DESCRIPTION
The Get-FileEncoding function determines encoding by looking at Byte Order Mark (BOM).
Based on port of C# code from http://www.west-wind.com/Weblog/posts/197245.aspx
.EXAMPLE
Get-ChildItem *.ps1 | select FullName, @{n='Encoding';e={Get-... |
combined_dataset/train/non-malicious/Query-VeeamBackupDB.ps1 | Query-VeeamBackupDB.ps1 | $dbServer = "servername\\instance"
$db = "VeeamBackup"
$veeamJob = "VeeamJobName"
$Query = "SELECT [job_name],CONVERT(char(10),[creation_time], 101) AS start_date `
,CONVERT(varchar, [creation_time], 108) AS job_start,CONVERT(char(10), [end_time], 101) AS end_date `
,CONVERT(varchar, [end_time], 108) AS job_end, `... |
combined_dataset/train/non-malicious/sample_65_93.ps1 | sample_65_93.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcemanager.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported P... |
combined_dataset/train/non-malicious/1780.ps1 | 1780.ps1 |
return
function RemoveTestGroups
{
param([string] $basename)
$results = Get-LocalGroup $basename*
foreach ($element in $results) {
Remove-LocalGroup -SID $element.SID
}
}
function VerifyFailingTest
{
param(
[scriptblock] $sb,
[string] $expectedFqeid
)
$backu... |
combined_dataset/train/non-malicious/sample_6_33.ps1 | sample_6_33.ps1 | #************************************************
# DC_KBInstallLogs.ps1
# Version 1.0.1
# Date: 8-29-2012
# Author: Kate Wang (v-kaw)
# Description: This script would collect %windir%\kb*.log when running on a Windows Server 2003 and XP to a compressed file named $ComputerName_KBInstallLogs.zip
#***************... |
combined_dataset/train/non-malicious/chkhash_13.ps1 | chkhash_13.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... |
combined_dataset/train/non-malicious/2090.ps1 | 2090.ps1 |
Describe "Cmdlet declaration statement" -Tags "CI" {
$testData = @(
@{ Name = 'Verify non-cmdlet formatted names are allowed';
Script = '
function foo
{
[CmdletBinding()]
param()
$a
}' }... |
combined_dataset/train/non-malicious/2657.ps1 | 2657.ps1 |
[CmdletBinding()]
Param
(
[switch]$ShowInstallationPrompt = $false,
[switch]$ShowInstallationRestartPrompt = $false,
[switch]$CleanupBlockedApps = $false,
[switch]$ShowBlockedAppDialog = $false,
[switch]$DisableLogging = $false,
[string]$ReferringApplication = '',
[string]$Message = '',
[string]$MessageAlign... |
combined_dataset/train/non-malicious/Get_Set Signature (CTP3).ps1 | Get_Set Signature (CTP3).ps1 | #Requires -version 2.0
## Authenticode.psm1 updated for CTP 3
####################################################################################################
## Wrappers for the Get-AuthenticodeSignature and Set-AuthenticodeSignature cmdlets
## These properly parse paths, so they don't kill your pipeline and ... |
combined_dataset/train/non-malicious/sample_54_15.ps1 | sample_54_15.ps1 | param (
[string]$Workspace,
# [bool]$UseBCTranslations = $false,
# [bool]$UseOMATranslations = $false
[string]$strUseBCTranslations = "false",
[string]$strUseOMATranslations = "false"
)
if ($strUseBCTranslations -eq "true") {
$UseBCTranslations = $true
}
else {
$UseBCTranslation... |
combined_dataset/train/non-malicious/Sith Remote logon mon.ps1 | Sith Remote logon mon.ps1 | ' Script: Process_Monitor.vbs
' Purpose: Live process monitoring script that will trigger an e-mail to a recipient if a certain process is started
' Author: Paperclips (The Dark Lord)
' Email: magiconion_M@hotmail.com
' Date: Feb 2011
' Comments: This particular monitor monitors the LogonUI proce... |
combined_dataset/train/non-malicious/sample_3_70.ps1 | sample_3_70.ps1 | "use strict";(self.webpackChunkTypeScriptModule=self.webpackChunkTypeScriptModule||[]).push([[1039],{43199:i=>{i.exports=JSON.parse('{"copilot-ext-auth-sdk.apiPluginAuthMessageTextWithAppName":"Vui lòng đăng nhập vào {0} để tiếp tục. Sau khi đăng nhập thành công, chúng tôi sẽ nhanh chóng bắt đầu xử lý truy vấn của bạn.... |
combined_dataset/train/non-malicious/sample_43_75.ps1 | sample_43_75.ps1 | #
# Module manifest for module 'OCI.PSModules.Capacitymanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Capacitymanagement.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Suppo... |
combined_dataset/train/non-malicious/sample_10_59.ps1 | sample_10_59.ps1 | ConvertFrom-StringData @'
id_mats_networkadapter=Network Adapter
id_mats_networkadaptertype=Type
id_mats_networkadapterspeed=Speed
id_mats_ipaddresses=IP Addresses
id_mats_defaultgateway=Default Gateway
id_mats_dnsservers=DNS Servers
id_mats_proxyenabled=Proxy Server
id_enabled=Enabled
id_mats_proxyserveradd=P... |
combined_dataset/train/non-malicious/sample_33_44.ps1 | sample_33_44.ps1 | #
# Module manifest for module 'OCI.PSModules.Adm'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Adm.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_55_80.ps1 | sample_55_80.ps1 | # ---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------------------------... |
combined_dataset/train/non-malicious/sample_26_82.ps1 | sample_26_82.ps1 | #
# Module manifest for module 'OCI.PSModules.Waa'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waa.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/Write-Output_1.ps1 | Write-Output_1.ps1 | ########################################################################
## Copyright (c) Joel Bennett, 2010
## Free for use under MS-PL, MS-RL, GPL 2, or BSD license. Your choice.
function Write-Output {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)]
[Allow... |
combined_dataset/train/non-malicious/sample_42_52.ps1 | sample_42_52.ps1 | #
# Module manifest for module 'OCI.PSModules.Governancerulescontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Governancerulescontrolplane.dll'
# Version number of this module.
ModuleVersion =... |
combined_dataset/train/non-malicious/sample_46_79.ps1 | sample_46_79.ps1 | #
# Module manifest for module 'OCI.PSModules.Healthchecks'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_53_6.ps1 | sample_53_6.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_26_8.ps1 | sample_26_8.ps1 | #
# Module manifest for module 'OCI.PSModules.Dataflow'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dataflow.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/Get-Credential++.ps1 | Get-Credential++.ps1 | ## Get-Credential
## An improvement over the default cmdlet which has no options ...
###################################################################################################
## History
## v 2.0 Rewrite for v2 to replace the default Get-Credential
## v 1.2 Refactor ShellIds key out to a variable, and wr... |
combined_dataset/train/non-malicious/sample_11_32.ps1 | sample_11_32.ps1 | ConvertFrom-StringData @'
id_ex_exbpacmdact=Exchange Support Tool - ExBPA
id_ex_exbpacmdstat=Running Exchange Best Practices Analyzer (ExBPA), please wait...
id_ex_exbpacmdfiledescription=ExBPA Health Check
id_ex_exbpacmdreportsection=Exchange Toolbox
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIo... |
combined_dataset/train/non-malicious/2536.ps1 | 2536.ps1 |
$vComputerName = "PSQLDLS34"
$vInstanceName = "MSSQLSERVER"
Write-Host "IP Address(es) that the SQL instance " $vComputerName "\" $vInstanceName " is listening on are listed below: "
$vListenAll = 0
$vTCPProps = get-WMIObject ServerNetworkProtocolProperty -ComputerName $vComputerName -NameSpace "root\Micros... |
combined_dataset/train/non-malicious/3060.ps1 | 3060.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Should -FileContentMatchExactly" {
Context "when testing file contents" {
Setup -File "test.txt" "this is line 1$([System.Environment]::NewLine)Pester is awesome$([System.Environment]::NewLine)And this is Unicode: ☺"
It... |
combined_dataset/train/non-malicious/sample_16_7.ps1 | sample_16_7.ps1 | ConvertFrom-StringData @'
IPAddressDisplayNameFormat=IP-adress: {0}
NetworkNameDisplayNameFormat=Namn: {0}
NetworkNameOfflineDisplayNameFormat=IP-adress: Adress i {0}
CreateClusterProgressValidationStart=Verifierar servrars lämplighet för ett redundanskluster.
CreateClusterProgressValidationEnd=Verifieringen av se... |
combined_dataset/train/non-malicious/SetDefaultPrinter.ps1 | SetDefaultPrinter.ps1 | <#
.SYNOPSIS
Sets the Default Printer for any user on any machine in active directory.
.DESCRIPTION
Search AD for Computername; Select UserAccount and Printer and make that printer the default
printer for that user on that computer.
.PARAMETER Hostnme
This parameter is required and should reflect the c... |
combined_dataset/train/non-malicious/sample_10_56.ps1 | sample_10_56.ps1 | ConvertFrom-StringData @'
id_bpastarting=Starting Best Practices Analyzer
id_bparunning=Running Best Practices Analyzer
id_bpagenerating=Generating BPA Output
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8... |
combined_dataset/train/non-malicious/Get-DiskUsage_3.ps1 | Get-DiskUsage_3.ps1 | Function Get-DiskUsage {
<#
.SYNOPSIS
A tribute to the excellent Unix command DU.
.DESCRIPTION
This command will output the full path and the size of any object
and it's subobjects. Using just the Get-DiskUsage command without
any parameters will result in an output of the directory you are
currently p... |
combined_dataset/train/non-malicious/648.ps1 | 648.ps1 |
function Get-TestUser() {
if (-not $env:RsUser) {
throw 'Environment variable RsUser is not defined!'
}
return $env:RsUser
}
Describe "Get-RsCatalogItemRole" {
$user = Get-TestUser
$reportServerUri = 'http://localhost/reportserver'
$catalogItemPath = '/'
Context "Get Catalog It... |
combined_dataset/train/non-malicious/sample_27_20.ps1 | sample_27_20.ps1 | <#
.SYNOPSIS
Edge Automation Hours of Battery Life Workload Assessment
.DESCRIPTION
Automates Edge Browsing Activations.
.PARAMETER Iterations
Integer, execution iterations.
.PARAMETER ScenarioJson
Integer, scenario json file. 0 : scenario.default.json, 1 : scenario.browsin... |
combined_dataset/train/non-malicious/LibraryLinkedServer.ps1 | LibraryLinkedServer.ps1 | try {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop}
catch {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo"}
try {add-type -AssemblyName "Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=8... |
combined_dataset/train/non-malicious/sample_24_83.ps1 | sample_24_83.ps1 | #
# Module manifest for module 'OCI.PSModules.Loggingingestion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported... |
combined_dataset/train/non-malicious/Computer Inventory.ps1 | Computer Inventory.ps1 | # ========================================================
#
# Script Information
#
# Title: Remote Computer Inventory
# Author: Assaf Miron
# Originally created: 21/06/2008
# Original path: Computer-Inventory.PS1
# Description: Collects Remote Computer Data Using WMI and Registry Access
# Outputs... |
combined_dataset/train/non-malicious/sample_21_35.ps1 | sample_21_35.ps1 | # virtualenv activation module
# Activate with `overlay use activate.nu`
# Deactivate with `deactivate`, as usual
#
# To customize the overlay name, you can call `overlay use activate.nu as foo`,
# but then simply `deactivate` won't work because it is just an alias to hide
# the "activate" overlay. You'd need to call `... |
combined_dataset/train/non-malicious/Get VMs on a LUN.ps1 | Get VMs on a LUN.ps1 | function Get-LunVM {
param($Lun)
Get-VM | Where {
$_ | Get-Stat -stat disk.write.average -realtime -maxsamples 1 `
-erroraction SilentlyContinue |
Where { $_.Instance -eq $Lun } }
}
|
combined_dataset/train/non-malicious/sample_3_71.ps1 | sample_3_71.ps1 | #$debug = $false
# Load Common Library:
. ./utils_cts.ps1
# Load DSD Common Function Library
. ./utils_DSD.ps1
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo... |
combined_dataset/train/non-malicious/3300.ps1 | 3300.ps1 |
function New-PoshBotCardResponse {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope='Function', Target='*')]
[cmdletbinding()]
param(
[ValidateSet('Normal', 'Warning', 'Error')]
[string]$Type = 'Normal',
[switch]$DM,
... |
combined_dataset/train/non-malicious/sample_64_35.ps1 | sample_64_35.ps1 | # Copyright (C) Microsoft Corporation. All rights reserved.
#
# Module manifest for module 'ProvisioningTestModule'
#
@{
# Version number of this module.
ModuleVersion = '1.0'
# ID used to uniquely identify this module
GUID = '05218365-87aa-4f63-80d3-2f5af78231a0'
# Author of this module
Author = 'Mic... |
combined_dataset/train/non-malicious/33.ps1 | 33.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aa... |
combined_dataset/train/non-malicious/sample_43_3.ps1 | sample_43_3.ps1 | function Initialize-AzDataProtectionRestoreRequest
{
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IAzureBackupRestoreRequest')]
[CmdletBinding(PositionalBinding=$false, DefaultParameterSetName='AlternateLocationFullRecovery')]
[Microsoft.Azure.PowerShell.Cmdlets.DataPro... |
combined_dataset/train/non-malicious/1478.ps1 | 1478.ps1 |
function Set-ModuleManifestMetadata
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
$ManifestPath,
[string[]]
$Tag,
[string]
$ReleaseNotesPath
)
Set-StrictMode -Version 'Latest'
$releaseNotes = Get-ModuleReleaseN... |
combined_dataset/train/non-malicious/The Letter Diamond Oneli.ps1 | The Letter Diamond Oneli.ps1 | &{Param([char]$l)$s=66;$z=[int]$l;$o=$z-$s+ 5;$p=-1;$n=&{"$(" "*$o)A";([string[]][char[]]($s..$z))|%{$p+=2;$o--;"$(" "*$o)$_$(" "*$p)$_"}};$n;$n[$($n.Length-2)..0]}L
|
combined_dataset/train/non-malicious/LoadModuleConfig_1.ps1 | LoadModuleConfig_1.ps1 | ################################################################################
## Script Name: LoadModuleConfig
## Created On: 01/21/2010
## Author: Thell Fowler
## File: LoadModuleConfig.ps1
## Usage: Called from the NestedModules value from a module manifest.
## Version:... |
combined_dataset/train/non-malicious/scriptable telnet client_2.ps1 | scriptable telnet client_2.ps1 | function read-stream ([Parameter(Position=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
## s... |
combined_dataset/train/non-malicious/sample_40_6.ps1 | sample_40_6.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmsynthetics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmsynthetics.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_24_7.ps1 | sample_24_7.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 = '80.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/384.ps1 | 384.ps1 | Describe "Remove-PSFNull Unit Tests" -Tag "CI", "Pipeline", "Unit" {
It "Should have the designed for parameters & sets" {
(Get-Command Remove-PSFNull).ParameterSets.Name | Should -Be '__AllParameterSets'
foreach ($key in (Get-Command Remove-PSFNull).Parameters.Keys)
{
$key | Should -BeIn 'InputObject', 'Al... |
combined_dataset/train/non-malicious/sample_16_75.ps1 | sample_16_75.ps1 | #
# Module manifest for module 'Microsoft.SME.SdnManagement'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.SdnManagement.psm1'
# Version number of this module.
ModuleVersion = '3.0.45'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID us... |
combined_dataset/train/non-malicious/2862.ps1 | 2862.ps1 |
function TaskTearDown {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[scriptblock]$teardown
)
$psake.context.Peek().taskTearDownScriptBlock = $teardown
}
|
combined_dataset/train/non-malicious/sample_43_11.ps1 | sample_43_11.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... |
combined_dataset/train/non-malicious/2324.ps1 | 2324.ps1 |
Write-Log -Message 'Clearing CleanMgr.exe automation settings.'
$getItemParams = @{
Path = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\*'
Name = 'StateFlags0001'
ErrorAction = 'SilentlyContinue'
}
Get-ItemProperty @getItemParams | Remove-ItemProperty -Name StateFlags0001 -ErrorAction Si... |
combined_dataset/train/non-malicious/sample_1_1.ps1 | sample_1_1.ps1 | Import-LocalizedData -BindingVariable WMIStrings -FileName DC_WMISecurityCenter -UICulture en-us
Write-DiagProgress -Activity $WMIStrings.ID_SecurityCenter -Status $WMIStrings.ID_SecurityCenterDesc
$OutputFile = $ComputerName + "_SecurityCenter.txt"
$file = new-item -type file $OutputFile | Out-Null #_#
# Compu... |
combined_dataset/train/non-malicious/sample_49_94.ps1 | sample_49_94.ps1 | #
# Module manifest for module 'Microsoft.AzureStack.1p-Monitoring'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.AzureStack.1p-Monitoring.psm1'
# Version number of this module.
ModuleVersion = '1.62.0'
# Supported PSEditions
# CompatiblePSEditions = ... |
combined_dataset/train/non-malicious/sample_13_0.ps1 | sample_13_0.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 = '75.1.0'
# Supported P... |
combined_dataset/train/non-malicious/Get-MemberBody.ps1 | Get-MemberBody.ps1 | #Requires ILSpy.
#Tested with version 2.1.0.1603
#http://ilspy.net/
Add-Type -Path "Mono.Cecil.dll"
Add-Type -Path "ICSharpCode.Decompiler.dll"
[void][System.Reflection.Assembly]::LoadFrom("ILSpy.exe")
function Get-MemberBody
{
[CmdletBinding()]
param(
[Parameter(ParameterSetName="MI")]
[... |
combined_dataset/train/non-malicious/sample_51_29.ps1 | sample_51_29.ps1 | <#
.DESCRIPTION
Support Enter-SmePSSession to specified computer as specified username. Password will be promoted.
- Enabled by adding "%ProgramFiles%\Windows Admin Center\PowerShell\Modules" to $env:PSModulePath
#>
Function Enter-SmePSSession {
<#
.SYNOPSIS
Remote logon to PowerShell sessio... |
combined_dataset/train/non-malicious/sample_56_23.ps1 | sample_56_23.ps1 | let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl();
let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/docker.webCore.eventHandlers.js"];
let currentScriptElement = document.querySelector("script[src='Scripts/docker.webCore.plugin.js']");
if (currentScriptElement !== nu... |
combined_dataset/train/non-malicious/d62dc55e-3050-4347-8836-eb27971623ff.ps1 | d62dc55e-3050-4347-8836-eb27971623ff.ps1 | ####### Log deletions in all sites in a web application ######
############# http://iLoveSharePoint.com ##################
############## by Christian Glessner ######################
################ begin config #################
# Url of the web application to audit. Don't forget to activate the delete audi... |
combined_dataset/train/non-malicious/196.ps1 | 196.ps1 | function Test-IsLocalAdministrator
{
([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
} |
combined_dataset/train/non-malicious/sample_11_40.ps1 | sample_11_40.ps1 | ##----------------------------------------------------------------------------
## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved.
##---------------------------------------------------------------------------
# Import shared functions and vars
. .\Commonalities.ps1
. .\StringConstants.ps1
Wr... |
combined_dataset/train/non-malicious/sample_20_39.ps1 | sample_20_39.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmconfig'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmconfig.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_55_81.ps1 | sample_55_81.ps1 | # WMI-Report (20240513)
# by Gianni Bragante gbrag@microsoft.com
param( [string]$DataPath, [switch]$AcceptEula )
Function Get-WMINamespace($ns) {
Write-Host $ns
Get-WMIProviders $ns
Get-Classes $ns
Get-WmiNamespaceSecurity $ns
Get-WmiObject -namespace $ns -class "__Namespace" | sort-object Name |... |
combined_dataset/train/non-malicious/get windows product key_2.ps1 | get windows product key_2.ps1 | function get-windowsproductkey([Parameter(ValueFromPipeline=$true)][string[]]$computer)
{
PROCESS{
foreach($comp in $computer) {
$Reg = [WMIClass] ("\\\\" + $comp + "\\root\\default:StdRegProv")
$values = [byte[]]($reg.getbinaryvalue(2147483650,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion","DigitalProductId").... |
combined_dataset/train/non-malicious/VMtoolsUpgrade-disable_1.ps1 | VMtoolsUpgrade-disable_1.ps1 | #####################################################################
# TIAA-CREF VMWare Standard Scripts - PowerCLI
#
# Purpose: "Check and upgrade Tools during power cycling"
# Author: David Chung
# Support: IT Infrastructure
# Docs: N/A
#
# Instruction: 1. Create CSV file with list of servers
# ... |
combined_dataset/train/non-malicious/2892.ps1 | 2892.ps1 | task default -depends A,B
task A {
}
task B {
"inside task B before calling task C"
invoke-task C
"inside task B after calling task C"
}
task C {
}
|
combined_dataset/train/non-malicious/Get-ChilditemsRecursive.ps1 | Get-ChilditemsRecursive.ps1 | function Get-ChildItem2 ($path)
{
# path can either be absolut or relative, I only tried filesystem
# perhaps to named Get-ChildItemsRecursive
$root = gi $path
$PathLength = $root.FullName.length
# it would be nice if Split-Path could do the trick, I didn't grok it
gci $path -rec | % {
... |
combined_dataset/train/non-malicious/sample_28_16.ps1 | sample_28_16.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'ht... |
combined_dataset/train/non-malicious/sample_35_8.ps1 | sample_35_8.ps1 | #
# Module manifest for module 'OCI.PSModules.Vault'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vault.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/1852.ps1 | 1852.ps1 |
Describe "Job Cmdlet Tests" -Tag "CI" {
Context "Simple Jobs" {
BeforeEach {
$j = Start-Job -ScriptBlock { 1 + 1 } -Name "My Job"
}
AfterEach {
Get-Job | Remove-Job -Force
}
It "Start-Job produces a job object" {
$j | Should -BeOfType "Sy... |
combined_dataset/train/non-malicious/Script permissions_1.ps1 | Script permissions_1.ps1 | <#
.SYNOPSIS
Applies permissions and roles to vSphere vApps
.DESCRIPTION
Applies permissions and roles to vSphere vApps
-VIServer (Optional, defaults to Development) {FQDN of VCentre Server}
-AppName (Required) {VApp Label}
-ADGroup (Optional) {Domain\\Group_Object}
-Role (Optional) {vSphere Role, ReadO... |
combined_dataset/train/non-malicious/disabled AD accounts.ps1 | disabled AD accounts.ps1 | #Get Domain List
$objForest = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
$DomainList = @($objForest.Domains | Select-Object Name)
$Domains = $DomainList | foreach {$_.Name}
#get users list
$users = Get-Content U:\\EMCU15FI3_USER.txt
$total = $users.count
"SAMaccountname;DisplayName... |
combined_dataset/train/non-malicious/Get-ServiceAccounts_1.ps1 | Get-ServiceAccounts_1.ps1 | #requires -pssnapin PSCX
#Author: Glenn Sizemore glnsize@get-admin.com
#Purpose: Scan a remote system for any services running under a non standard account.
# Standard accounts would be considered, NT AUTHORITY\\NetworkService,
# NT AUTHORITY\\LocalService, LocalSystem, or .\\ASPNET
#... |
combined_dataset/train/non-malicious/PowerShell script config.ps1 | PowerShell script config.ps1 | #################################################
# Sample code showing how to save/load PowerShell script
# configuration to disk
#
# (c) Dmitry Sotnikov
# http://dmitrysotnikov.wordpress.com/2010/05/07/storing-powergui-add-on-configuration
#################################################
# Assign unique fol... |
combined_dataset/train/non-malicious/sample_6_77.ps1 | sample_6_77.ps1 | #************************************************
# DC_MUP-Component.ps1
# Version x
# Date: 2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about the MUP components.
# (This information has been in the SMB Client output for years, but separating it into its own file now.)
... |
combined_dataset/train/non-malicious/sample_33_28.ps1 | sample_33_28.ps1 | #
# Module manifest for module 'OCI.PSModules.Osmanagementhub'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osmanagementhub.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported P... |
combined_dataset/train/non-malicious/434.ps1 | 434.ps1 | Register-PSFTeppScriptblock -Name 'PSFramework.Utility.PathName' -ScriptBlock {
(Get-PSFConfig "PSFramework.Path.*").Name -replace '^.+\.([^\.]+)$', '$1'
} |
combined_dataset/train/non-malicious/Get-LocalGroupAllMembers.ps1 | Get-LocalGroupAllMembers.ps1 | # #############################################################################
# NAME: FUNCTION-Get-LocalGroupAllMembers.ps1
#
# AUTHOR: Francois-Xavier Cat
# DATE: 2012/12/27
# EMAIL: fxcat@lazywinadmin.com
# WEBSITE: LazyWinAdmin.com
# TWiTTER: @lazywinadm
#
# COMMENT: The following functions will ... |
combined_dataset/train/non-malicious/sample_56_26.ps1 | sample_56_26.ps1 | ConvertFrom-StringData @'
###PSLOC
ArcMachineAlreadyExistsInResourceGroupError = Arc machine(s) with names: {0} already exists in the Resource Group {1}. Use a different Resource group for registration or specify a different Arc for Servers Resource Group.
ArcMachineNotFound = No Arc machine(s) were found with the s... |
combined_dataset/train/non-malicious/998.ps1 | 998.ps1 | Param(
[parameter(Mandatory=$true)]
$CsvFilePath
)
$ErrorActionPreference = "Stop"
$scriptsPath = $PSScriptRoot
if ($PSScriptRoot -eq "") {
$scriptsPath = "."
}
. "$scriptsPath\asr_logger.ps1"
. "$scriptsPath\asr_common.ps1"
. "$scriptsPath\asr_csv_processor.ps1"
Function ProcessItemImpl($processor, $cs... |
combined_dataset/train/non-malicious/sample_51_24.ps1 | sample_51_24.ps1 | #
# Module manifest for module 'OCI.PSModules.Recovery'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Recovery.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/991.ps1 | 991.ps1 | Param(
[parameter(Mandatory=$true)]
$CsvFilePath,
$TimeOutInCommitJobInSeconds = 120
)
$ErrorActionPreference = "Stop"
$scriptsPath = $PSScriptRoot
if ($PSScriptRoot -eq "") {
$scriptsPath = "."
}
. "$scriptsPath\asr_logger.ps1"
. "$scriptsPath\asr_common.ps1"
. "$scriptsPath\asr_csv_processor.ps1"
... |
combined_dataset/train/non-malicious/4358.ps1 | 4358.ps1 | function Get-AuthenticodePublisher
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true)]
[System.Management.Automation.Signature]
$AuthenticodeSignature
)
if($AuthenticodeSignature.SignerCertificate)
{
$chain = New-Object System.Security.Cryptography.X509Certi... |
combined_dataset/train/non-malicious/sample_47_70.ps1 | sample_47_70.ps1 | <TemplateItem>
<Name>Code - Handle errors</Name>
<IconType>.svg</IconType>
<IconData>H4sIAAAAAAAACrVV224bNxB9z1ewCxSIAYrL4Z2ylQBZp0EBpw1Qp0XzpkpraRt5V1htLKdf30Ou
5EugAn1oZcHkkDNnztyoi9f3txt2V/e7pmtnBQlZsLpddMumXc2Kj9c/TELBdsO8Xc43XVvPirYr
Xr96cfHd5c/V9e8f3rLd3Yp9+Pjm6seKFZOy/E1XZXl5fcl++fUdI0Fl+fangh... |
combined_dataset/train/non-malicious/sample_2_83.ps1 | sample_2_83.ps1 | ConvertFrom-StringData @'
id_portusage=TCP Port Usage
id_portusageobtaining=Obtaining TCP/IP port usage statistics
id_ephemeralportdesc=More than %XXX% of ephemeral ports are currently in use which may cause a possible ephemeral port (outbound port) exhaustion. Please review the information collected to identify the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.