full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/WPF PingMonitor for 1.0.ps1 | WPF PingMonitor for 1.0.ps1 | if(!(Get-Command New-BootsWindow -EA SilentlyContinue)) {
Add-PsSnapin PoshWpf
#Import-Module PowerBoots
#Add-BootsContentProperty 'DataPoints', 'Series'
[Void][Reflection.Assembly]::LoadFrom( (Convert-Path (Resolve-Path "~\\Documents\\WindowsPowershell\\Libraries\\WPFVisifire.Charts.dll")) )
#Add-B... |
combined_dataset/train/non-malicious/2dbab092-67c9-4604-993a-656847e35f4b.ps1 | 2dbab092-67c9-4604-993a-656847e35f4b.ps1 | function Run-Script {
if ($psISE.CurrentFile.DisplayName.StartsWith("Untitled")) {
return
}
$script = $psISE.CurrentFile.DisplayName
$psISE.CurrentFile.Save()
$logfile = "$env:programfiles\\Sea Star Development\\" +
"Script Monitor Service\\ScriptMon.txt" #Change t... |
combined_dataset/train/non-malicious/836.ps1 | 836.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/Set-OutlookSignature_1.ps1 | Set-OutlookSignature_1.ps1 | ###########################################################################"
#
# NAME: Set-OutlookSignature.ps1
#
# AUTHOR: Jan Egil Ring
#
# COMMENT: Script to create an Outlook signature based on user information from Active Directory.
# Adjust the variables in the "Custom variables"-section
# ... |
combined_dataset/train/non-malicious/sample_17_15.ps1 | sample_17_15.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/3176.ps1 | 3176.ps1 | function Get-ScheduledTasks {
[cmdletbinding(
DefaultParameterSetName='COM'
)]
param(
[parameter(
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
ValueFromRemainingArguments=$false,
Position=0
)]
[Alias(... |
combined_dataset/train/non-malicious/sample_33_65.ps1 | sample_33_65.ps1 | enum Ensure
{
Present
Absent
}
[DscResource()]
class JeaEndpoint
{
## The optional state that ensures the endpoint is present or absent. The defualt value is [Ensure]::Present.
[DscProperty()]
[Ensure] $Ensure = [Ensure]::Present
## The mandatory endpoint name. Use 'Microsoft.Powe... |
combined_dataset/train/non-malicious/MVP PowerShell.ps1 | MVP PowerShell.ps1 | # (C) 2012 Dr. Tobias Weltner, MVP PowerShell
# www.powertheshell.com
# you can freely use and distribute this code
# we only ask you to keep this comment including copyright and url
# as a sign of respect.
# more information and documentation found here:
# http://www.powertheshell.com/iseconfig/
<#
.SYN... |
combined_dataset/train/non-malicious/828.ps1 | 828.ps1 |
$cred = Get-Credential
New-AzVmss `
-ResourceGroupName "myResourceGroup" `
-VMScaleSetName "myScaleSet" `
-Location "EastUS" `
-VirtualNetworkName "myVnet" `
-SubnetName "mySubnet" `
-PublicIpAddressName "myPublicIPAddress" `
-LoadBalancerName "myLoadBalancer" `
-UpgradePolicyMode "Automatic" `
-... |
combined_dataset/train/non-malicious/sample_23_81.ps1 | sample_23_81.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
param(
[ValidateSet('Hang', 'Fail')]
$TestHook
)
$waitTimeoutSeconds = 300
switch ($TestHook) {
'Hang' {
$waitTimeoutSeconds = 10
$jobScript = { Start-Sleep -Seconds 600 }
}
'Fail' {
$jo... |
combined_dataset/train/non-malicious/3836.ps1 | 3836.ps1 |
function EventSubscriptionTests_CustomTopic {
$subscriptionId = Get-SubscriptionId
$location = Get-LocationForEventGrid
$topicName = Get-TopicName
$eventSubscriptionName = Get-EventSubscriptionName
$eventSubscriptionName2 = Get-EventSubscriptionName
$eventSubscriptionName3 = ... |
combined_dataset/train/non-malicious/2204.ps1 | 2204.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed.")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMess... |
combined_dataset/train/non-malicious/2347.ps1 | 2347.ps1 |
function Get-DisabledGpo
{
[OutputType([pscustomobject])]
[CmdletBinding()]
param ()
begin
{
$ErrorActionPreference = 'Stop'
}
process
{
try
{
@(Get-GPO -All).where({ $_.GpoStatus -like '*Disabled' }).foreach({
[pscustomobject]@{
Name = $_.DisplayName
DisabledSettingsCategory = ([s... |
combined_dataset/train/non-malicious/sample_21_20.ps1 | sample_21_20.ps1 | <#
# .DESCRIPTION
# Download and install Microsoft Monitoring Agent for Windows.
#
# .PARAMETER workspaceId
# The log analytics workspace id a target node has to connect to.
#
# .PARAMETER workspacePrimaryKey
# The primary key of log analytics workspace
#
#>
$ErrorActionPreference = "Stop"
# i... |
combined_dataset/train/non-malicious/sample_26_87.ps1 | sample_26_87.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/sample_53_26.ps1 | sample_53_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/3861.ps1 | 3861.ps1 |
function NewDirectConnectionV4V6($facilityId,$bandwidth)
{
Write-Debug "Creating Connection at $facilityId"
$md5 = getHash
$md5 = $md5.ToString()
Write-Debug "Created Hash $md5"
$rand1 = Get-Random -Maximum 20 -Minimum 3
$rand2 = Get-Random -Maximum 200 -Minimum 1
$sessionv4 = newIpV4Address $true ... |
combined_dataset/train/non-malicious/3562.ps1 | 3562.ps1 |
$seed = "98"
function getVaultName{
return "A2APowershellTest" + $seed;
}
function getVaultRg{
return "A2APowershellTestRg" + $seed;
}
function getVaultRgLocation{
return "eastus"
}
function getVaultLocation{
return "eastus"
}
function getPrimaryLocation
{
return "westus"
}
... |
combined_dataset/train/non-malicious/sample_8_28.ps1 | sample_8_28.ps1 | #************************************************
# DC_ClusterDependencyReport.ps1
# Version 1.0.1
# Date: 07-23-2009
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script is used to obtain cluster resource dependency report
#************************************************
Import-Localize... |
combined_dataset/train/non-malicious/4362.ps1 | 4362.ps1 | function Test-WildcardPattern
{
[CmdletBinding()]
[OutputType([bool])]
param(
[Parameter(Mandatory=$true)]
[ValidateNotNull()]
$Name
)
return [System.Management.Automation.WildcardPattern]::ContainsWildcardCharacters($Name)
} |
combined_dataset/train/non-malicious/381c5978-c4cc-421e-9c0f-9ac6d9e14e61.ps1 | 381c5978-c4cc-421e-9c0f-9ac6d9e14e61.ps1 | <#
NAME: WLAN-functions.ps1
AUTHOR: Jan Egil Ring
EMAIL: jan.egil.ring@powershell.no
COMMENT: PowerShell functions to export and import WLAN profiles in Windows Vista/Windows 7
Required version: Windows PowerShell 2.0 (built-in to Windows 7)
Usage: Either copy the functions directly into... |
combined_dataset/train/non-malicious/sample_10_51.ps1 | sample_10_51.ps1 | ConvertFrom-StringData @'
id_w32timeoutput=W32Time
id_w32timeobtaining=Gathering W32Time information
'@
# SIG # Begin signature block
# MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlA... |
combined_dataset/train/non-malicious/sample_46_93.ps1 | sample_46_93.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/Security group monitor_1.ps1 | Security group monitor_1.ps1 | #Get group membership for a list of security
#groups and export to an XML for comparison
#against baseline.
#
$script:WorkingDirectory = split-path $myinvocation.Mycommand.Definition -parent
Function Re-Baseline
{
#First, declare array and hashtable.
$securitygroups = @()
$table = @{}
#Import Security... |
combined_dataset/train/non-malicious/sample_16_12.ps1 | sample_16_12.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=Das erforderliche PowerShell-Modul (FailoverClusters) wurde nicht gefunden. Installieren Sie es mit dem Tool „Rollen und Funktionen“: Remoteserver-Verwaltungstools | Featureverwaltungstools | Failoverclustering-Tools | Failoverclustermodul für Windows PowerShell... |
combined_dataset/train/non-malicious/sample_64_28.ps1 | sample_64_28.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_42_94.ps1 | sample_42_94.ps1 | #
# Module manifest for module 'OCI.PSModules.Devops'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Devops.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/Email attachments.ps1 | Email attachments.ps1 | $file = "MYFILE.TXT"
$smtpServer = "MYSMTPSERVER.EMAIL.CO.UK"
$msg = new-object Net.Mail.MailMessage
$att = new-object Net.Mail.Attachment($file)
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = "FROMME@EMAIL.CO.UK"
$msg.To.Add("TOME@EMAIL.CO.UK")
$msg.Subject = "MY SUBJECT"
$msg.Body = "MY... |
combined_dataset/train/non-malicious/863.ps1 | 863.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests', ''
. "$here\$sut"
$httpUserPassword = $ENV:HttpPassword
$location = $ENV:Location
$securePassword = ConvertTo-SecureString $httpUserPassword -AsPlainText -Force
$loginCreds = New-Object ... |
combined_dataset/train/non-malicious/3627.ps1 | 3627.ps1 |
function Test-CreateManagedDatabase
{
$rg = Create-ResourceGroupForTest
$vnetName = "cl_initial"
$subnetName = "Cool"
$virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $rg.Location
$subnetId = $virtualNetwork1.Subnets.where({ $_.Name -eq $subnetName })[0].Id
... |
combined_dataset/train/non-malicious/1156.ps1 | 1156.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldGetUser
{
Get-WmiObject Win32_UserAccount -Filter "Domain='$($env:ComputerName)'" | ForEach-Object {
$user = Get-WmiLocalUserAccount -Username $_.Name
... |
combined_dataset/train/non-malicious/sample_4_35.ps1 | sample_4_35.ps1 | #************************************************
# TS_GPPDelolyPrinterFailureCheck.ps1
# Version 1.0.1
# Date: 3/14/2013
# Author: V-maam
# Description: [Idea ID 6863] [Windows] GPP printer fails to be added since LocalEnumForms returns error 8007007a
# Rule number: 6863
# Rule URL: http://sharepoint/sites/r... |
combined_dataset/train/non-malicious/Start-IRCJabberBridge.ps1 | Start-IRCJabberBridge.ps1 | ##########################################################################################
## Depends on the PsXmppHelper.dll from http://CodePlex.com/PowerXmpp
## CONTAINS Read-HostMasked http://powershellcentral.com/scripts/104
## CONTAINS Out-Working http://powershellcentral.com/scripts/105
#####################... |
combined_dataset/train/non-malicious/sample_26_98.ps1 | sample_26_98.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydataplane.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Support... |
combined_dataset/train/non-malicious/sample_67_53.ps1 | sample_67_53.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerengine'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerengine.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_59_8.ps1 | sample_59_8.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplace'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplace.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_30_13.ps1 | sample_30_13.ps1 | # Copyright (C) Intel Corporation, 2021 All Rights Reserved.
function Invoke-ConfigureTLSMutualAuthentication
{
<#
.Synopsis
Configures AMT connection to TLS with mutual authentication
.Description
This cmdlet configures the AMT connection to TLS with mutual authentication.
The cmdlet adds the AMT c... |
combined_dataset/train/non-malicious/2894.ps1 | 2894.ps1 | task default -depends DisplayNotice
task DisplayNotice {
if ( $IsMacOS -OR $IsLinux ) {}
else {
exec { msbuild /version }
}
}
|
combined_dataset/train/non-malicious/sample_20_90.ps1 | sample_20_90.ps1 | ConvertFrom-StringData @'
id_sccm_activity_cm07clientinfo=Gathering Configuration Manager Client Information
id_sccm_cm07clientinfo_clientinfo=Obtaining Client Information
id_sccm_cm07clientinfo_history=Obtaining Software Distribution, Inventory and Cache History
id_sccm_cm07clientinfo_updates=Obtaining Software Up... |
combined_dataset/train/non-malicious/2555.ps1 | 2555.ps1 |
function invoke-sql
{
param(
[Parameter(Mandatory = $True)]
[string]$Query,
[Parameter(Mandatory = $True)]
[string]$DBName,
[Parameter(Mandatory = $True)]
[string]$DBServerName
)
$QueryTimeout = 36000
$ConnectionTimeout = 36000
$conn = New-Object System.Data.SqlClient.SQLCo... |
combined_dataset/train/non-malicious/Test-SqlConnection.ps1 | Test-SqlConnection.ps1 | #######################
<#
Version History
v1.0 - Chad Miller - Initial release
#>
#######################
function Test-Ping
{
param([Parameter(Mandatory=$true, ValueFromPipeline = $true)] [string[]]$ComputerName)
process
{
$ComputerName | foreach {$result=Test-Connection -Compu... |
combined_dataset/train/non-malicious/4476.ps1 | 4476.ps1 |
configuration PSRepository_AddRepositoryConfig
{
param
(
[Parameter()]
[System.String[]]
$NodeName = 'localhost',
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String]
$RepositoryName
)
Import-DscResource -ModuleName 'Pow... |
combined_dataset/train/non-malicious/900.ps1 | 900.ps1 |
$Random=(New-Guid).ToString().Substring(0,8)
$ResourceGroup="MyResourceGroup$Random"
$AppName="webappwithStorage$Random"
$StorageName="webappstorage$Random"
$Location="West US"
New-AzResourceGroup -Name $ResourceGroup -Location $Location
New-AzAppservicePlan -Name WebAppwithStoragePlan -ResourceGroupName $Resou... |
combined_dataset/train/non-malicious/3124.ps1 | 3124.ps1 |
function Get-ARPCache
{
[CmdletBinding()]
param(
)
Begin{
}
Process{
$RegexIPv4Address = "(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
$RegexMACAddress = "([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})|([0-... |
combined_dataset/train/non-malicious/Invoke-Sql.ps1 | Invoke-Sql.ps1 | <#
.SYNOPSIS
Runs a T-SQL Query and optional outputs results to a delimited file.
.DESCRIPTION
Invoke-Sql script will run a T-SQL query or stored procedure and optionally outputs a delimited file.
.EXAMPLE
PowerShell.exe -File "C:\\Scripts\\Invoke-Sql.ps1" -ServerInstance "Z003\\sqlprod2" -Database orders -Query ... |
combined_dataset/train/non-malicious/sample_13_25.ps1 | sample_13_25.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al... |
combined_dataset/train/non-malicious/sample_67_63.ps1 | sample_67_63.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/New-XVM_9.ps1 | New-XVM_9.ps1 | Function New-OSCVM
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory=$false,Position=1)]
[string]$ComputerName=$env:COMPUTERNAME,
[Parameter(Mandatory=$true,Position=2)]
[string]$Name,
[Parameter(Mandatory=$true,Position=3)]
[string]$SwitchNam... |
combined_dataset/train/non-malicious/sample_35_68.ps1 | sample_35_68.ps1 | # Get pwd at entry
$project_directory=$pwd
# Getting the path to the executable files. Priority:
# 1. Use the setting HAWC2: Executable Path, either path or executable
# 2. Use the windows registry key for the 64-bit installation, installed using the .msi package
# 3. Use the windows registry key for the 32-bit insta... |
combined_dataset/train/non-malicious/943.ps1 | 943.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"
$accountResourceType = "Microsoft.DocumentDb/databaseAccounts"
$databaseResourceType = "Microsoft.Doc... |
combined_dataset/train/non-malicious/finddupe_5.ps1 | finddupe_5.ps1 | function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.MD5CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.OpenRead();
$hashByteArray = $hashA... |
combined_dataset/train/non-malicious/sample_65_0.ps1 | sample_65_0.ps1 | ##########################################################################
# DELL PROPRIETARY INFORMATION
#
# This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this
# software to you under the terms of a license agreement,nondisclosure agreement or both.
# You may not copy, disclose, o... |
combined_dataset/train/non-malicious/sample_18_37.ps1 | sample_18_37.ps1 | function PSConsoleHostReadLine
{
Microsoft.PowerShell.Core\Set-StrictMode -Off
[Microsoft.PowerShell.PSConsoleReadLine]::ReadLine($host.Runspace, $ExecutionContext)
}
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE... |
combined_dataset/train/non-malicious/GET-NewPasswordPlus.ps1 | GET-NewPasswordPlus.ps1 | Function global:GET-NEWpassword( $Length, $Complexity) {
# $Length variable serves a dual Purpose
# It assumes nobody wants a tiny password less than
# 8 characters so anything less than than it used
# to pull up one of 8 predined password templates
If ($Length -eq $NULL) { $Length = 0 }
# If you're goi... |
combined_dataset/train/non-malicious/ESXiMgmt module sample 1.ps1 | ESXiMgmt module sample 1.ps1 | #######################################################################################################################
# File: ESXiMgmt_machines_generation_sample.ps1 #
# Author: Alexander Petrovskiy ... |
combined_dataset/train/non-malicious/sample_38_95.ps1 | sample_38_95.ps1 | # Get the version of the Torizon IDE Extension from package.json
$env:TEST_EXTENSION_VERSION = ((Get-Content "package.json" -Raw) | ConvertFrom-Json).version
$env:TEST_VSCODE_CLEANUP = $true
# Start the tests from a clean environment, unless explictly setting to false
# the env variable
if ($env:TEST_VSCODE_CLEANUP -E... |
combined_dataset/train/non-malicious/sample_27_43.ps1 | sample_27_43.ps1 | #
# Module manifest for module 'OCI.PSModules.Jmsjavadownloads'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported... |
combined_dataset/train/non-malicious/189.ps1 | 189.ps1 | function Remove-StringLatinCharacter
{
[CmdletBinding()]
PARAM (
[Parameter(ValueFromPipeline=$true)]
[System.String[]]$String
)
PROCESS
{
FOREACH ($StringValue in $String)
{
Write-Verbose -Message "$StringValue"
TRY
{
[Text.Encoding]::A... |
combined_dataset/train/non-malicious/4177.ps1 | 4177.ps1 |
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()]
[string]$Collection,
[ValidateNotNullOrEmpty()]
[string]$SQLServer,
[ValidateNotNullOrEmpty()]
[string]$SQLDatabase
)
$RebootList = Invoke-Sqlcmd -ServerInstance $SQLServer -Database $SQLDatabase -Query 'SELECT * FROM dbo.vSMS_CombinedDeviceResources WHERE Cl... |
combined_dataset/train/non-malicious/sample_28_0.ps1 | sample_28_0.ps1 | $lnetRegex = "(?i)^/?subscriptions/(?<subscriptionId>[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})/resourceGroups/(?<resourceGroupName>[-\w\._\(\)]{1,90})/providers/Microsoft.AzureStackHCI/logicalnetworks/(?<logicalNetworkName>[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[_a-zA-Z0-9])$"
$galImageRegex = "(?i)^/?subscriptions/(?<subscr... |
combined_dataset/train/non-malicious/sample_53_59.ps1 | sample_53_59.ps1 | '*************************************************************
'
' ADOBE SYSTEMS INCORPORATED
' Copyright 2005-2010 Adobe Systems Incorporated
' All Rights Reserved
' NOTICE: Adobe permits you to use, modify, and
' distribute this file in accordance with the terms
' of the Adobe license agreement accompa... |
combined_dataset/train/non-malicious/sample_21_13.ps1 | sample_21_13.ps1 | ConvertFrom-StringData @'
id_ctsfirewallrunningcheck=Windows Firewall Running check
id_ctsfirewallrunningcheckdescription=Verify the Windows Firewall service is running
id_firewallrunningcheckdesc=The Windows Firewall service is not running
id_firewallstartmodecheckdesc=The Windows Firewall start mode is not set to... |
combined_dataset/train/non-malicious/VM Performance Report.ps1 | VM Performance Report.ps1 | <#
.SYNOPSIS
The script creates an HTML report for given vSphere VM's, that contains VM performance data over a given period. The script then emails the report to a given address.
.DESCRIPTION
The script requires an input file, supplied as an argument to the script. The first line of this file contains an e... |
combined_dataset/train/non-malicious/Wireless Signal Strength.ps1 | Wireless Signal Strength.ps1 | # Wireless Statistics into object
# Author: Josh Popp
# Put Wireless Stats, like Signal Strengh, BSSID, and Channel into an object
# First just dump the netsh output into $wlanraw
$wlanraw = netsh wlan show interface
# Create the object as "empty"
$objWLAN = "" | Select-Object Name,SSID,BSSID,Channel... |
combined_dataset/train/non-malicious/sample_4_57.ps1 | sample_4_57.ps1 | #************************************************
# TS_ModernAppsFailureForUserProfileDirCheck.ps1
# Version 1.0.1
# Date: 3/13/2013
# Author: v-kaw
# Description: [Idea ID 7546] [Windows] WinStore - Modern Apps Fail to Start if the User Profile directory is Moved from default
# Rule number: 7546
# Rule URL: ... |
combined_dataset/train/non-malicious/sample_10_89.ps1 | sample_10_89.ps1 | ConvertFrom-StringData @'
id_sccm_checksqlconfig=Checking SQL Database Configuration
id_sccm_checksqlvalue=Checking the Value of
id_sccm_checksqlconfigdesc=Trying to connect to the SQL Database
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGs... |
combined_dataset/train/non-malicious/sample_38_7.ps1 | sample_38_7.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/sample_32_53.ps1 | sample_32_53.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 = '83.2.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_13_16.ps1 | sample_13_16.ps1 | ConvertFrom-StringData @'
id_hypervkb2263829check=Checking for KB2263829
id_hypervkb2263829checkdesc=Checking version of Hvax64.exe and other binaries
'@
# SIG # Begin signature block
# MIIoVAYJKoZIhvcNAQcCoIIoRTCCKEECAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE6... |
combined_dataset/train/non-malicious/2471.ps1 | 2471.ps1 |
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$ApiManagementServiceName,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$ApiManagementServiceResourceGroup,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$ApiMatchPattern,
[Parameter(Mandatory)]
[ValidateNotNul... |
combined_dataset/train/non-malicious/Send-Growl 3.1.ps1 | Send-Growl 3.1.ps1 | ## This is the first version of a Growl module (just dot-source to use in PowerShell 1.0)
## v 1.0 supports a very simple notice, and no callbacks
## v 2.0 supports registering multiple message types
## supports callbacks
## v 2.1 redesigned to be a module used from apps, rather than it's own "PowerGrowler" a... |
combined_dataset/train/non-malicious/sample_26_91.ps1 | sample_26_91.ps1 | ; Function queries
(function_definition
body: (_) @function.inside) @function.around ; Does not include end marker
(lambda_expression
(_) @function.inside) @function.around
; Scala 3 braceless lambda
(colon_argument
(_) @function.inside) @function.around
; Class queries
(object_definition
body: (_)? @clas... |
combined_dataset/train/non-malicious/Power state.ps1 | Power state.ps1 | using System;
using System.IO;
using System.Reflection;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("greg zakharov")]
[assembly: AssemblyCopyright("Copyleft (C) 2007 greg zakharov")]
[assembly: AssemblyCulture("")]
[assembly: Assembly... |
combined_dataset/train/non-malicious/1700.ps1 | 1700.ps1 | [CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[ValidateNotNullorEmpty()]
[PSCredential]$Credential
)
If (-not $PSScriptRoot) {$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent}
$Script:ThisCommand = $MyInvocation.MyCommand
$ProjectRoot = Resolve-Path "$PSScriptRoot\.."
$ModuleRoot ... |
combined_dataset/train/non-malicious/2242.ps1 | 2242.ps1 | param(
[parameter(Mandatory=$true)]
$SiteServer,
[parameter(Mandatory=$true)]
$SiteCode,
[parameter(Mandatory=$true)]
$BootImageName,
[parameter(Mandatory=$false)]
[switch]$Commit
)
Begin {
Write-Output "INFO: Querying SMS_BootImagePackage for Boot Images"
$BootImages = Get-WmiObject -Namespace "root\SMS\site_$... |
combined_dataset/train/non-malicious/213.ps1 | 213.ps1 | function Get-ProcessForeignAddress
{
PARAM ($ProcessName)
$netstat = netstat -no
$Result = $netstat[4..$netstat.count] |
ForEach-Object {
$current = $_.trim() -split '\s+'
New-Object -TypeName PSobject -Property @{
ProcessName = (Get-Process -id $current[4]).processname
ForeignAddressIP = ($current[2] ... |
combined_dataset/train/non-malicious/USB Script backup.ps1 | USB Script backup.ps1 | ################################################################################
# Copy-Backup.ps1
# This script will backup recently changed .ps1 files from any selected folder
# (default is $pwd) to any number of inserted USB devices, on which an archive
# folder PSarchive will be created if it does not already... |
combined_dataset/train/non-malicious/sample_2_6.ps1 | sample_2_6.ps1 | # *********************************************************************
# Version 1.0
# Date: 03-27-2012, 2021
# Author: Vinay Pamnani - vinpa@microsoft.com
# Description:
# Gets SMS, CCM and WSUS Registry Keys
# Uses Export-RegKey function (defined in utils_Shared.ps1)
# replaced _RegistryKey_ with _Reg_
# *... |
combined_dataset/train/non-malicious/sample_38_26.ps1 | sample_38_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/9a32cfaf-77be-4cae-8d11-f85a905dfa06.ps1 | 9a32cfaf-77be-4cae-8d11-f85a905dfa06.ps1 | param
(
[Parameter(Mandatory=$true, Position = 0, ValueFromPipeline=$true)]
[Parameter(HelpMessage="Specifies the path to the IIS *.log file to import. You can also pipe a path to Import-Iss-Log.")]
[ValidateNotNullOrEmpty()]
[string]
$Path,
[Parameter(Position = 1)]
[Parameter(HelpMessage="Specifies ... |
combined_dataset/train/non-malicious/sample_0_48.ps1 | sample_0_48.ps1 | define({"plorerл•Љ":{"explorerл•Љ":[508],},"plus":{"alignplus":[645],"assemblyplus":[645],"profileplus":[645],},"pmen":{"equipment":[645],},"pment":{"equipment":[645],},"pn":{"pn":[491],},"png":{"png":[63,545],},"pnмЭА":{"pnмЭА":[494],},"pnмЭілЮА":{"pnмЭілЮА":[494],},"poin":{"checkpoint":[645],},"point":{"checkpoint":[... |
combined_dataset/train/non-malicious/sample_24_50.ps1 | sample_24_50.ps1 | function Export-WACRERegistryContent {
<#
.SYNOPSIS
Exports registry key/values based on the selected key path.
.DESCRIPTION
Exports registry key/values based on the selected key path. The supported Operating Systems are Window Server 2012 and Windows Server 2012R2 and Windows Server 2016.
.ROLE
Administra... |
combined_dataset/train/non-malicious/2719.ps1 | 2719.ps1 |
if (Get-Command Get-SmbShare -ErrorAction SilentlyContinue) {
Get-SmbShare
} |
combined_dataset/train/non-malicious/4050.ps1 | 4050.ps1 |
param([hashtable]$Theme)
Set-StrictMode -Version Latest
$Theme.HostBackgroundColor = if ($Pscx:IsAdmin) { 'DarkRed' } else { 'Black' }
$Theme.HostForegroundColor = if ($Pscx:IsAdmin) { 'White' } else { 'Cyan' }
$Theme.PromptForegroundColor = if ($Pscx:IsAdmin) { 'Gray' } else { 'White' }
... |
combined_dataset/train/non-malicious/sample_39_0.ps1 | sample_39_0.ps1 | #
# Module manifest for module 'OCI.PSModules.Secrets'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Secrets.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_59_85.ps1 | sample_59_85.ps1 | #
# Module manifest for module 'OCI.PSModules.Threatintelligence'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Threatintelligence.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Suppo... |
combined_dataset/train/non-malicious/sample_19_33.ps1 | sample_19_33.ps1 | # ***********************************************************************************************
# Version 1.0
# Date: 02-17-2012 -- Last edit: 2022-06-01
# Author: Vinay Pamnani - vinpa@microsoft.com
# Description: Utility Script to load common functions.
# 1. Defines commonly used functions in the Troublesho... |
combined_dataset/train/non-malicious/2065.ps1 | 2065.ps1 |
Describe 'Task-based PowerShell async APIs' -Tags 'CI' {
BeforeAll {
$sbStub = @'
.foreach{
[pscustomobject]@{
Time = [DateTime]::Now.ToString('yyyyMMddTHHmmss.fffffff')
Value = $_
ThreadId = [System.Threading.Thread]::CurrentThread.ManagedThreadId
Runspace... |
combined_dataset/train/non-malicious/TabExpansion for V2CTP_3.ps1 | TabExpansion for V2CTP_3.ps1 | ## Tab-Completion
#################
## For V2CTP3.
## This won't work on V1 and V2CTP and V2CTP2.
## Please dot souce this script file.
## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list.
##
## What this can do is:
##
## [datetime]::n<tab>
## [datetime]::now.d... |
combined_dataset/train/non-malicious/sample_39_1.ps1 | sample_39_1.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ResourceMover.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Module]::Instance
# Export nothing to clear implici... |
combined_dataset/train/non-malicious/Get-Exchange-Mail_1.ps1 | Get-Exchange-Mail_1.ps1 | [Reflection.Assembly]::LoadFile("C:\\Program Files\\Microsoft\\Exchange\\Web Services\\1.1\\Microsoft.Exchange.WebServices.dll") | Out-Null
$s = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2007_SP1)
$s.Credentials = New-Object Net.Netwo... |
combined_dataset/train/non-malicious/sample_46_1.ps1 | sample_46_1.ps1 | #
# Module manifest for module 'Microsoft.Sdn.Acls'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.Sdn.Acls.psm1'
# Version number of this module.
ModuleVersion = '3.11.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to uniquely ide... |
combined_dataset/train/non-malicious/Report-RecipientCounts_1.ps1 | Report-RecipientCounts_1.ps1 | <#
.SYNOPSIS
Report-RecipientCounts.ps1
Keep a running total of daily recipient count distribution.
.DESCRIPTION
Keep a running total of daily recipient count distribution.
.PARAMETER Days
The number of days back to examine logs.
Default = 1 (Yesterday)
.EXAMPLE
Report-R... |
combined_dataset/train/non-malicious/sample_38_43.ps1 | sample_38_43.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 = '79.0.0'
# Sup... |
combined_dataset/train/non-malicious/sample_38_76.ps1 | sample_38_76.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/sample_4_85.ps1 | sample_4_85.ps1 | # Localized 10/16/2024 05:34 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Sì
PromptNoString=&No
BundleFound=Pacchetto trovato: {0}
PackageFound=Pacchetto trovato: {0}
EncryptedBundleFound=Bundle crittografato trovato: {0}
EncryptedPackag... |
combined_dataset/train/non-malicious/3430.ps1 | 3430.ps1 |
$global:gPsAutoTestADAppId = 'b8a1058e-25e8-4b08-b40b-d8d871dda591'
$global:gPsAutoTestSubscriptionName = 'Node CLI Test'
$global:gPsAutoTestSubscriptionId = '2c224e7e-3ef5-431d-a57b-e71f4662e3a6'
$global:gTenantId = '72f988bf-86f1-41af-91ab-2d7cd011db47'
$global:gLocalCertSubjectName = 'CN=PsAutoTestCert, OU=Micros... |
combined_dataset/train/non-malicious/Import-Certificate_4.ps1 | Import-Certificate_4.ps1 | function Import-Certificate {\n<#\n .SYNOPSIS\n Imports certificate in specified certificate store.\n\n .DESCRIPTION\n Imports certificate in specified certificate store.\n\n .PARAMETER CertFile\n The certificate file to be imported.\n\n .PARAMETER StoreNames\n The certificate ... |
combined_dataset/train/non-malicious/WSUS-Purge.ps1 | WSUS-Purge.ps1 | #==================================================================================================
# File Name : WSUS-Purge.ps1
# Original Author : Kenneth C. Mazie (kcmjr)
# Description : As written it will clear out files left over from Windows Updates.
# :
... |
combined_dataset/train/non-malicious/sample_11_68.ps1 | sample_11_68.ps1 | PARAM ( [string] $SiteToCheck = $null )
#************************************************
# DCSiteInfo.ps1
# Version 1.0
# Date: 1/14/2014
# Author: Tim Springston [MS]
# Description: This script queries for the computers domain
# and returns details about all domain controllers which are in
# the same... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.