full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/2778.ps1 | 2778.ps1 |
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=0)]
[String]$FileNamePattern
)
function Get-Files {
Param(
[Parameter(Mandatory=$True,Position=0)]
[String]$FileNamePattern
)
Write-Verbose "Entering $($MyInvocation.MyCommand)"
Write-Verbose "Looking for files matching use... |
combined_dataset/train/non-malicious/1011.ps1 | 1011.ps1 |
$random = (New-Guid).ToString().Substring(0,8)
$subscriptionId = "my-azure-subscription-id"
$apimServiceName = "apim-$random"
$resourceGroupName = "apim-rg-$random"
$location = "Japan East"
$organisation = "Contoso"
$adminEmail = "admin@contoso.com"
Select-AzSubscription -SubscriptionId $subscriptionId
New... |
combined_dataset/train/non-malicious/sample_57_89.ps1 | sample_57_89.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Functions.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.Functions.Module]::Instance
# Export nothing to clear implicit export... |
combined_dataset/train/non-malicious/1966.ps1 | 1966.ps1 |
. (Join-Path -Path $PSScriptRoot -ChildPath Test-Mocks.ps1)
Add-TestDynamicType
Describe "Select-Object" -Tags "CI" {
BeforeEach {
$dirObject = GetFileMock
$TestLength = 3
}
It "Handle piped input without error" {
{ $dirObject | Select-Object } | Should -Not -Throw
}
It "Should treat input ... |
combined_dataset/train/non-malicious/1061.ps1 | 1061.ps1 |
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$tempDir = $null
Describe 'Get-DscError' {
BeforeEach {
$tempDir = New-TempDirectory -Prefix $PSCommandPath
[Diagnostics.Eventing.Reader.EventLogSession]::GlobalSessi... |
combined_dataset/train/non-malicious/sample_66_96.ps1 | sample_66_96.ps1 | var OfficeaicopilotStringsEnum,OfficeaicopilotStringsArray,OfficeaicopilotStrings={ChatContainerKeepItActionButtonText:"Giữ lại",ChatContainerUndoActionButtonText:"Hoàn tác",ChatContainerInsertActionButtonText:"Chèn",ChatContainerFeedbackNudgeContent:"Vui lòng giúp chúng tôi tìm hiểu và đào tạo các mô hình của mình bằn... |
combined_dataset/train/non-malicious/SharpSsh Functions_3.ps1 | SharpSsh Functions_3.ps1 | ## USING the binaries from:
## http://downloads.sourceforge.net/sharpssh/SharpSSH-1.1.1.13.bin.zip
[void][reflection.assembly]::LoadFrom( (Resolve-Path "~\\Documents\\WindowsPowerShell\\Libraries\\Tamir.SharpSSH.dll") )
## NOTE: These are bare minimum functions, and only cover ssh, not scp or sftp
## also, ... |
combined_dataset/train/non-malicious/Get-Netstat 0.9.ps1 | Get-Netstat 0.9.ps1 | $null, $null, $null, $null, $netstat = netstat -a -n -o
[regex]$regex =
'\\s+(?<Protocol>\\S+)\\s+(?<LocalAddress>\\S+)\\s+(?<RemoteAddress>\\S+)\\s+(?<State>\\S+)\\s+(?<PID>\\S+)'
$netstat | ForEach-Object {
if ( $_ -match $regex ) {
$process = "" | Select-Object Protocol, LocalAddress, Remo... |
combined_dataset/train/non-malicious/sample_29_16.ps1 | sample_29_16.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="D:\a\1\s\node_modules\.pnpm\typescript@4.9.5\node_modules\typescript\bin\node_modules;D:\a\1\s\node_modules\.pnpm\typescript@4.9.5\node_modules\typescript\node_modules;D... |
combined_dataset/train/non-malicious/2ee1612d-7a4e-467a-8ae1-8c310bb1cba0.ps1 | 2ee1612d-7a4e-467a-8ae1-8c310bb1cba0.ps1 | #Purpose: To remotely query select machines for system information
#Author: Alex Smith
#Created: 6/11/2010
#Arguments: IP Addresses or Hostnames of target PCs then path and file name
#Examples: To query based on hostname or ip: C:\\>powershell .\\WMIQuery.ps1 host1
# To print to a file: C:\\>po... |
combined_dataset/train/non-malicious/sample_3_27.ps1 | sample_3_27.ps1 | #************************************************
# DC_NetworkConnections-Component.ps1
# Version 1.0
# Version 1.1: Altered the runPS function correctly a column width issue.
# Version 1.2 (4/26/14): Added table of contents.
# Date: 2012-2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description:
# Call... |
combined_dataset/train/non-malicious/sample_67_34.ps1 | sample_67_34.ps1 | #
# Module manifest for module 'OCI.PSModules.Vnmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vnmonitoring.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_1_89.ps1 | sample_1_89.ps1 | ConvertFrom-StringData @'
id_dosdev=MS-DOS device names (symbolic links)
id_dosdevrunning=Gathering MS-DOS device names information (dosdev)
id_dosdevoutput=DOSDev Output
id_dosdevoutputdesc=MS-DOS device names information
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEA... |
combined_dataset/train/non-malicious/3791.ps1 | 3791.ps1 |
function Verify-Gallery
{
param($gallery, [string] $rgname, [string] $galleryName, [string] $loc, [string] $description)
Assert-AreEqual $rgname $gallery.ResourceGroupName;
Assert-AreEqual $galleryName $gallery.Name;
Assert-AreEqual $loc $gallery.Location;
Assert-AreEq... |
combined_dataset/train/non-malicious/2587.ps1 | 2587.ps1 |
function SQL-NONQuery{
param([string]$Statement,
[string]$SqlServer = $DEFAULT_SQL_SERVER,
[string]$DB = $DEFAULT_SQL_DB )
$conn_options = ("Data Source=$SqlServer; Initial Catalog=$DB;" + "Integrated Security=SSPI")
$conn = New-Object System.Data.SqlClient.SqlConnection($conn_options)
$conn.Open()
$cmd = $c... |
combined_dataset/train/non-malicious/Upgrade Templates to v7.ps1 | Upgrade Templates to v7.ps1 |
Function Convert-TemplateToVM($template){
Write-Host "Converting" $vm -ForegroundColor Yellow
Set-Template $template -ToVM -RunAsync | out-null
}
Function PowerOn-VM($vm){
Start-VM -VM $vm -Confirm:$false -RunAsync
do {
$vmview = get-VM $vm | Get-View
$status = $vmview.Guest.ToolsStatus... |
combined_dataset/train/non-malicious/Close by window title.ps1 | Close by window title.ps1 | using System;
using System.Text;
using System.Drawing;
using System.Reflection;
using System.Diagnostics;
using System.Windows.Forms;
using System.ComponentModel;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("CloseByTitle")]
[assembly: AssemblyVersion("3.5.0.0")]
namespace CloseByTitle {... |
combined_dataset/train/non-malicious/473.ps1 | 473.ps1 |
function Start-PPScript{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[String]
$Name,
[Parameter(Mandatory=$false)]
[String]
$Arguments
)
$ScriptShortcut = Get-PPScript -Name $Name -Shortcut
$(if( -not $ScriptShortcut){
Get-PP... |
combined_dataset/train/non-malicious/sample_54_54.ps1 | sample_54_54.ps1 | ###########################################################
#
# 'ServiceHelper' module
#
###########################################################
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
$global:GCServiceName = "GCService"
$script:GCServiceBinaryName = "gc_service.exe"
$script:GC... |
combined_dataset/train/non-malicious/sample_18_70.ps1 | sample_18_70.ps1 | [CmdletBinding()]
param
(
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[Alias("FullName")]
[string]$path,
[Parameter()]
[int]$GoBack = 0,
[Parameter()]
[string]$After,
[Parameter()]
[string]$NewStart="",
[Parameter()]
[string... |
combined_dataset/train/non-malicious/Get-Exchange-Mail.ps1 | Get-Exchange-Mail.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_2_65.ps1 | sample_2_65.ps1 | #************************************************
# TS_TCPIPSettingsCheck.ps1
# Version 1.0.1
# Date: 03-27-2011
# Author: v-anecho
# Description: Checks if a Kyocera print driver is installed then checks if KB982728 is installed
#************************************************
Import-LocalizedData -BindingV... |
combined_dataset/train/non-malicious/sample_1_66.ps1 | sample_1_66.ps1 | [dynamic, provider("dcismprovider"),
Description(
"DCIM_AlertIndication is a derivation of "
"CIM_ProcessIndication.")]
class DCIM_AlertIndication : CIM_AlertIndication
{
[Description ("The time at which indication is generated")]
datetime IndicationTime;
[Description ("Description... |
combined_dataset/train/non-malicious/1216.ps1 | 1216.ps1 |
Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath 'CarbonDscTest' -Resolve) -Force
Describe 'Carbon_IniFile' {
$testConfigName = 'CarbonIniFileOption'
$tempDir = $null
$iniPath = $null
$sectionName = $null
$defaultValue = $null
$defaultValue2 = $null
function Assert... |
combined_dataset/train/non-malicious/sample_45_3.ps1 | sample_45_3.ps1 | #
# Script module for module 'Az.ArcResourceBridge' that is executed when 'Az.ArcResourceBridge' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:39
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
... |
combined_dataset/train/non-malicious/sample_60_54.ps1 | sample_60_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Vnmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vnmonitoring.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/Find Local Group Members_10.ps1 | Find Local Group Members_10.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/FTP upload_3.ps1 | FTP upload_3.ps1 | $File = "D:\\Dev\\somefilename.zip"
$ftp = "ftp://username:password@example.com/pub/incoming/somefilename.zip"
"ftp url: $ftp"
$webclient = New-Object System.Net.WebClient
$uri = New-Object System.Uri($ftp)
"Uploading $File..."
$webclient.UploadFile($uri, $File)
|
combined_dataset/train/non-malicious/sample_45_47.ps1 | sample_45_47.ps1 | #
# Script module for module 'Az.Aks' that is executed when 'Az.Aks' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:39
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
if ((Ge... |
combined_dataset/train/non-malicious/sample_45_64.ps1 | sample_45_64.ps1 | param($installPath, $toolsPath, $package, $project)
Import-Module (Join-Path $toolsPath common.psm1) -Force
try {
# Indicates if the current project is a VB project
if ([string]::IsNullOrEmpty($project.CodeModel.Language)) {
$IsVbProject = $project.FullName -like "*.vbproj"
}
else {... |
combined_dataset/train/non-malicious/Save-Credentials_2.ps1 | Save-Credentials_2.ps1 | <#
.SYNOPSIS
The script saves a username and password, encrypted with a custom key to to a file.
.DESCRIPTION
The script saves a username and password, encrypted with a custom key to to a file. The key is coded into the script but should be changed before use. The key allows the password to be decrypted ... |
combined_dataset/train/non-malicious/sample_48_70.ps1 | sample_48_70.ps1 | # Localized PlasterResources.psd1
ConvertFrom-StringData @'
###PSLOC
DestPath_F1=Destination path: {0}
ErrorFailedToLoadStoreFile_F1=Failed to load the default value store file: '{0}'.
ErrorProcessingDynamicParams_F1=Failed to create dynamic parameters from the template's manifest file. Template-based dynamic paramet... |
combined_dataset/train/non-malicious/GPRS Online log_8.ps1 | GPRS Online log_8.ps1 | <#
.SYNOPSIS
Get-GprsTime (V4.0 Update for Windows 7 and allow time correction)
(V4.2 'Interval' now incorporate previous 'FormatSpan' function)
Check the total connect time of any GPRS SIM devices from a specified date.
Use 'Get-Help .\\Get-GprsTime -full' to view Help for this script.
.DESCRIPTION... |
combined_dataset/train/non-malicious/Run-Query (SharePoint)_3.ps1 | Run-Query (SharePoint)_3.ps1 | function Run-Query($siteUrl, $queryText)
{
[reflection.assembly]::loadwithpartialname("microsoft.sharePOint") | out-null
[reflection.assembly]::loadwithpartialname("microsoft.office.server") | out-null
[reflection.assembly]::loadwithpartialname("microsoft.office.server.search") | out-null
$s = [microsoft.share... |
combined_dataset/train/non-malicious/2222.ps1 | 2222.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[ValidateNotNullOrEmpty()]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMessa... |
combined_dataset/train/non-malicious/sample_22_41.ps1 | sample_22_41.ps1 | #
# Module manifest for module 'OCI.PSModules'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
# ID u... |
combined_dataset/train/non-malicious/PowerShell CMatrix_1.ps1 | PowerShell CMatrix_1.ps1 | Set-StrictMode -off
#
# Module: PowerShell Console ScreenSaver Version 0.1
# Author: Oisin Grehan ( http://www.nivot.org )
#
# A PowerShell CMatrix-style screen saver for true-console hosts.
#
# This will not work in Micrisoft's ISE, Quest's PowerGUI or other graphical hosts.
# It should work fine in PowerShe... |
combined_dataset/train/non-malicious/sample_43_20.ps1 | sample_43_20.ps1 | let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl();
let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/aspire.eventHandlers.js"];
let currentScriptElement = document.querySelector("script[src='Scripts/aspire.plugin.js']");
if (currentScriptElement !== null) {
scrip... |
combined_dataset/train/non-malicious/sample_51_51.ps1 | sample_51_51.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/sample_33_49.ps1 | sample_33_49.ps1 | /*
Language: PowerShell
Description: PowerShell is a task-based command-line shell and scripting language built on .NET.
Author: David Mohundro <david@mohundro.com>
Contributors: Nicholas Blumhardt <nblumhardt@nblumhardt.com>, Victor Zhou <OiCMudkips@users.noreply.github.com>, Nicolas Le Gall <contact@nlegall.fr>
Websi... |
combined_dataset/train/non-malicious/sample_50_8.ps1 | sample_50_8.ps1 | #
# Module manifest for module 'OCI.PSModules.Jms'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jms.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_2_8.ps1 | sample_2_8.ps1 | # <copyright>
# INTEL CONFIDENTIAL
#
# Copyright 2021 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you ("License").
# Unless the License provides otherwise, you may not us... |
combined_dataset/train/non-malicious/app memory deltas.ps1 | app memory deltas.ps1 | ## Use ps to measure Application Memory Deltas
## Run '.\\ws_diff [Interval in Seconds] [Process Name] or
## to log all processes continually every 10 seconds -- 'while (1) {.\\WS_diff.ps1 10 cmd >> ps_out.txt }'
# Create args as Variables or Objects
$sleep_time = $args[0]
#$sleep_time = 10
# Create or defin... |
combined_dataset/train/non-malicious/Upgrade-VMToolsNoReboot.ps1 | Upgrade-VMToolsNoReboot.ps1 | #========================================================================
# Created on: 7/11/2012 3:59 PM
# Created by: Clint Jones
# Organization: Virtually Genius!
# Filename: Upgrade-VMToolsNoReboot
#========================================================================
Add-PSSnapin VMware.VimAutom... |
combined_dataset/train/non-malicious/Xml Module 6.1.ps1 | Xml Module 6.1.ps1 | #requires -version 2.0
# Improves over the built-in Select-XML by leveraging Remove-XmlNamespace http`://poshcode.org/1492
# to provide a -RemoveNamespace parameter -- if it's supplied, all of the namespace declarations
# and prefixes are removed from all XML nodes (by an XSL transform) before searching.
# IMP... |
combined_dataset/train/non-malicious/sample_42_93.ps1 | sample_42_93.ps1 | ## Copyright (c) Microsoft Corporation. All rights reserved.
<#
.SYNOPSIS
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans.
.DESCRIPTION
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans. These performance recordings contain Microsoft-Antimal... |
combined_dataset/train/non-malicious/sample_13_71.ps1 | sample_13_71.ps1 | # ***********************************************************************************************
# File: utils_ConfigMgr12-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 variables/functions. View utils_ConfigM... |
combined_dataset/train/non-malicious/3882.ps1 | 3882.ps1 |
function Test-WorkspaceCreateUpdateDelete
{
$wsname = Get-ResourceName
$rgname = Get-ResourceGroupName
$wslocation = Get-ProviderLocation
New-AzResourceGroup -Name $rgname -Location $wslocation -Force
$workspace = New-AzOperationalInsightsWorkspace -ResourceGroupName $rgname -N... |
combined_dataset/train/non-malicious/Get-Parameter 2.6.ps1 | Get-Parameter 2.6.ps1 | #Requires -version 2.0
#.Synopsis
# Enumerates the parameters of one or more commands
#.Notes
# With many thanks to Hal Rottenberg, Oisin Grehan and Shay Levy
# Version 0.80 - April 2008 - By Hal Rottenberg http://poshcode.org/186
# Version 0.81 - May 2008 - By Hal Rottenberg http://poshcode.org/255
# Ver... |
combined_dataset/train/non-malicious/sample_59_22.ps1 | sample_59_22.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/185.ps1 | 185.ps1 |
$childWI_ReviewerActivityHasReviewers_Class_id = '6e05d202-38a4-812e-34b8-b11642001a80'
$childWI_ReviewerActivityHasReviewers_Class_obj = Get-SCSMRelationshipClass -id $childWI_ReviewerActivityHasReviewers_Class_id
$childWI_ReviewerisUser_Class_id = '90da7d7c-948b-e16e-f39a-f6e3d1ffc921'
$childWI_ReviewerisUser_Cla... |
combined_dataset/train/non-malicious/4222.ps1 | 4222.ps1 |
$sploaded = $null
Function Get-ServicePerms {
if ($sploaded -ne "TRUE") {
$script:sploaded = "TRUE"
echo "Loading Assembly"
$i = "TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQR... |
combined_dataset/train/non-malicious/sample_53_86.ps1 | sample_53_86.ps1 | #
# Module manifest for module 'OCI.PSModules.Dataflow'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dataflow.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_37_61.ps1 | sample_37_61.ps1 | E接続を確立できませんでした: キャッシュされた資格情報の有効期限が切れているか、パスワードが更新されました。資格情報を再入力してください。3PowerBI 環境の検出を試みている間に、URL '%{strURL/}' への接続に失敗しました。.応答形式が正しくないため、PowerBI バックエンド エンドポイントの検索が失敗しました。CertGetNameStringW を呼び出せませんでした。証明書チェーンを検証できませんでした。*拇印 '%{strThumbprint/}' の証明書の発行者は信頼されていません。cこのサーバー インスタンスは、Schannel 証明書 (ServerSchannelTokenSignerC... |
combined_dataset/train/non-malicious/Get-InstalledSoftware.ps.ps1 | Get-InstalledSoftware.ps.ps1 | ##############################################################################\n##\n## Get-InstalledSoftware\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\nLi... |
combined_dataset/train/non-malicious/Run-Defrag.ps1 | Run-Defrag.ps1 | # Run-Defrag
# Defragments the targeted hard drives.
#
# Args:
# $server: A target Server 2003 or 2008 system
# $drive: An optional drive letter. If this is blank then all
# drives are defragmented
# $force: If this switch is set then a defrag will be forced
# even if the drive is lo... |
combined_dataset/train/non-malicious/sample_26_19.ps1 | sample_26_19.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 = '80.0.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/2342.ps1 | 2342.ps1 | [CmdletBinding(DefaultParameterSetName = 'None')]
[OutputType()]
param
(
[Parameter(ParameterSetName = 'DomainController')]
[ValidateNotNullOrEmpty()]
[string[]]$DomainController,
[Parameter()]
[ValidateNotNullOrEmpty()]
[ValidateSet('DnsForwarders', 'DnsDelegation', 'DnsDynamicUpdate', 'DnsRecordRegistration',... |
combined_dataset/train/non-malicious/sample_60_30.ps1 | sample_60_30.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcescheduler'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcescheduler.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Support... |
combined_dataset/train/non-malicious/New-ElevatedTask.ps1 | New-ElevatedTask.ps1 | #requires -version 2.0
####################################################################################################
## Version History
## 2.0 - First version with shortcut support
## - Still weak on documentation of the arguments, sorry ...
## 2.5 - Improved defaults and documentation (run with -?)
##... |
combined_dataset/train/non-malicious/2936.ps1 | 2936.ps1 | Task default -depends CheckGetPSakeScriptTasks
function Assert-EqualArrays($a, $b, $message)
{
$differences = @(Compare-Object $a $b -SyncWindow 0)
if ($differences.Length -gt 0)
{
$differences
}
Assert ($differences.Length -eq 0) "$message : $($differences.Length) differences found."
}
fu... |
combined_dataset/train/non-malicious/467.ps1 | 467.ps1 |
Update-TypeData -TypeName "System.Collections.Concurrent.ConcurrentDictionary``2[[$([System.String].AssemblyQualifiedName)],[$([PSFramework.Configuration.Config].AssemblyQualifiedName)]]" -MemberType ScriptMethod -MemberName Remove -Value ([scriptblock]::Create(@'
param (
$Item
)
$dummyItem = $null
$null = $this.... |
combined_dataset/train/non-malicious/Find Local Group Members_9.ps1 | Find Local Group Members_9.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_2_85.ps1 | sample_2_85.ps1 | #
# Module manifest for module 'OCI.PSModules.Lockbox'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Lockbox.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/2929.ps1 | 2929.ps1 | Framework '4.5.1x86'
task default -depends MsBuild
task MsBuild {
if ( $IsMacOS -OR $IsLinux ) {}
else {
$output = &msbuild /version /nologo 2>&1
Assert ($output -NotLike '12.0') '$output should contain 12.0'
}
}
|
combined_dataset/train/non-malicious/2785.ps1 | 2785.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(Entry) as ct,
Entry
FROM
*DNSCache.csv
GROUP BY
Entry
ORDER BY
ct ASC
"@
& logparser -stats:off -i:csv -dtlines:0 -rtp:-1 "$lpquery"
} else {
$ScriptName = [System.IO.Path]::GetFileName($... |
combined_dataset/train/non-malicious/3480.ps1 | 3480.ps1 |
function Create-ResourceGroupForTest ($location = 'westus')
{
$rgName = Get-ResourceGroupNameForTest
$rg = New-AzResourceGroup -Name $rgName -Location $location -Force
return $rg
}
function Remove-ResourceGroupForTest ($rg)
{
Remove-AzResourceGroup -Name $rg.ResourceGroupName -Force
}
function Cr... |
combined_dataset/train/non-malicious/3006.ps1 | 3006.ps1 | Set-StrictMode -Version Latest
Describe 'Testing Gherkin Step' -Tag Gherkin {
It 'Generates a function named "GherkinStep" with mandatory name and test parameters' {
$command = &(Get-Module Pester) { Get-Command GherkinStep -Module Pester }
$command | Should -Not -Be $null
$parameter = $co... |
combined_dataset/train/non-malicious/sample_27_16.ps1 | sample_27_16.ps1 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apa... |
combined_dataset/train/non-malicious/sample_6_36.ps1 | sample_6_36.ps1 | [dynamic, provider("dcismprovider"), Association]
class DCIM_SPHostedRBAPService : DCIM_SPHostedService
{
[
Description ("Dependent represents the object that is dependent on the Antecedent."),
Override ("Dependent"),
Required,
Weak
]
CIM_Service REF Dependent;
... |
combined_dataset/train/non-malicious/sample_21_52.ps1 | sample_21_52.ps1 | ConvertFrom-StringData @'
id_activity_utils=Initializing Diagnostics
id_utils_init=Gathering environment details and detecting roles...
'@
# SIG # Begin signature block
# MIIoQgYJKoZIhvcNAQcCoIIoMzCCKC8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQ... |
combined_dataset/train/non-malicious/3540.ps1 | 3540.ps1 |
function Test-AzureSqlGetContainers
{
$vault = Get-AzRecoveryServicesVault -ResourceGroupName "sqlpaasrg" -Name "sqlpaasrn";
$containers = Get-AzRecoveryServicesBackupContainer `
-VaultId $vault.ID `
-ContainerType "AzureSQL" `
-BackupManagementType "AzureSQL";
Assert-AreEqual $containers[0].Na... |
combined_dataset/train/non-malicious/sample_40_1.ps1 | sample_40_1.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 = '82.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_64_46.ps1 | sample_64_46.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
##
## TODO: Refactor the cer... |
combined_dataset/train/non-malicious/sample_42_18.ps1 | sample_42_18.ps1 | @{
GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Start-Transcript", "Stop-Transcript"
AliasesTo... |
combined_dataset/train/non-malicious/sample_31_19.ps1 | sample_31_19.ps1 |
# ENV
# WARNING: these need to be setup by your launch script or CI/CD
$env:TEST_DEVICE_HOSTNAME = "verdin-imx8mp-14773124"
$env:TEST_DEVICE_LOGIN = "torizon"
$env:TEST_DEVICE_PASSWORD = "123"
$env:TEST_DEVICE_ARCH = "arm64"
$env:TEST_DEVICE_IP = "192.168.31.242"
# If "true" local debug is performed, if false remote d... |
combined_dataset/train/non-malicious/Test-UserCredential_1.ps1 | Test-UserCredential_1.ps1 | function Test-UserCredential {
[CmdletBinding()] [OutputType([System.Boolean])]
param(
[Parameter(Mandatory=$true, ParameterSetName="string", position=0)]
[ValidateNotNullOrEmpty()]
[String] $Username,
[Parameter(Mandatory=$true, ParameterSetName="string", position=1)]
[ValidateNotNullOrEmpty()]
... |
combined_dataset/train/non-malicious/sample_52_39.ps1 | sample_52_39.ps1 | # a simple PowerShell script to update icons in the resources/icons directory
# the original icons are loaded from https://github.com/microsoft/fabric-samples/blob/main/docs-samples/Icons.zip
$rootPathMono = Get-Item -Path "./resources/icons/mono"
$monoIcons = $rootPathMono | Get-ChildItem -Recurse -Include *.svg
... |
combined_dataset/train/non-malicious/Start-BootsTimer_3.ps1 | Start-BootsTimer_3.ps1 | Add-BootsFunction -Type "System.Windows.Threading.DispatcherTimer"
function Start-BootsTimer {
#.Syntax
# Creates a stay-on-top countdown timer
#.Description
# A WPF borderless count-down timer, with audio/voice alarms and visual countdown + colored progress indication
#.Parameter EndMessage
# The message t... |
combined_dataset/train/non-malicious/chkhash_14.ps1 | chkhash_14.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... |
combined_dataset/train/non-malicious/1005.ps1 | 1005.ps1 |
$myTopic = "<your-custom-topic-name>"
$myResourceGroup = "<resource-group-name>"
New-AzResourceGroup -Name $myResourceGroup -Location westus2
New-AzEventGridTopic -ResourceGroupName $myResourceGroup -Name $myTopic -Location westus2
$endpoint = (Get-AzEventGridTopic -ResourceGroupName $myResourceGroup -Name $m... |
combined_dataset/train/non-malicious/1549.ps1 | 1549.ps1 | function Test-Port{
[cmdletbinding(
DefaultParameterSetName = '',
ConfirmImpact = 'low'
)]
Param(
[Parameter(
Mandatory = $True,
Position = 0,
ParameterSetName = '',
ValueFromPipeline = $True)]
[array]$computer,
... |
combined_dataset/train/non-malicious/sample_32_83.ps1 | sample_32_83.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_44_44.ps1 | sample_44_44.ps1 | #
# Module manifest for module 'Microsoft.SME.StorageReplica'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.StorageReplica.psm1'
# Version number of this module.
ModuleVersion = '4.3.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID u... |
combined_dataset/train/non-malicious/1110.ps1 | 1110.ps1 |
$siteName = 'CarbonSetIisHttpHeader'
$sitePort = 47938
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
Install-IisWebsite -Name $siteName -Path $TestDir -Binding ('http/*:{0}:*' -f $sitePort)
}
function Stop-Test
{
... |
combined_dataset/train/non-malicious/sample_22_0.ps1 | sample_22_0.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.Synopsis
Group Policy tools use administrative template files (.admx, .adml) to populate policy settings in the user interface.
This allows administrators to manage registry-based policy settings.
This script installes Powe... |
combined_dataset/train/non-malicious/Snapshot VM in a folder.ps1 | Snapshot VM in a folder.ps1 | #Revision 1
#7-29-2008
#author Jon Owings
#contact - jowings at securas dot com
#
#Create a snapshot of all the vm's in a folder,
#be sure to change to match your enviroment. use at your own risk, snapshots have been known to
#cause certain configurations to lock (freeze) so test in a dev enviroment first.
#... |
combined_dataset/train/non-malicious/Set-LocalPassword.ps1 | Set-LocalPassword.ps1 | # Sets local account passwords on one or more computers
# usage [computerName1,computerName2,... | ] ./Set-LocalPassword.ps1 [-user] <userName> [-password] <password> [[-computers] computerName1,computerName2,...]
param(
[string] $User
, [string] $Password
, [string[]] $ComputerNames = @()
)
$ComputerN... |
combined_dataset/train/non-malicious/4246.ps1 | 4246.ps1 | function Invoke-Portscan
{
[CmdletBinding()]Param (
[Parameter(ParameterSetName="cmdHosts",
ValueFromPipeline=$True,
Mandatory = $True)]
[String[]] $Hosts,
[Parameter(ParameterSetName="fHosts",
Mandatory = $True... |
combined_dataset/train/non-malicious/sample_51_33.ps1 | sample_51_33.ps1 | #
# Module manifest for module 'Microsoft.SME.FileExplorer'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.FileExplorer.psm1'
# Version number of this module.
ModuleVersion = '4.14.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used... |
combined_dataset/train/non-malicious/4049.ps1 | 4049.ps1 |
@{
ShowModuleLoadDetails = $false
CD_GetChildItem = $false
CD_EchoNewLocation = $false
TextEditor = 'Notepad.exe'
PromptTheme = 'Modern... |
combined_dataset/train/non-malicious/sample_39_93.ps1 | sample_39_93.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/sample_49_67.ps1 | sample_49_67.ps1 | #
# Module manifest for module 'OCI.PSModules.Waas'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waas.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/3125.ps1 | 3125.ps1 |
function Clear-ARPCache
{
[CmdletBinding()]
param(
)
Begin{
if(-not([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator"))
{
Write-Warning -Message "Administrator r... |
combined_dataset/train/non-malicious/sample_57_71.ps1 | sample_57_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Oda'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Oda.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/2538.ps1 | 2538.ps1 |
param(
$SQLServer = 'STGSQLDOC710',
$ScriptDir = '\\xfs3\DataManagement\Footprints\31177',
$Beta = 1,
[String[]] $DatabaseList,
$FilePrefix = 'Log',
[switch]$Log
)
$SQuery = "SELECT StageDB FROM ClientConnection WHERE Beta = " + $Beta
$DQuery = "SELECT ReportDB FROM ClientConnection WHERE Beta = " + $Beta + "... |
combined_dataset/train/non-malicious/1644.ps1 | 1644.ps1 |
function Get-ChromeExtension {
param (
[string]$ComputerName = $env:COMPUTERNAME
)
Get-ChildItem "\\$ComputerName\c$\users\*\appdata\local\Google\Chrome\User Data\Default\Extensions\*\*\manifest.json" -ErrorAction SilentlyContinue | % {
$path = $_.FullName
$_.FullName -match 'user... |
combined_dataset/train/non-malicious/SVMotion-VM_2.ps1 | SVMotion-VM_2.ps1 | # author: Hal Rottenberg
# Website/OpenID: http://halr9000.com
# purpose: does "real" SVMotion of a VM
# usage: get-vm | SVMotion-VM -destination (get-datastore foo)
function SVMotion-VM {
param(
[VMware.VimAutomation.Client20.DatastoreImpl]$destination
)
Begin {
$datastoreView = Get-View -VIObject $d... |
combined_dataset/train/non-malicious/3468.ps1 | 3468.ps1 |
function Test-RedisCache
{
$resourceGroupName = "PowerShellTest-1"
$cacheName = "redisteam001"
$location = "West US"
New-AzResourceGroup -Name $resourceGroupName -Location $location
$cacheCreated = New-AzRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -Location $l... |
combined_dataset/train/non-malicious/Monitor-FileSize_1.ps1 | Monitor-FileSize_1.ps1 | function Monitor-FileSize
{
<#
.Synopsis
Checks the file size of a given file until it reaches the specified size
.Description
Checks the file size of a given file until it reaches the specified size. AT that point, it alerts the user as to what the original file-size-boundry was and what it currentl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.