full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_44_73.ps1 | sample_44_73.ps1 | #
# Module manifest for module 'OCI.PSModules.Common'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Common.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/Write-Log_3.ps1 | Write-Log_3.ps1 | function Write-Log {
#region Parameters
[cmdletbinding()]
Param(
[Parameter(ValueFromPipeline=$true,Mandatory=$true)] [ValidateNotNullOrEmpty()]
[string] $Message,
[Parameter()] [ValidateSet(“Error”, “Warn”, “Info”)]
[string] $Level = “Info”,
[Parameter()]
[Switch] $NoConsole... |
combined_dataset/train/non-malicious/sample_61_39.ps1 | sample_61_39.ps1 | #
# Module manifest for module 'OCI.PSModules.Aianomalydetection'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aianomalydetection.dll'
# Version number of this module.
ModuleVersion = '88.1.0'
# Suppo... |
combined_dataset/train/non-malicious/1171.ps1 | 1171.ps1 |
$rootKey = 'hklm:\Software\Carbon\Test'
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
if( -not (Test-Path $rootKey -PathType Container) )
{
New-Item $rootKey -ItemType RegistryKey -Force
}
... |
combined_dataset/train/non-malicious/1339.ps1 | 1339.ps1 |
function Write-IisVerbose
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,Position=0)]
[string]
$SiteName,
[string]
$VirtualPath = '',
[Parameter(Position=1)]
[string]
$Name,
[Parameter(Position=2)]
[stri... |
combined_dataset/train/non-malicious/Productivity Calculator.ps1 | Productivity Calculator.ps1 | <#
Author: mazakane
This short script converts Time settings and displays a "productivity" Report with a goal of 81%
Example:
get-productivity -Start 8:00 -End 17:00
#>
function get-Productivity{
param(
$start,
$end
)
$a = ([datetime]::Parse("$start"))
$b = ([datetime]::Parse("$end"))
... |
combined_dataset/train/non-malicious/sample_1_37.ps1 | sample_1_37.ps1 | #************************************************
# TS_BPAInfo.ps1
# Version 1.5.6
# Date: 12-10-2010 / 2019 WalterE
# Author: Andre Teixeira - andret@microsoft.com
# Description: - This script is used to obtain a report from any inbox BPA Module information or other BPAs with MBCA support.
#*********************... |
combined_dataset/train/non-malicious/PowerBot 2.0.ps1 | PowerBot 2.0.ps1 | ## PowerBot 2.0
## A simple framework to get you started writing your own IRC bots in PowerShell
####################################################################################################
## Requires Meebey.SmartIrc4net.dll to be in your ...\\WindowsPowerShell\\Libraries\\
## You can get Meebey.SmartIrc4n... |
combined_dataset/train/non-malicious/sample_53_9.ps1 | sample_53_9.ps1 | # Localized 04/01/2024 05:02 AM (GMT) 303:7.2.30118 CL_LocalizationData.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Troubleshooting
Troubleshoot_DetectDVDDevice=Checking DVD device ...
Troubleshoot_DetectDVDvideoDecoder=Checking video decoder for DVD playback ...
Troubleshoot_DetectDVDAudioDecoder... |
combined_dataset/train/non-malicious/sample_42_77.ps1 | sample_42_77.ps1 | #
# Module manifest for module 'OCI.PSModules.Aivision'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aivision.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_58_76.ps1 | sample_58_76.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 = '85.1.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/Hash Checker_4.ps1 | Hash Checker_4.ps1 | #.Synopsis
# Test the HMAC hash(es) of a file
#.Description
# Takes the HMAC hash of a file using specified algorithm, and optionally, compare it to a baseline hash
#.Example
# Test-Hash npp.5.3.1.Installer.exe -HashFile npp.5.3.1.release.md5
#
# Searches the provided hash file for a line matching the "... |
combined_dataset/train/non-malicious/507.ps1 | 507.ps1 |
function Write-PPErrorEventLog{
param(
[Parameter(Mandatory=$false)]
[string]$Message,
[Parameter(Mandatory=$false)]
[string]$Source,
[switch]
$ClearErrorVariable
)
if($Error){
$Error | %{$ErrorLog += "$($_.ToString()) $($_.InvocationInfo.Position... |
combined_dataset/train/non-malicious/sample_60_70.ps1 | sample_60_70.ps1 | #
# Module manifest for module 'OCI.PSModules.Keymanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Keymanagement.dll'
# Version number of this module.
ModuleVersion = '88.1.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/Ping Alert Script.ps1 | Ping Alert Script.ps1 | #Email Alert Parameters
$to = "user@mydomain.com"
$from = "unreachable@mydomain.com"
$smtpserver = "my_exchange_server"
#Array of computers to test
$Computers = ("comp1" , "comp2" , "comp3" , "comp4")
#Variable to hold INT value 0
$zero = 0
Foreach ($Computer in $Computers)
{
if... |
combined_dataset/train/non-malicious/411.ps1 | 411.ps1 | function Convert-PsfMessageLevel
{
[CmdletBinding()]
Param (
[Parameter(Mandatory = $true)]
[PSFramework.Message.MessageLevel]
$OriginalLevel,
[Parameter(Mandatory = $true)]
[bool]
$FromStopFunction,
[Parameter(Mandatory = $true)]
[AllowNull()]
[string[]]
$Tags,
[Parameter(Mandatory =... |
combined_dataset/train/non-malicious/388.ps1 | 388.ps1 | [CmdletBinding()]
Param (
[switch]
$SkipTest,
[string[]]
$CommandPath = @("$PSScriptRoot\..\..\functions", "$PSScriptRoot\..\..\internal\functions")
)
if ($SkipTest) { return }
$list = New-Object System.Collections.ArrayList
Describe 'Invoking PSScriptAnalyzer against commandbase' {
$commandFiles = Get-ChildI... |
combined_dataset/train/non-malicious/sample_19_13.ps1 | sample_19_13.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 = '79.0.0'
# Supported... |
combined_dataset/train/non-malicious/201.ps1 | 201.ps1 | function Set-RDPEnable
{
[CmdletBinding()]
PARAM (
[String[]]$ComputerName = $env:COMPUTERNAME
)
PROCESS
{
FOREACH ($Computer in $ComputerName)
{
TRY
{
IF (Test-Connection -ComputerName $Computer -Count 1 -Quiet)
{
$regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win... |
combined_dataset/train/non-malicious/sample_55_73.ps1 | sample_55_73.ps1 | #
# Module manifest for module 'OCI.PSModules.Artifacts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Artifacts.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_53_64.ps1 | sample_53_64.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/Find Local Group Members_7.ps1 | Find Local Group Members_7.ps1 | # Author: Hal Rottenberg
# Purpose: Find matching members in a local group
# Used tip from RichS here: http://powershellcommunity.org/Forums/tabid/54/view/topic/postid/1528/Default.aspx
# Change these two to suit your needs
$ChildGroups = "Domain Admins", "Group Two"
$LocalGroup = "Administrators"
$MemberName... |
combined_dataset/train/non-malicious/sample_32_59.ps1 | sample_32_59.ps1 | <####################################################################################################################################################################################################################
##############################| |#################################################################... |
combined_dataset/train/non-malicious/Deploy VM with Static IP_3.ps1 | Deploy VM with Static IP_3.ps1 | # 1. Create a simple customizations spec:
$custSpec = New-OSCustomizationSpec -Type NonPersistent -OSType Windows `
-OrgName “My Organization” -FullName “MyVM” -Domain “MyDomain” `
–DomainUsername “user” –DomainPassword “password”
# 2. Modify the default network customization settings:
$custSpec | Get-OSCu... |
combined_dataset/train/non-malicious/2453.ps1 | 2453.ps1 | function Write-Param
{
[CmdletBinding()]
param ()
$caller = (Get-PSCallStack)[1]
Write-Verbose -Message "Function: $($caller.Command) - Params used: $($caller.Arguments)"
} |
combined_dataset/train/non-malicious/sample_35_80.ps1 | sample_35_80.ps1 | #
# Module manifest for module 'GCArcService'
#
# Generated by: Microsoft
#
# Generated on: 08/09/2020
#
@{
# Script module or binary module file associated with this manifest.
ModuleToProcess = 'GCArcService.psm1'
# Version number of this module.
ModuleVersion = '1.0'
# ID used to uniquely identify... |
combined_dataset/train/non-malicious/Invoke-ScriptThatRequire.ps1 | Invoke-ScriptThatRequire.ps1 | ###########################################################################\n##\n## Invoke-ScriptThatRequiresSta\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n###########################################################################\n\n<#\n\n.SYNOPSIS\n\nD... |
combined_dataset/train/non-malicious/3650.ps1 | 3650.ps1 |
function Test-VulnerabilityAssessmentManagedInstanceSettingsTest
{
$testSuffix = getAssetName
Create-VulnerabilityAssessmentManagedInstanceTestEnvironment $testSuffix
$params = Get-SqlVulnerabilityAssessmentManagedInstanceTestEnvironmentParameters $testSuffix
$vnetName = "cl_initial"
$subnetName =... |
combined_dataset/train/non-malicious/sample_59_80.ps1 | sample_59_80.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
function Remove-ServiceFabric... |
combined_dataset/train/non-malicious/Stored Credential Code_1.ps1 | Stored Credential Code_1.ps1 | #STORED CREDENTIAL CODE
$AdminName = Read-Host "Enter your Admin AD username"
$CredsFile = "C:\\$AdminName-PowershellCreds.txt"
$FileExists = Test-Path $CredsFile
if ($FileExists -eq $false) {
Write-Host 'Credential file not found. Enter your password:' -ForegroundColor Red
Read-Host -AsSecureString | ConvertF... |
combined_dataset/train/non-malicious/sample_50_96.ps1 | sample_50_96.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Set-ScriptExtent {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding(PositionalBinding = $false, DefaultParameterSetName = '__AllParameterSets')]
param(
[Parameter(Posit... |
combined_dataset/train/non-malicious/sample_33_86.ps1 | sample_33_86.ps1 | #
# This script handles common telemetry tasks for Install.ps1 and Add-AppDevPackage.ps1.
#
function IsVsTelemetryRegOptOutSet()
{
$VsTelemetryRegOptOutKeys = @(
"HKLM:\SOFTWARE\Policies\Microsoft\VisualStudio\SQM",
"HKLM:\SOFTWARE\Wow6432Node\Microsoft\VSCommon\16.0\SQM",
"HKLM:\S... |
combined_dataset/train/non-malicious/sample_61_42.ps1 | sample_61_42.ps1 | #
# Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker'
#
# Generated by: Microsoft Corporation
#
# Generated on: 19/01/2022
#
@{
# Script module or binary module file associated with this manifest.
RootModule = ''
# Version number of this module.
ModuleVersion = '1.2100.26... |
combined_dataset/train/non-malicious/1597.ps1 | 1597.ps1 |
Param($NumberOfDays = 30, [switch]$debug)
if($debug) { $DebugPreference = " continue" }
[timespan]$uptime = New-TimeSpan -start 0 -end 0
$currentTime = get-Date
$startUpID = 6005
$shutDownID = 6006
$minutesInPeriod = (24*60)*$NumberOfDays
$startingDate = (Get-Date -Hour 00 -Minute 00 -Second 00).adddays(... |
combined_dataset/train/non-malicious/sample_37_25.ps1 | sample_37_25.ps1 | # Copyright (c) Microsoft Corporation.
#
# This script will
# 1. Examine Azcmagent configuration
# 2. Check if automatic upgrade is enabled
# 3. Check if desired version is greater than existing agent version
# 4. Check if automatic upgrade has already been attempted before
# 5. Get the download l... |
combined_dataset/train/non-malicious/Get-InvocationInfo.ps1 | Get-InvocationInfo.ps1 | ##############################################################################\n##\n## Get-InvocationInfo\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nDispl... |
combined_dataset/train/non-malicious/SCOM-RunRemoteExecutable.ps1 | SCOM-RunRemoteExecutable.ps1 | # ==============================================================================================
#
# Microsoft PowerShell Source File Ś Created with SAPIEN Technologies PrimalScript 2007
#
# NAME: SCOM-RunRemoteExecutable.ps1
#
# AUTHOR: Jeremy D. Pavleck , Pavleck.NET
# DATE : 9/13/2008
#
# COMMENT: This is ... |
combined_dataset/train/non-malicious/sample_46_80.ps1 | sample_46_80.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/513.ps1 | 513.ps1 |
function Update-SPWebTermNavigation{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[String]$Identity,
[Parameter(Mandatory=$true)]
[String]$MMSSite,
[Parameter(Mandatory=$true)]
[String]$TermStoreName,
[Parameter(Mandatory=... |
combined_dataset/train/non-malicious/sample_45_74.ps1 | sample_45_74.ps1 | <#
.SYNOPSIS
Copies a cert from one store to another.
The below sample copies any of the "Relativity - CA" cert in Intermediate Certificate Authorities and puts them in Personal.
This helps the "Relativity Secret Store" cert become trusted so debugging a DevVM is possible.
.\Local-Copy-Cert -So... |
combined_dataset/train/non-malicious/Invoke-SqlCmd_6.ps1 | Invoke-SqlCmd_6.ps1 | function Invoke-Sqlcmd2
{
param
(
[string]$ServerInstance="localhost",
[string]$Database,
[string]$Query,
[Int32]$CommandTimeout=30
)
$connectionString = "Server={0};Database={1};Integrated Security=True" -f $ServerInstance, $Database
$connection = New... |
combined_dataset/train/non-malicious/3473.ps1 | 3473.ps1 |
function NetworkRuleSetTests
{
$location = Get-Location
$resourceGroupName = getAssetName "RSG"
$namespaceName = getAssetName "Eventhub-Namespace-"
$namespaceName2 = getAssetName "Eventhub-Namespace2-"
Write-Debug "Create resource group"
Write-Debug "ResourceGroup name : $resourceGrou... |
combined_dataset/train/non-malicious/Set-ExcludeFromPeek.ps1 | Set-ExcludeFromPeek.ps1 | Add-Type -Type @"
using System;
using System.Runtime.InteropServices;
namespace Huddled {
public static class Dwm {
[DllImport("dwmapi.dll", PreserveSig = false)]
public static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, ref int attrValue, int attrSize);
[Flags]
public... |
combined_dataset/train/non-malicious/New-Exch2010NlbCluster.ps1 | New-Exch2010NlbCluster.ps1 | ###########################################################################
#
# NAME: New-Exch2010NlbCluster.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jer@powershell.no
#
# COMMENT: Script to create a NLB-cluster for the CAS/HUB-roles in Exchange Server 2010.
# For more details, see the following blog-pos... |
combined_dataset/train/non-malicious/sample_5_94.ps1 | sample_5_94.ps1 | # Copyright ? 2011, Microsoft Corporation. All rights reserved.
# This script will collect the metabase.xml or applicationHost.config file, along with all web.config files
# Collects Framework directory Configuration files
# for the web sites passed into the script
# Written By: Bret Bentzinger
# Date: July 7,... |
combined_dataset/train/non-malicious/sample_38_50.ps1 | sample_38_50.ps1 | #
# Add-AppxDevPackage.ps1 is a PowerShell script designed to install app
# packages created by Visual Studio for developers. To run this script from
# Explorer, right-click on its icon and choose "Run with PowerShell".
#
# Visual Studio supplies this script in the folder generated with its
# "Prepare Package" c... |
combined_dataset/train/non-malicious/Send-RTMTask.ps1 | Send-RTMTask.ps1 | #——————————————————————————
# Func/Sub Name: Send-RTMTask
# Purpose: Sends a task to the Remember The Milk system via email.
# Arguments Supplied:
# Return Value:
# External Reference:
#——————————————————————————
function Send-RTMTask
{
param( [string]$TaskName=$(Throw "need TaskName"),
$Priority,
... |
combined_dataset/train/non-malicious/Get-User_3.ps1 | Get-User_3.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/sample_4_26.ps1 | sample_4_26.ps1 | ConvertFrom-StringData @'
id_sql_setup_collect_bootstrap_logs=Collecting SQL Setup Bootstrap Logs
id_sql_setup_collect_2005_logs=Collecting SQL 2005 Bootstrap Logs
id_sql_setup_collect_2008_2008r2_logs=Collecting SQL 2008 and 2008R2 Bootstrap Logs
id_sql_setup_collect_2012_logs=Collecting SQL 2012 Bootstrap Logs
i... |
combined_dataset/train/non-malicious/sample_32_48.ps1 | sample_32_48.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias'... |
combined_dataset/train/non-malicious/Open-Solution.ps1 | Open-Solution.ps1 | function Open-Solution([string]$path = ".") {
$sln_files = Get-ChildItem $path -Include *.sln -Recurse
if($sln_files -eq $null) {
Write-Host "No Solution file found"
return
}
if($sln_files.Count) { # There is more than one
do {
Write-Host "Please select file (or Ctrl+C to quit)"
... |
combined_dataset/train/non-malicious/sample_2_77.ps1 | sample_2_77.ps1 | // Copyright (c) 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
// ==================================================================
// DCIM_RollupStatusCollection
// ==================================================================
[dynamic, provider("dcismprovider"),
Description (
"A cla... |
combined_dataset/train/non-malicious/Finding Old or Unused Ac.ps1 | Finding Old or Unused Ac.ps1 | $dcs = [System.DirectoryServices.ActiveDirectory.Domain]::getcurrentdomain().DomainControllers | select name
$startdate = get-date('1/1/1601')
$lst = new-Object System.Collections.ArrayList
foreach ($dc in $dcs) {
$root = [ADSI] LDAP://$($dc.Name):389
$searcher = New-Object System.DirectoryServices.Directory... |
combined_dataset/train/non-malicious/sample_6_25.ps1 | sample_6_25.ps1 | ConvertFrom-StringData @'
id_ctsdirectaccessclient=DirectAccess Client
id_ctsdirectaccessclientdescription=Collects information about DirectAccess client.
id_ctstcpip=TCPIP
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEe... |
combined_dataset/train/non-malicious/90.ps1 | 90.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/9ef43b00-ae12-4e41-b331-af2bdfba35c1.ps1 | 9ef43b00-ae12-4e41-b331-af2bdfba35c1.ps1 | #alias,addnewemailaddress
import-csv .\\source.csv | foreach {
$user = Get-Mailbox $_.alias
$user.emailAddresses+= $_.addnewemailaddress
$user.primarysmtpaddress = $_.addnewemailaddress
Set-Mailbox $user -emailAddresses $user.emailAddresses
set-Mailbox $user -PrimarySmtpAddress $user.primarysmtpaddress
}
|
combined_dataset/train/non-malicious/sample_15_95.ps1 | sample_15_95.ps1 | #
# Module manifest for module 'OCI.PSModules.Datascience'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datascience.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/2172.ps1 | 2172.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=$false, HelpMessa... |
combined_dataset/train/non-malicious/2044.ps1 | 2044.ps1 |
Describe "Telemetry for shell startup" -Tag CI {
BeforeAll {
$cacheDir = [System.Management.Automation.Platform].GetField("CacheDirectory","NonPublic,Static").GetValue($null)
$uuidPath = Join-Path -Path $cacheDir -ChildPath telemetry.uuid
$uuidFileExists = Test-Path ... |
combined_dataset/train/non-malicious/sample_46_16.ps1 | sample_46_16.ps1 | #
# Module manifest for module 'OCI.PSModules.Autoscaling'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Autoscaling.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_45_36.ps1 | sample_45_36.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 = '79.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_18_85.ps1 | sample_18_85.ps1 | #************************************************
# DC_NetworkList-Component.ps1
# Version 1.0
# Date: 2009
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about the NetworkList Component.
# Called from: Main Networking Diag
#*****************************************************... |
combined_dataset/train/non-malicious/sample_57_64.ps1 | sample_57_64.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydomains'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydomains.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported P... |
combined_dataset/train/non-malicious/Set-Watcher.ps1 | Set-Watcher.ps1 | ###############################################################################
# Use Unregister-Event -SourceIdentifier <name> -Force (to stop an Event).
# Include script in $profile to register all these events. Modify to suit own
# requirements and comment out any of the examples below that are not needed.
# Pl... |
combined_dataset/train/non-malicious/sample_19_30.ps1 | sample_19_30.ps1 | ConvertFrom-StringData @'
id_sepprocesshandleleak_sd=A specific version of Symantec Endpoint Protection (SEP) known for causing handle leaks was detected in this machine.
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYC... |
combined_dataset/train/non-malicious/sample_52_71.ps1 | sample_52_71.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/Convert-ToCHexString_4.ps1 | Convert-ToCHexString_4.ps1 | function Convert-ToCHexString {
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline=$true,Mandatory=$true)][string]$str
)
process { ($str.ToCharArray() | %{ "0x{0:X2}" -f [int]$_ }) -join ',' }
}
|
combined_dataset/train/non-malicious/sample_8_13.ps1 | sample_8_13.ps1 | #************************************************
# utils_Exchange.ps1
# Version 1.0.1
# Date: 04-12-2013, 2022-07-27
# Author: Jerome COIFFIN - jcoiffin@microsoft.com
# Description: Utility functions for use by Exchange SDP 3.0+ manifests
#************************************************
#Import-LocalizedDa... |
combined_dataset/train/non-malicious/3012.ps1 | 3012.ps1 | function New-PesterState {
param (
[String[]]$TagFilter,
[String[]]$ExcludeTagFilter,
[String[]]$TestNameFilter,
[System.Management.Automation.SessionState]$SessionState,
[Switch]$Strict,
[Pester.OutputTypes]$Show = 'All',
[object]$PesterOption,
[Switc... |
combined_dataset/train/non-malicious/sample_61_25.ps1 | sample_61_25.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param (
[Parameter(Manda... |
combined_dataset/train/non-malicious/sample_36_26.ps1 | sample_36_26.ps1 | #
# Module manifest for module 'OCI.PSModules.Fleetsoftwareupdate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fleetsoftwareupdate.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Sup... |
combined_dataset/train/non-malicious/sample_52_38.ps1 | sample_52_38.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/TabExpansion_3.ps1 | TabExpansion_3.ps1 | ## Tab-Completion
#################
## 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<tab>
## $foo[0].<tab>
## $foo[0].n.b<tab>
## $function:a<tab>
##... |
combined_dataset/train/non-malicious/SQLite Read _ Write_1.ps1 | SQLite Read _ Write_1.ps1 | # Make sure SQLite.Interop.dll is in the same directory as System.Data.SQLite.dll
$scriptDir = "Path to your SQLite DLL"
Add-Type -Path "$scriptDir\\System.Data.SQLite.dll"
############### SAMPLE USAGE ###################
### Querying:
###
### $readQuery = "SELECT * FROM TABLE"
### $dataArray = $SQLite.q... |
combined_dataset/train/non-malicious/1768.ps1 | 1768.ps1 |
if($IsWindows)
{
Import-Module (Join-Path -Path $PSScriptRoot 'certificateCommon.psm1') -Force
}
$currentUserMyLocations = @(
@{path = 'Cert:\CurrentUser\my'}
@{path = 'cert:\currentuser\my'}
@{path = 'Microsoft.PowerShell.Security\Certificate::CurrentUser\My'}
@{path = 'Mic... |
combined_dataset/train/non-malicious/4146.ps1 | 4146.ps1 |
[CmdletBinding()]
param ()
function Uninstall-MSIByName {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][String]$ApplicationName,
[ValidateNotNullOrEmpty()][String]$Switches
)
$Executable = $Env:windir + "\system32\msiexec.exe"
Do {
$Uninstall = Get-ChildItem REGISTRY::HKEY_LOCAL_MACHINE\... |
combined_dataset/train/non-malicious/1717.ps1 | 1717.ps1 | function New-ServiceNowIncident{
Param(
[parameter(Mandatory=$true)]
[parameter(ParameterSetName='SpecifyConnectionFields')]
[parameter(ParameterSetName='UseConnectionObject')]
[parameter(ParameterSetName='SetGlobalAuth')]
[string]$Caller,
[param... |
combined_dataset/train/non-malicious/sample_50_34.ps1 | sample_50_34.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\semver@7.5.4\node_modules\semver\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\semver@7.5.... |
combined_dataset/train/non-malicious/sample_5_64.ps1 | sample_5_64.ps1 | ConvertFrom-StringData @'
progressbar_id_registrydatatypecheck=Verifying Microsoft Dynamics CRM registry key data types
progressbar_id_registrydatatypecheckdesc=Verifying Microsoft Dynamics CRM registry key data types
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5... |
combined_dataset/train/non-malicious/2886.ps1 | 2886.ps1 | BuildTearDown {
$script:buildTearDown_Sequence += "executing build teardown"
[string]$expected = "Compiling;Testing;Deploying;executing build teardown"
if ($script:buildTearDown_Sequence -ne $expected) {
throw "Expected sequence '$expected', but was actually '$script:buildTearDown_Sequence'"
}
}... |
combined_dataset/train/non-malicious/Get-GrowthRate_1.ps1 | Get-GrowthRate_1.ps1 | function Get-GrowthRate {
param( $Start, $End, $Period )
@@ $rate = [math]::Abs( [math]::Pow( ( $End / $Start ),( 1 / $Period - 1 ) ) - 1 )
"{0:P}" -f $rate
}
|
combined_dataset/train/non-malicious/sample_2_49.ps1 | sample_2_49.ps1 | ConvertFrom-StringData @'
id_klist=Kerberos tickets and TGT
id_klistobtaining=Running KList utility to obtain Kerberos related information
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7... |
combined_dataset/train/non-malicious/3351.ps1 | 3351.ps1 |
function Invoke-SafeWebRequest{
Param(
[Parameter(Mandatory=$True)]
[string]$Query
)
try
{
Write-Debug "Sending query to the server..."
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$jsonResult = Invoke-WebRequest $Query ... |
combined_dataset/train/non-malicious/sample_15_96.ps1 | sample_15_96.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/1828.ps1 | 1828.ps1 |
Describe "Get-Location" -Tags "CI" {
$currentDirectory=[System.IO.Directory]::GetCurrentDirectory()
BeforeEach {
Push-Location $currentDirectory
}
AfterEach {
Pop-location
}
It "Should list the output of the current working directory" {
(Get-Location).Path | Should -BeExactly $currentDir... |
combined_dataset/train/non-malicious/2449.ps1 | 2449.ps1 | function Backup-VM
{
[CmdletBinding(SupportsShouldProcess)]
param
(
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[VMware.VimAutomation.ViCore.Impl.V1.Inventory.VirtualMachineImpl[]]
$VM,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[ValidateScript({ Test-Path -Path $_ ... |
combined_dataset/train/non-malicious/Modal File Dialogs.ps1 | Modal File Dialogs.ps1 | Add-Type -TypeDefinition @"
using System;
using System.Windows.Forms;
public class Win32Window : IWin32Window
{
private IntPtr _hWnd;
public Win32Window(IntPtr handle)
{
_hWnd = handle;
}
public IntPtr Handle
{
get { return _hWnd; }
}
}
"@ -Referenced... |
combined_dataset/train/non-malicious/sample_29_96.ps1 | sample_29_96.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 = '77.0.0'
# Supported PSE... |
combined_dataset/train/non-malicious/sample_43_91.ps1 | sample_43_91.ps1 | #
# This script launches the VC redist executable and handles certain error scenarios.
#
param(
[Parameter(Mandatory=$true)][String][ValidateNotNullOrEmpty()]$PayloadDirectory,
[Parameter(Mandatory=$true)][String][ValidateSet("arm64","x64","x86")]$Architecture,
[Parameter(Mandatory=$true)][String][Val... |
combined_dataset/train/non-malicious/New-ISEMenu_1.ps1 | New-ISEMenu_1.ps1 | Import-Module ShowUI
Function New-ISEMenu {
New-Grid -AllowDrop:$true -Name "ISEAddonCreator" -columns Auto, * -rows Auto,Auto,Auto,*,Auto,Auto -Margin 5 {
New-Label -Name Warning -Foreground Red -FontWeight Bold -Column 1
($target = New-TextBox -Name txtName -Column 1 -Row ($Row=1))
New-Label... |
combined_dataset/train/non-malicious/sample_45_99.ps1 | sample_45_99.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudmigrations'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudmigrations.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported P... |
combined_dataset/train/non-malicious/3547.ps1 | 3547.ps1 |
function Test-AzureVMGetContainers
{
$location = Get-ResourceGroupLocation
$resourceGroupName = Create-ResourceGroup $location
try
{
$vm = Create-VM $resourceGroupName $location
$vault = Create-RecoveryServicesVault $resourceGroupName $location
Enable-Protection $vault $vm
$contain... |
combined_dataset/train/non-malicious/sample_47_13.ps1 | sample_47_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.
# ------------------------------------------------------------
function Publish-NewServiceFa... |
combined_dataset/train/non-malicious/sample_64_74.ps1 | sample_64_74.ps1 | #
# Module manifest for module 'OCI.PSModules.Appmgmtcontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Appmgmtcontrol.dll'
# Version number of this module.
ModuleVersion = '89.0.0'
# Supported PSE... |
combined_dataset/train/non-malicious/3355.ps1 | 3355.ps1 |
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True, Position=0)]
[String]$packageName,
[Parameter(Mandatory=$True, Position=1)]
[String]$packageOldVersion,
[Parameter(Mandatory=$True, Position=2)]
[String]$packageNewVersion
)
function ReplaceVersion([string]$searchString,[string]$line)
{
if($line -Match $searchS... |
combined_dataset/train/non-malicious/e9e42994-6ca4-4473-bf6b-148b56a46132.ps1 | e9e42994-6ca4-4473-bf6b-148b56a46132.ps1 | Coresponding to the Scripting Guy blog "How Can I Both Save Information in a File and Display It on the Screen?"
(http://blogs.technet.com/heyscriptingguy/archive/2009/07/07/hey-scripting-guy-how-can-i-both-save-information-in-a-file-and-display-it-on-the-screen.aspx):
My comment is:
All of the above is cool but can... |
combined_dataset/train/non-malicious/sample_3_47.ps1 | sample_3_47.ps1 | ConvertFrom-StringData @'
id_ctswinsock=Winsock Component
id_ctswinsockdescription=Collects information about the Winsock component.
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBA... |
combined_dataset/train/non-malicious/sample_19_27.ps1 | sample_19_27.ps1 | ConvertFrom-StringData @'
id_msinfo32=System Information
id_msinfo32running=Running MSInfo32 utility to obtain system information (TXT and NFO)
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
... |
combined_dataset/train/non-malicious/sample_0_93.ps1 | sample_0_93.ps1 | #pragma namespace("\\\\.\\Root\\CIMV2\\DCIM")
instance of __Win32Provider as $ismserviceprovider
{
Name = "ismserviceprovider";
ClsId = "{22CB8761-914A-11cf-B705-00AA0062CBC9}";
Pure=FALSE;
UnloadTimeout = "00000000000005.000000:000";
ImpersonationLevel = 1;
PerUserInitialization = TRU... |
combined_dataset/train/non-malicious/sample_56_47.ps1 | sample_56_47.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudbridge'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudbridge.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEdition... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.