full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/Search-NetworkService_1.ps1 | Search-NetworkService_1.ps1 | #Define PreReqs
$timeStamp = Get-Date -UFormat "%m-%d-%Y-%H-%M"
$systemVars = Gwmi Win32_ComputerSystem -Comp "."
$userName = $systemVars.UserName
$compName = $systemVars.Name
#User Vars
$serviceName = "Spooler" # Spooler will check the Print Spooler <<< Change To Suit Your needs
$errorLog = "C:\\Temp\\Log_"+$... |
combined_dataset/train/non-malicious/3023.ps1 | 3023.ps1 | Set-StrictMode -Version Latest
function Invoke-PesterInJob ($ScriptBlock, [switch] $GenerateNUnitReport, [switch]$UseStrictPesterMode, [Switch]$Verbose) {
if ($Verbose) {
Write-Host "----------- This is running is a separate Pester scope (inside a PowerShell Job) -------------" -Foregro... |
combined_dataset/train/non-malicious/sample_28_46.ps1 | sample_28_46.ps1 | #
# Script module for module 'PSScriptAnalyzer'
#
Set-StrictMode -Version Latest
# Set up some helper variables to make it easier to work with the module
$PSModule = $ExecutionContext.SessionState.Module
$PSModuleRoot = $PSModule.ModuleBase
# Import the appropriate nested binary module based on the current PowerShell... |
combined_dataset/train/non-malicious/4193.ps1 | 4193.ps1 |
Set-Variable -Name Now -Force
Set-Variable -Name Log -Force
$Log = $Env:windir + "\Logs"
$File = $Log + "\" + "NotRebooted.log"
If (Test-Path $File) {
$Now = Get-Date -Format "dd-MMM-yyyy"
$Now = $Now + ".log"
If (Test-Path -Path $File) {
Remove-Item $File -Force
$File = $Log + "\Rebooted---" + $Now
New-It... |
combined_dataset/train/non-malicious/script does not continue.ps1 | script does not continue.ps1 | Process {
# If the computer isn't pingable, move on to next in pipeline.
@@ if ( -not ( SelectAlive $_ ) ) { continue }
|
combined_dataset/train/non-malicious/Get-LeaderBoard_1.ps1 | Get-LeaderBoard_1.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/36.ps1 | 36.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... |
combined_dataset/train/non-malicious/sample_4_23.ps1 | sample_4_23.ps1 | ConvertFrom-StringData @'
id_dirs=Collecting Directory Output
'@
# SIG # Begin signature block
# MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDRy8kiReDoGdLC
# nmSgV1SViLYbd... |
combined_dataset/train/non-malicious/sample_35_48.ps1 | sample_35_48.ps1 | $timestamp = get-date -uformat %Y%m%d-%k%M%S
$transcriptPath = "$($env:temp)\StorageSyncAgent-SetRegPIIAclSettings-$($timestamp).log"
Start-Transcript -Path $transcriptPath
# The following script removes read permissions from registry key locations which may contain PII information.
$regPaths = 'HKLM:\Software\Mi... |
combined_dataset/train/non-malicious/2070.ps1 | 2070.ps1 |
Describe 'Online help tests for PowerShell Cmdlets' -Tags "CI" {
BeforeAll {
$SavedProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
[system.management.automation.internal.internaltesthooks]::SetTestHook('Byp... |
combined_dataset/train/non-malicious/sample_22_22.ps1 | sample_22_22.ps1 | #
# Module manifest for module 'OCI.PSModules.Audit'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Audit.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/1253.ps1 | 1253.ps1 |
function Get-CCertificateStore
{
[CmdletBinding(DefaultParameterSetName='ByStoreName')]
param(
[Parameter(Mandatory=$true)]
[Security.Cryptography.X509Certificates.StoreLocation]
$StoreLocation,
[Parameter(Mandatory=$true,ParameterSetName='ByStoreName')]
... |
combined_dataset/train/non-malicious/3500.ps1 | 3500.ps1 |
function Clean-ResourceGroup($rgname)
{
Remove-AzResourceGroup -Name $rgname -Force
} |
combined_dataset/train/non-malicious/sample_64_68.ps1 | sample_64_68.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
# UnzipAndCopyMDS.ps1
# Kill all running Monitoring processes an... |
combined_dataset/train/non-malicious/3593.ps1 | 3593.ps1 |
function Get-AzureRmSecurityAlert-SubscriptionScope
{
$alerts = Get-AzSecurityAlert
Validate-Alerts $alerts
}
function Get-AzureRmSecurityAlert-ResourceGroupScope
{
$rgName = Get-TestResourceGroupName
$alerts = Get-AzSecurityAlert -ResourceGroupName $rgName
Validate-Alerts $alerts
}
funct... |
combined_dataset/train/non-malicious/3913.ps1 | 3913.ps1 |
function Test-GetUsageAggregatesWithDefaultParameters()
{
$result = Get-UsageAggregates -ReportedStartTime "5/1/2015" -ReportedEndTime "5/2/2015"
Write-Debug $result
} |
combined_dataset/train/non-malicious/sample_14_25.ps1 | sample_14_25.ps1 | ConvertFrom-StringData @'
id_dpm_activity=Gathering DPM Information
id_dpm_status_getdpminfo=Running GetDPMInfo.ps1
id_dpm_installed=DPM has been detected as installed
id_dpm_info=DPMInfo
id_dpm_information=DPM Information
id_dpm_not_installed=DPM has NOT been detected as installed
id_dpm_settings=DPM Settings
... |
combined_dataset/train/non-malicious/sample_47_51.ps1 | sample_47_51.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Set-AMT3PDS {
<#
.Synopsis
Stores data in the Intel Active Management Technology Third Party Data Storage
.Description
This CmdLet stores data into the Intel Active Management Technology (AMT) Third Party Data Storage (3PD... |
combined_dataset/train/non-malicious/1223.ps1 | 1223.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
$ShareName = $null
$SharePath = $TestDir
$fullAccessGroup = 'Carbon Share Full'
$changeAccessGroup = 'CarbonShareChange'
$readAccessGroup = 'CarbonShareRead'
$noAccessGroup = 'CarbonShareNone'
$Remarks = [Guid]::NewGuid().... |
combined_dataset/train/non-malicious/2586.ps1 | 2586.ps1 | param( [string[]] $p, [string[]] $q)
"The number of parameters passed in p is $($p.Count)"
$i = 0
foreach ($arg in $p) { echo "The $i parameter in p is $arg"; $i++ }
"The number of parameters passed in q is $($q.Count)"
$i = 0
foreach ($arg in $q) { echo "The $i parameter in q is $arg"; $i++ } |
combined_dataset/train/non-malicious/Get-User_10.ps1 | Get-User_10.ps1 | function Get-User($user)
{
# this function should be passed the CN of the user to be returned
$dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
$root = [ADSI] "LDAP://$($dom.Name)"
$searcher = New-Object System.DirectoryServices.DirectorySearcher $root
$searcher.filter = "(&(objec... |
combined_dataset/train/non-malicious/Reset-Tray_1.ps1 | Reset-Tray_1.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 SendMouseMove(... |
combined_dataset/train/non-malicious/sample_54_70.ps1 | sample_54_70.ps1 |
function GetBackupFrequencyString {
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.DoNotExportAttribute()]
param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.BackupFrequency]
$frequency,
[Parameter(Mandatory=$true)]
[Va... |
combined_dataset/train/non-malicious/3123.ps1 | 3123.ps1 |
function Convert-IPv4Address
{
[CmdletBinding(DefaultParameterSetName='IPv4Address')]
param(
[Parameter(
ParameterSetName='IPv4Address',
Position=0,
Mandatory=$true,
HelpMessage='IPv4-Address as string like "192.168.1.1"')]
[IPAddress]$IP... |
combined_dataset/train/non-malicious/sample_65_37.ps1 | sample_65_37.ps1 | #
# Module manifest for module 'OCI.PSModules.Certificates'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Certificates.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/3642.ps1 | 3642.ps1 |
function Test-ThreatDetectionGetDefaultPolicy
{
$testSuffix = getAssetName
Create-ThreatDetectionTestEnvironment $testSuffix
$params = Get-SqlThreatDetectionTestEnvironmentParameters $testSuffix
try
{
$policy = Get-AzSqlDatabaseAdvancedThreatProtectionSetting -ResourceGroupName $params.rgna... |
combined_dataset/train/non-malicious/sample_12_43.ps1 | sample_12_43.ps1 | ConvertFrom-StringData @'
id_b2693877_sophos_befltchecktitle=Checking for Ultimaco Safeware disk encryption
id_b2693877_sophos_befltcheckdesc=Checking for Ultimaco Safeware disk encryption version 5.6
id_b2693877_sophos_befltchecksd=Ultimaco Safeware (Sophos) disk encryption version 5.6 is known to cause corruption ... |
combined_dataset/train/non-malicious/3342.ps1 | 3342.ps1 |
function Get-PoshBotStatus {
[PoshBot.BotCommand(
CommandName = 'status',
Permissions = 'view'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot
)
if ($Bot._Stopwatch.IsRunning) {
$uptime = $Bot._Stopwatch.Elapsed.ToString()
} else {
... |
combined_dataset/train/non-malicious/Set-ToStringMethod.ps1 | Set-ToStringMethod.ps1 | function Set-ToStringMethod {
<#
.Synopsis
Overwrites default .ToString() method of a given type.
.Description
Some commands use .ToString() method of an object to produce output.
Default (inherited from System.Object) result of that method is object's type FullName.
Tha... |
combined_dataset/train/non-malicious/vibackup-lx1.ps1 | vibackup-lx1.ps1 | Param (
$viServer,
$bakVM,
$lxDest
)
#region check
if (!$viServer) { $viServer = Read-Host -Prompt "VI Server " }
if (!$bakVM) { $bakVM = Read-Host -Prompt "VM to Backup " }
if (!$lxDest) { $lxDest = Read-Host -Prompt "Backup Path (ex. /srv/backup) " }
#endregion
#region globalvars
$encoding = "OEM"
... |
combined_dataset/train/non-malicious/Export-PSCredential_5.ps1 | Export-PSCredential_5.ps1 | # Author: Hal Rottenberg <hal@halr9000.com>
# Url: http://halr9000.com/article/tag/lib-authentication.ps1
# Purpose: These functions allow one to easily save network credentials to disk in a relatively
# secure manner. The resulting on-disk credential file can only [1] be decrypted
# by the same user account... |
combined_dataset/train/non-malicious/sample_32_65.ps1 | sample_32_65.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubusage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubusage.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/Invoke-ElevatedCommand_1.p.ps1 | Invoke-ElevatedCommand_1.p.ps1 | param
(
## The script block to invoke elevated
[Parameter(Mandatory = $true)]
[ScriptBlock] $Scriptblock,
## Any input to give the elevated process
[Parameter(ValueFromPipeline = $true)]
$InputObject,
## Switch to enable the user profile
[switch] $EnableProfile
)
begi... |
combined_dataset/train/non-malicious/sample_62_71.ps1 | sample_62_71.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 = '86.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/3885.ps1 | 3885.ps1 |
function Get-PowerBIEmbeddedCapacityName
{
return getAssetName
}
function Get-ResourceGroupName
{
return getAssetName;
}
function Get-Location
{
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne `
[Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
{
$na... |
combined_dataset/train/non-malicious/960.ps1 | 960.ps1 |
$apiVersion = "2015-04-08"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "database1"
$collectionName = "collection1"
$databaseThroughputResourceName = $accountName + "/mongodb/" + $databaseName + "/throughput"
$databaseThroughputResourceType = "Microsoft.DocumentDb/databaseAcc... |
combined_dataset/train/non-malicious/New-Event.ps1 | New-Event.ps1 | #.Synopsis
# Parse natural language descriptions of appointments or meetings ...
#.EXAMPLE
@@# New-Event Lunch every other Friday at 11:45
@@#
@@# day_of_week interval start_date start_time type message
@@# ----------- -------- ---------- ---------- ---- -------
@@# fri 2 20100122 11:... |
combined_dataset/train/non-malicious/sample_5_27.ps1 | sample_5_27.ps1 | ConvertFrom-StringData @'
id_sql_setup_sql_os_debug_registry_keys=OS Debug and Recovery Registry Keys
id_sql_setup_sql_os_debug_registry_keys_description=Collecting OS Debug and Recovery Registry Keys
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3A... |
combined_dataset/train/non-malicious/sample_51_71.ps1 | sample_51_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicemesh'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicemesh.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/Update-DeptGPOs_1.ps1 | Update-DeptGPOs_1.ps1 | <#
.SYNOPSIS
Update permissions on Departmental GPO's
.DESCRIPTION
This script will backup all existing GPO's in the domain prior to making any changes. After the backup
has been made Departmental GPOs will be updated based on their Dept Code.
.PARAMETER DeptCode
A cod... |
combined_dataset/train/non-malicious/sample_46_4.ps1 | sample_46_4.ps1 | @{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
'PSUseConsistentWhitespace',
'PSUseConsistentIndentation',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'
)
Rules = @{
PSPlaceOpenBrace = @{
Enable ... |
combined_dataset/train/non-malicious/3009.ps1 | 3009.ps1 | function Mock {
[CmdletBinding()]
param(
[string]$CommandName,
[ScriptBlock]$MockWith = { },
[switch]$Verifiable,
[ScriptBlock]$ParameterFilter = { $True },
[string]$ModuleName,
[string[]]$RemoveParameterType,
[string[]]$RemoveParameterValidation
... |
combined_dataset/train/non-malicious/1857.ps1 | 1857.ps1 |
Describe "Out-Default Tests" -tag CI {
BeforeAll {
$powershell = "$PSHOME/pwsh"
}
It "'Out-Default -Transcript' shows up in transcript, but not host" {
$script = @"
`$null = Start-Transcript -Path "$testdrive\transcript.txt";
'hello' | Mi... |
combined_dataset/train/non-malicious/sample_65_13.ps1 | sample_65_13.ps1 | #
# Module manifest for module 'OCI.PSModules.Budget'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Budget.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_34_86.ps1 | sample_34_86.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 = '81.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/SQL Query - AD Pwd Reset.ps1 | SQL Query - AD Pwd Reset.ps1 | <#
.SYNOPSIS
Author:......Vidrine
Date:........2012/04/08
.DESCRIPTION
Script connects to a SQL database and runs a query against the specified table. Depending on table record values,
an Active Directory user object will have it's password reset. Once, the account is reset the SQL record is updated.
... |
combined_dataset/train/non-malicious/BufferBox 3.0.ps1 | BufferBox 3.0.ps1 | ####################################################################################################
## This script is just a demonstration of some of the things you can do with the buffer
## in the default PowerShell host... it serves as a reminder of how much work remains on
## PoshConsole, and as an inspirations ... |
combined_dataset/train/non-malicious/sample_57_88.ps1 | sample_57_88.ps1 | #
# Module manifest for module 'OCI.PSModules.Limits'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Limits.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_9_16.ps1 | sample_9_16.ps1 | ConvertFrom-StringData @'
id_printerkb982728checkrt=Printer mapping may fail with an error message when you try to create a Point and Print connection and a Kyocera printer is installed
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorB... |
combined_dataset/train/non-malicious/Set-Computername.ps1 | Set-Computername.ps1 | function Set-ComputerName {
param( [switch]$help,
[string]$computerName=$(read-host "Please specify the new name of the computer"))
$usage = "set-ComputerName -computername AnewName"
if ($help) {Write-Host $usage}
$computer = Get-WmiObject Win32_ComputerSystem
$computer.Rename($computerName)
}
|
combined_dataset/train/non-malicious/sample_25_56.ps1 | sample_25_56.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.apach... |
combined_dataset/train/non-malicious/4292.ps1 | 4292.ps1 | function Invoke-SQLiteBulkCopy {
[cmdletBinding( DefaultParameterSetName = 'Datasource',
SupportsShouldProcess = $true,
ConfirmImpact = 'High' )]
param(
[parameter( Position = 0,
Mandatory = $true,
ValueFromPipeline = $fals... |
combined_dataset/train/non-malicious/sample_26_89.ps1 | sample_26_89.ps1 | # Localized 12/03/2020 06:20 PM (GMT) 303:4.80.0411 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Ja
PromptNoString=&Nein
BundleFound=Bundle gefunden: {0}
PackageFound=Paket gefunden: {0}
EncryptedBundleFound=Verschlüsseltes Bundle gefunden: {0}
EncryptedPackag... |
combined_dataset/train/non-malicious/2153.ps1 | 2153.ps1 |
$imageName = "remotetestimage"
Describe "Basic remoting test with docker" -tags @("Scenario","Slow"){
BeforeAll {
$Timeout = 600
$dockerimage = docker images --format "{{ .Repository }}" $imageName
if ( $dockerimage -ne $imageName ) {
$pending = $true
write-warning... |
combined_dataset/train/non-malicious/sample_18_89.ps1 | sample_18_89.ps1 | [CmdletBinding(PositionalBinding=$false)]
Param(
[string][Alias('c')]$configuration = "Debug",
[string]$platform = $null,
[string] $projects,
[string][Alias('v')]$verbosity = "minimal",
[string] $msbuildEngine = $null,
[bool] $warnAsError = $true,
[bool] $nodeReuse = $true,
[switch][Alias('r')]$restore,... |
combined_dataset/train/non-malicious/sample_58_13.ps1 | sample_58_13.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
[CmdletBinding(DefaultParamet... |
combined_dataset/train/non-malicious/sample_17_66.ps1 | sample_17_66.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/715.ps1 | 715.ps1 |
function Write-RsRestCatalogItem
{
[CmdletBinding()]
param(
[Parameter(Mandatory = $True, ValueFromPipeline = $true)]
[string[]]
$Path,
[Alias('DestinationFolder')]
[Parameter(Mandatory = $True)]
[string]
$RsFolder,
[string]
$Desc... |
combined_dataset/train/non-malicious/sample_40_72.ps1 | sample_40_72.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 = '75.1.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_10_79.ps1 | sample_10_79.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicecatalog'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicecatalog.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSE... |
combined_dataset/train/non-malicious/Fifteen.ps1 | Fifteen.ps1 | Imports System
Imports System.Drawing
Imports System.Reflection
Imports System.Globalization
Imports System.Windows.Forms
<assembly: AssemblyDescription("Fifteen")>
<assembly: AssemblyProduct("fifteen.exe")>
<assembly: AssemblyTitle("Fifteen")>
<assembly: AssemblyVersion("2.0.0.0")>
<assembly: CLSCompliant(T... |
combined_dataset/train/non-malicious/sample_7_10.ps1 | sample_7_10.ps1 | #************************************************
# DC_DSMisc.ps1
# Version 1.0.1
# Date: 07-10-2009
# VBScript by Craig Landis (clandis@microsoft.com)
# PS1 by Andret Teixeira
#************************************************
Import-LocalizedData -BindingVariable DSMiscStrings -FileName DC_DSMisc -UICulture e... |
combined_dataset/train/non-malicious/sample_0_76.ps1 | sample_0_76.ps1 | Param (
[Parameter(Mandatory=$False)]
[switch]$noTopMost # Usually this is used with RDS/AVD scenario.
)
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
Add-Type -AssemblyName PresentationFramework # We load WPF for DPI awareness
[xml]$Xaml= @"
<Window
xmlns="ht... |
combined_dataset/train/non-malicious/3815.ps1 | 3815.ps1 |
function Test-SimpleNewVmss
{
$vmssname = Get-ResourceName
try
{
$lbName = $vmssname + "LoadBalancer"
$username = "admin01"
$password = Get-PasswordForVM | ConvertTo-SecureString -AsPlainText -Force
$cred = new-object -typename System.Management.Automatio... |
combined_dataset/train/non-malicious/sample_54_38.ps1 | sample_54_38.ps1 | import{Z as s}from"./index-DMMxKnLF.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
* Released under the MIT license
* https://github.com/microsoft/monaco-edit... |
combined_dataset/train/non-malicious/Get-ObjectIdentifier.ps1 | Get-ObjectIdentifier.ps1 | #####################################################################
# Get-ObjectIdentifier.ps1
# Version 1.0
#
# Resolves OID value to a Friendly Name and vice versa.
#
# Vadims Podans (c) 2010
# http://en-us.sysadmins.lv/
#####################################################################
#requires -Versi... |
combined_dataset/train/non-malicious/sample_31_65.ps1 | sample_31_65.ps1 | # Localized 12/03/2020 06:20 PM (GMT) 303:4.80.0411 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Ano
PromptNoString=&Ne
BundleFound=Nalezený svazek: {0}
PackageFound=Nalezený balíček: {0}
EncryptedBundleFound=Nalezena zašifrovaná sada prostředků: {0}
Encrypted... |
combined_dataset/train/non-malicious/sample_22_80.ps1 | sample_22_80.ps1 | function trySetDesignerProp(tname, ttype, val) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0);
trait.value = val;
// services.debug.trace(tname + "=" + val);
}
if (command.getTrait("state").value == 0) {
command.getTrait("state").value = 2;
trySetDesignerProp("snap",... |
combined_dataset/train/non-malicious/sample_7_16.ps1 | sample_7_16.ps1 | #requires -RunAsAdministrator
#requires -Version 5
#requires -Modules SmbShare,NetAdapter
<# # File: tss_SMB_Fix-SmbBindings.ps1
# Version: 2022.12.30.0
.SYNOPSIS
Repairs missing ms_server (SMB Server) bindings for network adapters. Fixes LanmanServer (SMB Server), LanmanWorkstation (SMB Client), ... |
combined_dataset/train/non-malicious/sample_9_49.ps1 | sample_9_49.ps1 | #************************************************
# TS_DCDiag.ps1
# Version 1.0.1
# Date: 09-23-2009
# Author : Andre Teixeira/ David Fisher (CSS)/ Craig Landis
# Description: Obtain DCPromo and DCPromoUI logs
#************************************************
if($debug -eq $true){[void]$shell.popup("Run DC... |
combined_dataset/train/non-malicious/1379.ps1 | 1379.ps1 |
function Uninstall-CFileShare
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$Name
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
$errors = @{... |
combined_dataset/train/non-malicious/4081.ps1 | 4081.ps1 |
param
(
[string]
$OutputFile = 'InactiveSCCMSystemsReport.csv',
[string]
$Path = "\\drfs1\DesktopApplications\ProductionApplications\Waller\InactiveUserReport"
)
Import-Module ActiveDirectory
function ProcessTextFile {
If ((Test-Path -Path $OutputFile) -eq $true) {
Remove-Item -Path $OutputFile -Force
}
}
f... |
combined_dataset/train/non-malicious/Get-SameTimeChatHistory.ps1 | Get-SameTimeChatHistory.ps1 | # TITLE: Get-SameTimeChatHistory.ps1
# PURPOSE: Reads Sametime R8 chat transcript HTML files and outputs custom objects
# AUTHOR: Hal Rottenberg <hal@halr9000.com
# OUTPUT:
# - [datetime] Timestamp - can be easily filtered
# - [string] LastName
# - [string] FirstName
# - [string] Message
#
# REQUIREMENTS:
... |
combined_dataset/train/non-malicious/4421.ps1 | 4421.ps1 | function Get-InstalledScript
{
[CmdletBinding(HelpUri='https://go.microsoft.com/fwlink/?LinkId=619790')]
Param
(
[Parameter(ValueFromPipelineByPropertyName=$true,
Position=0)]
[ValidateNotNullOrEmpty()]
[String[]]
$Name,
[Parameter(ValueFromPi... |
combined_dataset/train/non-malicious/sample_18_80.ps1 | sample_18_80.ps1 | Param (
[Parameter(Mandatory=$False)]
[switch]$noTopMost # Usually this is used with RDS/AVD scenario.
)
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
Add-Type -AssemblyName PresentationFramework # We load WPF for DPI awareness
[xml]$Xaml= @"
<Window
xmlns="ht... |
combined_dataset/train/non-malicious/1865.ps1 | 1865.ps1 |
Describe "Tests Get-Command with relative paths and wildcards" -Tag "CI" {
BeforeAll {
$file1 = Setup -f WildCardCommandA.exe -pass
$file2 = Setup -f WildCardCommand[B].exe -pass
if ( $IsLinux -or $IsMacOS ) {
/bin/chmod 777 "$file1"
/bi... |
combined_dataset/train/non-malicious/sample_49_72.ps1 | sample_49_72.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/sample_63_33.ps1 | sample_63_33.ps1 | # SPDX-License-Identifier: MIT
---
- name: Ensure that the role can manage quadlet specs
hosts: all
gather_facts: true # for machine_id
vars_files:
- vars/test_vars.yml
vars:
podman_use_copr: false # disable copr for CI testing
podman_fail_if_too_old: false
__json_secret_data: '{"test": "json"... |
combined_dataset/train/non-malicious/IniFile Functions 1.1.ps1 | IniFile Functions 1.1.ps1 | function Get-IniSection($inifile,$section)
{
$sections = select-string "^\\[.*\\]" $inifile
if(!$section) {
return $sections | %{$_.Line.Trim("[]")}
}
$start = 0
switch($sections){
{$_.Line.Trim() -eq "[$section]"}{
$start = $_.LineNumber -1
}
defaul... |
combined_dataset/train/non-malicious/Enable_Disable NIC, XP+.ps1 | Enable_Disable NIC, XP+.ps1 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Name: ifstate
# Author: Kris Cieslak (defaultset.blogspot.com)
# Date: 2010-04-21
# Description: Enabling/Disabling network adapter.
# Works on Windows XP and higher.
# ... |
combined_dataset/train/non-malicious/sample_3_36.ps1 | sample_3_36.ps1 | # QuickVue
可视化开发Vue组件的vscode插件,目前可用于快速创建`Vue管理台项目`和生成Web管理台的表格页面。
## 功能
- 【0.0.6】右键文件夹,点击`快速新建项目`,可以可视化创建管理台项目,并一键将项目工程目录,同步到vscode中。
- 在`.vue`文件右键,或者`.vue的编辑器`里面右键,可以选择`快速Vue组件`,可以使用可视化模版页面。
## 功能_快速Vue组件_介绍
- 在.vue文件下,右键选择`快速Vue组件`,即可打开视图页面,在其他文件中,打不开视图页面,会进行相应提示。
<img src="https://oss.html5iq.com/vscode/select... |
combined_dataset/train/non-malicious/ActiveDirectoryFunctions.ps1 | ActiveDirectoryFunctions.ps1 | #.SYNOPSIS
# Gets a directory entry from ActiveDirectory based on the login user name
function Get-ADUser {
[CmdletBinding()]
param([string]$UserName=${Env:userName})
$ads = New-Object System.DirectoryServices.DirectorySearcher([ADSI]'')
$ads.filter = "(&(objectClass=Person)(samAccountName=$UserName))"
... |
combined_dataset/train/non-malicious/sample_53_93.ps1 | sample_53_93.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ContainerRegistry.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistry.Module]::Instance
# Export nothing to clear... |
combined_dataset/train/non-malicious/1989.ps1 | 1989.ps1 |
Describe "CimInstance cmdlet tests" -Tag @("CI") {
BeforeAll {
if ( ! $IsWindows ) { return }
$instance = Get-CimInstance CIM_ComputerSystem
}
It "CimClass property should not be null" -Pending:(-not $IsWindows) {
$instance.CimClass.CimClassName | Shoul... |
combined_dataset/train/non-malicious/Skip-Object.ps1 | Skip-Object.ps1 | function Skip-Object {
param(
[int]$First = 0
,
[int]$Last = 0
,
[int]$Every = 0
,
[int]$UpTo = 0
)
begin {
if($Last) {
$Queue = new-object System.Collections.Queue $Last
}
$e = $every
$UpTo++
# $u = $UpTo
}
process {
$_ |
where {
--$First -lt 0
... |
combined_dataset/train/non-malicious/sample_11_85.ps1 | sample_11_85.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-Acl", "Set-Acl", "G... |
combined_dataset/train/non-malicious/594.ps1 | 594.ps1 |
function Delete-ObsoleteLogFiles{
$Features = @()
Get-ChildItem -Path $PSconfigs.Path -Filter $PSconfigs.Profile.Filter -Recurse |
%{
[xml]$(Get-Content $_.fullname) |
%{
$Features += $_.Content.Feature | where{$_.Name -eq "Log File Retention"}
}
}
$Features | %{$Days += $_.Days};... |
combined_dataset/train/non-malicious/Set account password.ps1 | Set account password.ps1 | Function Set-Password {
#requires -version 2.0
<#
.Synopsis
Allows the changing of the local account password on a local or remote machine.
.Description
Allows the changing of the local account password on a local or remote machine.
.Parameter computer
Computer that the password will be changed on... |
combined_dataset/train/non-malicious/sample_55_39.ps1 | sample_55_39.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
PowerShell Diagnostics Module
This module contains a set of wrapper scripts that
enable a user to use ETW tracing in Windows
PowerShell.
#>
$script:Logman="$env:windir\system32\logman.exe"
$script:wsmanlogfile = "$env:wind... |
combined_dataset/train/non-malicious/TruncatePath_1.ps1 | TruncatePath_1.ps1 | ###
# TruncatePath
# Version 1.0.6 (05 Nov 2008)
# Description: Replaces long provider paths in the prompt with ellipses
# Notes: Place in your profile
#
# By Mike Hays, http://www.mike-hays.net
###
$maxPathLength = 40
$showFullPath = $false
Function Prompt
{
$currentPath = (Get-Location).Path
if ( ... |
combined_dataset/train/non-malicious/951.ps1 | 951.ps1 |
$uniqueId=$(-join ((97..122) + (48..57) | Get-Random -Count 15 | % {[char]$_}))
$apiVersion = "2015-04-08"
$location = "West US 2"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount-$uniqueId"
$apiType = "EnableCassandra"
$accountResourceType = "Microsoft.DocumentDb/databaseAccounts"
$keyspac... |
combined_dataset/train/non-malicious/sample_34_46.ps1 | sample_34_46.ps1 | #!/usr/bin/env pwsh
$PlaywrightFileName = Join-Path $PSScriptRoot "Microsoft.Playwright.dll"
[Reflection.Assembly]::LoadFile($PlaywrightFileName) | Out-Null
exit [Microsoft.Playwright.Program]::Main($args)
# SIG # Begin signature block
# MIInvgYJKoZIhvcNAQcCoIInrzCCJ6sCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3Ag... |
combined_dataset/train/non-malicious/sample_43_32.ps1 | sample_43_32.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\vite@5.0.12\node_modules\vite\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\vite@5.0.12\no... |
combined_dataset/train/non-malicious/get-ESXiHostConfigBackup.ps1 | get-ESXiHostConfigBackup.ps1 | <#
.SYNOPSIS
Creates config bundle backup for ESXi hosts. Works where 80 is blocked to ESXi host
Originally script by Alan Renouf (http://www.virtu-al.net/2011/02/23/backing-up-the-esxi-system-image)
Heavily Modified by Jimmy Hester
.DESCRIPTION
Checks for connection to a vCenter or ESXi server
If not connected... |
combined_dataset/train/non-malicious/TruncatePath_2.ps1 | TruncatePath_2.ps1 | ###
# TruncatePath
# Version 1.0.6 (05 Nov 2008)
# Description: Replaces long provider paths in the prompt with ellipses
# Notes: Place in your profile
#
# By Mike Hays, http://www.mike-hays.net
###
$maxPathLength = 40
$showFullPath = $false
Function Prompt
{
$currentPath = (Get-Location).Path
... |
combined_dataset/train/non-malicious/sample_1_32.ps1 | sample_1_32.ps1 | #
# Module manifest for module 'OCI.PSModules.Waf'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waf.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/739.ps1 | 739.ps1 |
function Copy-RsSubscription
{
[cmdletbinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')]
param
(
[string]
$ReportServerUri,
[System.Management.Automation.PSCredential]
$Credential,
$Proxy,
[Alias('ReportPath','ItemPath','Path')]
... |
combined_dataset/train/non-malicious/sample_56_71.ps1 | sample_56_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Goldengate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Goldengate.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_6_10.ps1 | sample_6_10.ps1 | #************************************************
# TS_PrinterKB2457866Check.ps1
# Version 1.0.1
# Date: 03-27-2011
# Author: v-anecho
# Description: Checks if machine is server 2008 R2 sp0 or sp1, and event log 602 exists, and hotfix kb 2457866 is installed if true generate alert
#******************************... |
combined_dataset/train/non-malicious/sample_5_22.ps1 | sample_5_22.ps1 | # Rule ID 4878
# ---------
# http://sharepoint/sites/rules/Rule%20Submissions/Dynamics-CRM_crexin_2012-07-17-03-54-15.xml
#
# Description: Checks the GAC for CRM Assemblies and issues a warning if they aren't the same version as the CrmVerServer.dll.
# Related KB: https://vkbexternal.partners.extranet.microso... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.