full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/Password Gen Form V2.ps1 | Password Gen Form V2.ps1 | $rs=[RunspaceFactory]::CreateRunspace()
$rs.ApartmentState = "STA"
$rs.ThreadOptions = "ReuseThread"
$rs.Open()
$ps = [PowerShell]::Create()
$ps.Runspace = $rs
$ps.Runspace.SessionStateProxy.SetVariable("pwd",$pwd)
[void]$ps.AddScript({
#Load Required Assemblies
Add-Type –assemblyName Presentation... |
combined_dataset/train/non-malicious/3358.ps1 | 3358.ps1 | function Get-AzureRmResourceGroup
{
[CmdletBinding()]
[Alias("Get-AzResourceGroup")]
param(
[string] [Parameter(Position=0, ValueFromPipelineByPropertyName=$true)] [alias("ResourceGroupName")] $Name,
[string] [Parameter(Position=1, ValueFromPipelineByPropertyName=$true)] $Location,
[string] [Parameter... |
combined_dataset/train/non-malicious/sample_64_21.ps1 | sample_64_21.ps1 | #!/usr/bin/env pwsh
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... |
combined_dataset/train/non-malicious/sample_3_40.ps1 | sample_3_40.ps1 | #*************************************************************
# Name: DC_NetdomFSMO.ps1
# Version: 1.0.0
# Date: 2/5/12
# Author: David Fisher (CSS)
# Description: Determines the local Domain's FSMO role owners
#*************************************************************
# detect OS version and SKU #_... |
combined_dataset/train/non-malicious/1364.ps1 | 1364.ps1 |
function Read-CFile
{
[CmdletBinding()]
[OutputType([string])]
param(
[Parameter(Mandatory=$true)]
$Path,
[int]
$MaximumTries = 30,
[int]
$RetryDelayMilliseconds = 100,
[Switch]
$Raw
)
Set-S... |
combined_dataset/train/non-malicious/1928.ps1 | 1928.ps1 |
Describe "Trace-Command" -tags "CI" {
Context "Listener options" {
BeforeAll {
$logFile = New-Item "TestDrive:/traceCommandLog.txt" -Force
$actualLogFile = New-Item "TestDrive:/actualTraceCommandLog.txt" -Force
}
AfterEach {
Remove-Item "TestDrive:/t... |
combined_dataset/train/non-malicious/VerifyCategoryRule.ps1 | VerifyCategoryRule.ps1 | ## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n\nSet-StrictMode -Version Latest\n\nif($message.Body -match "book")\n{\n [Console]::WriteLine("This is a message about the book.")\n}\nelse\n{\n [Console]::WriteLine("This is an unknown message.")\n}
|
combined_dataset/train/non-malicious/sample_4_31.ps1 | sample_4_31.ps1 | #************************************************
# DC_CollectSqllogs.ps1
# Version 1.0.0
# Date: 10-2011
#
# Description:
# Collects SQL Server errorlogs and SQL Server Agent logs for all installed instances passed to script via the $Instances parameter
# Can operate in "offline" mode where errorlog files ... |
combined_dataset/train/non-malicious/sample_7_58.ps1 | sample_7_58.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#####################################################################################################
#
# Registers the WinRM endpoint for this instance of PowerShell.
#
# If the parameters '-PowerShellHome' were specified, it means that t... |
combined_dataset/train/non-malicious/710.ps1 | 710.ps1 |
function New-RsRestCredentialsByUserObject
{
[CmdletBinding()]
param(
[Alias('DisplayText')]
[string]
$PromptMessage,
[Alias('UseAsWindowsCredentials')]
[switch]
$WindowsCredentials
)
Process
{
return @{
"DisplayText" = $Pr... |
combined_dataset/train/non-malicious/3586.ps1 | 3586.ps1 |
function Test-SpatialAnchorsAccountOperations
{
$resourceGroup = TestSetup-CreateResourceGroup
$resourceLocation = "EastUS2"
$accountName = getAssetName
$createdAccount = New-AzSpatialAnchorsAccount -ResourceGroupName $resourceGroup.ResourceGroupName -Name $accountName -Location $resourc... |
combined_dataset/train/non-malicious/sample_17_43.ps1 | sample_17_43.ps1 | #
# Module manifest for module 'OCI.PSModules.Managementdashboard'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Managementdashboard.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Sup... |
combined_dataset/train/non-malicious/sample_30_76.ps1 | sample_30_76.ps1 | https://vortex.data.microsoft.com/collect/v1
Content-Type:application/x-json-stream
Content-Encoding:gzip
H4sIAAAAAAAEAO2dW3NbN7ag36dq/oNKdR5m6hgU7hfnieLlxNNx2mM5SZ/pdHXhKrNDkWpuSrE71f99FjZJiZRIalMXy7SQpByaBLBxWVjrAzaw1h+HI3sWD18fvh34ybgap2mrfX4+HHg7HYxHb0bV4PTjtGrZQWKEeheUMcE57rm2KljmPbWGEe8UbvUu42h6+OpwOqgLpJhyh... |
combined_dataset/train/non-malicious/1997.ps1 | 1997.ps1 |
Describe "InvokeOnRunspace method argument error handling" -tags "Feature" {
BeforeAll {
$command = [System.Management.Automation.PSCommand]::new()
$localRunspace = $host.Runspace
}
It "Null argument exception should be thrown for null PSCommand argument" {
{ [System.Management.A... |
combined_dataset/train/non-malicious/sample_55_32.ps1 | sample_55_32.ps1 | param(
[Parameter(Mandatory = $true)]
[string[]]$paths,
[int]$retry_count = 0
)
# Delete paths using parallel jobs.
$jobs = $paths | ForEach-Object {
Start-Job -ScriptBlock {
param(
[string]$path,
[int]$retry_count = 0
)
if (Test-Path -Lit... |
combined_dataset/train/non-malicious/sample_65_89.ps1 | sample_65_89.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
#requires -Version 4.0
#requires -Module CloudD... |
combined_dataset/train/non-malicious/sample_31_23.ps1 | sample_31_23.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=找不到所需的 PowerShell 模块(FailoverClusters)。使用“角色和功能”工具安装: 远程服务器管理工具 | 功能管理工具 | 故障转移群集工具 | Windows PowerShell 故障转移群集模块。
HyperVModuleRequired=找不到所需的 PowerShell 模块(Hyper-V)。使用“角色和功能”工具安装: 远程服务器管理工具 | 角色管理工具 | Hyper-V 管理工具 | Windows PowerShell Hyper-V 模块。
CimCmdletsMo... |
combined_dataset/train/non-malicious/568.ps1 | 568.ps1 |
function Add-SPOWebpart
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$pageUrl,
[Parameter(Mandatory=$true, Position=2)]
[string]$zone,
[Parameter(Mandatory=$true, Position=3)]
[int]$order,
[Parameter(Mandatory=$true, Position=4)]
[string]$webPart... |
combined_dataset/train/non-malicious/sample_4_69.ps1 | sample_4_69.ps1 | #************************************************
# Rule ID 29 from http://sharepoint/sites/diag/Rules/_layouts/listform.aspx?PageType=4&ListId=%7b1F944AAF-10B3-4442-8AA8-4A1EF2B0F5F8%7d&ID=29&ContentTypeID=0x0100969570CC59987E4BADAD7118A311DB4D
#************************************************
# TS_ClusterCNOCheck.... |
combined_dataset/train/non-malicious/Get-CrawlHealth (MOSS)_2.ps1 | Get-CrawlHealth (MOSS)_2.ps1 | [reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server.Search") | out-null
@@#NOTE: I've set strict crawl freshness/crawl duration/success rati... |
combined_dataset/train/non-malicious/UIAutomation 1.9.ps1 | UIAutomation 1.9.ps1 | ## UI Automation v 1.8 -- REQUIRES the Reflection module (current version: http://poshcode.org/3174 )
##
# WASP 2.0 is getting closer, but this is still just a preview:
# -- a lot of the commands have weird names still because they're being generated ignorantly
# -- eg: Invoke-Toggle.Toggle and Invoke-Invoke.Invo... |
combined_dataset/train/non-malicious/Add-SqlTable.ps1 | Add-SqlTable.ps1 | try {add-type -AssemblyName "Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop}
catch {add-type -AssemblyName "Microsoft.SqlServer.Smo"}
#######################
function Get-SqlType
{
param([string]$TypeName)
switch ($TypeName)
{
'Bool... |
combined_dataset/train/non-malicious/sample_39_14.ps1 | sample_39_14.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
function Register-EditorCommand {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]$Name,
... |
combined_dataset/train/non-malicious/1611.ps1 | 1611.ps1 |
function Create-LocalUser {
param (
[string]$computer = $env:computername,
[string]$fullname,
[string]$username,
[string]$password,
[switch]$passworddoesnotexpire,
[string]$addtogroup = 'Administrators',
[switch]$CheckFirst = $true
)
if (!$username... |
combined_dataset/train/non-malicious/Findup_12.ps1 | Findup_12.ps1 | using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.IO;
namespace Findup
{
public class FileInfoExt
{
public FileInfoExt(FileInfo fi)
... |
combined_dataset/train/non-malicious/sample_29_22.ps1 | sample_29_22.ps1 | ConvertFrom-StringData @'
IPAddressDisplayNameFormat=IP 地址: {0}
NetworkNameDisplayNameFormat=名称: {0}
NetworkNameOfflineDisplayNameFormat=IP 地址:“{0}”上的地址
CreateClusterProgressValidationStart=正在验证故障转移群集的服务器适用性。
CreateClusterProgressValidationEnd=验证故障转移群集的服务器适用性完成。
CreateClusterProgressCreationStartFormat=正在创建故障转移群集... |
combined_dataset/train/non-malicious/sample_49_20.ps1 | sample_49_20.ps1 | export function setControlAttribute(id, attrName, value) {
const fieldElement = document.querySelector("#" + id)?.shadowRoot?.querySelector(".selected-value");
if (!!fieldElement) {
fieldElement?.setAttribute(attrName, value);
}
}
// SIG // Begin signature block
// SIG // MIInzAYJKoZIhvcN... |
combined_dataset/train/non-malicious/sample_27_65.ps1 | sample_27_65.ps1 | /*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
define("vs/languages/typescript/participants/nlsParticipant.nls.keys",[],{vs_languages_typescript_participants_nlsParticipant:{path:"vs... |
combined_dataset/train/non-malicious/Find old snapshots.ps1 | Find old snapshots.ps1 | param ( $Age = 30 )
Connect-VIServer vcenter.domain.com
$vm = Get-VM
$snapshots = Get-Snapshot -VM $vm
Write-Host -ForegroundColor Red "Old snapshots found:"
foreach ( $snap in $snapshots ) {
if ( $snap.Created -lt (Get-Date).AddDays( -$Age ) ) {
Write-Host "Name: " $snap.Name " Size: " $snap.SizeMB " Cre... |
combined_dataset/train/non-malicious/sample_6_64.ps1 | sample_6_64.ps1 | #************************************************
# TS_DefaultDynamicPortChanged.ps1
# Version 1.0.1
# Date: 5/8/2013
# Author: v-kaw
# Description: [Idea ID 5438] [Windows] Windows 2012 Hyper-V SPN and SCP not registered if customer uses a non default dynamicportrange
# Rule number: 5438
# Rule URL: http://s... |
combined_dataset/train/non-malicious/sample_31_91.ps1 | sample_31_91.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/Get-Parameter 2.4.ps1 | Get-Parameter 2.4.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/Get-MemoryChart_1.ps1 | Get-MemoryChart_1.ps1 | #.Synopsis
# Draw pie charts of server memory usage by process
#.Description
# Uses PowerBoots to draw a pipe-chart of each computer's memory use. While you wait for that information
# to be gathered, it shows you the latest xkcd comic. ##DEPEND-ON -Function Get-Comic http://poshcode.org/1003
# Uses the Tra... |
combined_dataset/train/non-malicious/sample_7_54.ps1 | sample_7_54.ps1 | # Sample diagnostic function
#
# Wrapped in a region same name as function name
# Change the name and code as needed
#
# You can test your diagnostic function by running xray in developer mode, e.g.:
# .\xray.ps1 -Diagnostic net_dnscli_KB4562541_sample -DevMode
#region net_dnscli_KB4562541_sample
<#
Compone... |
combined_dataset/train/non-malicious/sample_35_44.ps1 | sample_35_44.ps1 | ;!@Lang2@!UTF-8!
; 4.07 : Dinamiteru
;
;
;
;
;
;
;
;
;
;
0
7-Zip
Asturian
Asturianu
401
Val
Torgar
&Si
&Non
&Zarrar
Axuda
&Siguir
440
Si a &Too
Non a T&oo
Parar
Reentamar
&De fondu
&En primer planu
&Posar
Posao
¿Tas fixu que quies paralo?
500
F&icheru
&Remanar
&Ver
F&avoritos
&Ferramientes
A&xuda
540
&Abrir
Abrir ... |
combined_dataset/train/non-malicious/3589.ps1 | 3589.ps1 |
function Get-ResourceGroupName
{
return "azurermsfrg";
}
function Get-ClusterName
{
return "azurermsfclustertest";
}
function Get-NodeTypeName
{
return "nt1vm";
}
function Get-KeyVaultName
{
return "azurermsfkvtest";
}
function Get-NewCertName
{
return "... |
combined_dataset/train/non-malicious/Get-DiskUsage_1.ps1 | Get-DiskUsage_1.ps1 | ##############################################################################\n##\n## Get-DiskUsage\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\nRetrieve i... |
combined_dataset/train/non-malicious/sample_45_42.ps1 | sample_45_42.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_4_32.ps1 | sample_4_32.ps1 | #************************************************
# DC_CollectSqllogs.ps1
# Version 1.0.0
# Date: 10-2011
#
# Description:
# Collects SQL Server errorlogs and SQL Server Agent logs for all installed instances passed to script via the $Instances parameter
# Can operate in "offline" mode where errorlog files ... |
combined_dataset/train/non-malicious/Transparent Glass Posh.ps1 | Transparent Glass Posh.ps1 | #include <Misc.au3>
#include <Process.au3>
#Include <WinAPI.au3>
Opt("TrayIconHide",1)
Global Const $HSHELL_WINDOWCREATED = 1
Global Const $HSHELL_WINDOWACTIVATED = 4;
Global Const $HWND_MESSAGE = -3
Global $bHook = 1
$hGui = GUICreate("", 10, 10, -1, 0,-1,-1,$HWND_MESSAGE)
GUIRegisterMsg(_WinAPI_Registe... |
combined_dataset/train/non-malicious/2326.ps1 | 2326.ps1 |
function New-ScreenShot
{
[OutputType([System.IO.FileInfo])]
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[ValidateScript({ -not (Test-Path -Path $_ -PathType Leaf) })]
[ValidatePattern('\.jpg|\.jpeg|\.bmp')]
[string]$FilePath
)
begin {
$ErrorActionPreference = '... |
combined_dataset/train/non-malicious/2307.ps1 | 2307.ps1 | param ([string]$ProcessName)
$API = New-Object -ComObject 'MOM.ScriptAPI'
$PropertyBag = $API.CreatePropertyBag()
try {
$Process = Get-WmiObject -Class 'Win32_Process' -Filter "Name = '$ProcessName'"
if (!$Process) {
$PropertyBag.AddValue('State', 'Critical')
$PropertyBag.Addvalue('Description', "The process '$... |
combined_dataset/train/non-malicious/sample_34_63.ps1 | sample_34_63.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 = '81.0.0'
# Supported... |
combined_dataset/train/non-malicious/558.ps1 | 558.ps1 |
function Join-SPOParts
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$false, Position=1)]
$Parts = $null,
[Parameter(Mandatory=$false, Position=2)]
$Separator = ''
)
$returnValue = (($Parts | ? { $_ } | % { ([string]$_).trim($Separator) } | ? { $_ } ) -join $Separator)
... |
combined_dataset/train/non-malicious/sample_12_54.ps1 | sample_12_54.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/549.ps1 | 549.ps1 |
function Switch-SPOEnableDisableSolution
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$solutionName,
[Parameter(Mandatory=$true, Position=2)]
[bool]$activate
)
$solutionId = Get-SPOSolutionId -solutionName $solutionName
$operation = ""
if($activate)... |
combined_dataset/train/non-malicious/2c54f592-a435-48e1-9591-e9667f707941.ps1 | 2c54f592-a435-48e1-9591-e9667f707941.ps1 | <#
Name: VHDFunctions.psm1
Author: Rich Kusak (rkusak@cbcag.edu)
Created: 2009-10-23
LastEdit: 2009-11-02 15:54
Included Functions:
Dismount-VHD
Initialize-VHD
Mount-VHD
New-VHD
Set-VHDBootConfiguration
Test-VHD
#>
<#
.SYNOPSIS
Dismount a VHD file from the system.
.DESCRIPTION
This f... |
combined_dataset/train/non-malicious/293.ps1 | 293.ps1 | function Test-PSFFunctionInterrupt
{
[OutputType([System.Boolean])]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Test-PSFFunctionInterrupt')]
Param (
)
$psframework_killqueue -contains (Get-PSCallStack)[1].InvocationInfo.GetHashCode()
} |
combined_dataset/train/non-malicious/Logger_1.psm1 0.2.ps1 | Logger_1.psm1 0.2.ps1 | <#
Name : Universal Log4Net Logging Module (Logger.psm1)
Version : 0.3
Author : Joel Bennett (MVP)
Site : http://www.HuddledMasses.org/
Version History:
0.3 - Cleanupable release.
Added Udp, Email, Xml and RollingXml, as well as a "Chainsaw":http`://logging.apache.org/log... |
combined_dataset/train/non-malicious/sample_12_24.ps1 | sample_12_24.ps1 | # Copyright 2008, Microsoft Corporation. All rights reserved.
PARAM([string]$MachineName = $ComputerName,[string]$Path= $null)
if($debug -eq $true){[void]$shell.popup("Run DC_DeploymentLogsLogs.ps1")}
Import-LocalizedData -BindingVariable DeploymentLogsStrings
Write-DiagProgress -Activity $DeploymentLogsS... |
combined_dataset/train/non-malicious/3160.ps1 | 3160.ps1 |
function Get-FederationEndpoint{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true,
HelpMessage="Domain name to get the ADFS endpoint for.")]
[string]$domain,
[Parameter(Mandatory=$false,
HelpMessage="Flag for authentication command output.")]
[switc... |
combined_dataset/train/non-malicious/sample_38_77.ps1 | sample_38_77.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Get-AMT3PDS {
<#
.Synopsis
Retrieves data from the Intel Active Management Technology Third Party Data Storage
.Description
This CmdLet enables the user to retreive data from Intel Active Management Technology (AMT) Third ... |
combined_dataset/train/non-malicious/d25bbfc1-3d3f-42bb-a09e-67e69e89a865.ps1 | d25bbfc1-3d3f-42bb-a09e-67e69e89a865.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/143.ps1 | 143.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aa... |
combined_dataset/train/non-malicious/sample_66_65.ps1 | sample_66_65.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="E:\艺施胡\alova-devtools\node_modules\.pnpm\typescript@5.5.3\node_modules\typescript\bin\node_modules;E:\艺施胡\alova-devtools\node_modules\.pnpm\typescript@5.5.3\node_modules... |
combined_dataset/train/non-malicious/sample_54_83.ps1 | sample_54_83.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/VMware Lab Manager 4.x.ps1 | VMware Lab Manager 4.x.ps1 | function Ignore-SslErrors {
# Create a compilation environment
$Provider=New-Object Microsoft.CSharp.CSharpCodeProvider
$Compiler=$Provider.CreateCompiler()
$Params=New-Object System.CodeDom.Compiler.CompilerParameters
$Params.GenerateExecutable=$False
$Params.GenerateInMemory=$True
$Params.IncludeDebugIn... |
combined_dataset/train/non-malicious/3422.ps1 | 3422.ps1 |
function Test-AzureProviderFeature
{
$defaultProviderFeatures = Get-AzureRmProviderFeature
$allProviderFeatures = Get-AzureRmProviderFeature -ListAvailable
Assert-True { $allProviderFeatures.Length -gt $defaultProviderFeatures.Length }
$batchFeatures = Get-AzureRmProviderFeature -Provi... |
combined_dataset/train/non-malicious/1502.ps1 | 1502.ps1 |
function Assert-Contains
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[object]
$Haystack,
[Parameter(Position=1)]
[object]
$Needle,
[Parameter(Position=2)]
[string]
$Message
)
... |
combined_dataset/train/non-malicious/Sync-Time_3.ps1 | Sync-Time_3.ps1 | function sync-time(
[string] $server = "sync-time 0.pool.ntp.org, clock.psu.edu",
[int] $port = 37)
{
$servertime = get-time -server $server -port $port -set
#leave off -set to just check the remote time
write-host "Server time:" $servertime
write-host "Local time :" $(date)
}
|
combined_dataset/train/non-malicious/Save-CurrentFile (ISE).ps1 | Save-CurrentFile (ISE).ps1 | function Save-CurrentFile ($path)
{
$psISE.CurrentFile.SaveAs($path)
$psISE.CurrentFile.Save([Text.Encoding]::default)
}
# Save-CurrentFile '.\\Save-CurrentFile.ps1'
|
combined_dataset/train/non-malicious/1821.ps1 | 1821.ps1 |
Describe "Tests for -NoNewline parameter of Out-File, Add-Content and Set-Content" -tags "Feature" {
It "NoNewline parameter works on Out-File" {
$temp = "${TESTDRIVE}/test1.txt"
1..5 | Out-File $temp -Encoding 'ASCII' -NoNewline
(Get-Content $temp -AsByteStream).Count | Should -Be... |
combined_dataset/train/non-malicious/1884.ps1 | 1884.ps1 |
Describe "ConvertFrom-StringData DRT Unit Tests" -Tags "CI" {
It "Should able to throw error when convert invalid line" {
$str =@"
abc
def=content of def
"@
{ ConvertFrom-StringData $str } | Should -Throw -ErrorId "InvalidOperation,Microsoft.PowerShell.Commands.ConvertFromStringDataCommand"
... |
combined_dataset/train/non-malicious/sample_46_9.ps1 | sample_46_9.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubsubscription.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported... |
combined_dataset/train/non-malicious/sample_22_57.ps1 | sample_22_57.ps1 | Import-LocalizedData -BindingVariable lcAdTxt -FileName AzStackHci.ExternalActiveDirectory.Strings.psd1
class ExternalADTest
{
[string]$TestName
[scriptblock]$ExecutionBlock
}
$ExternalAdTestInitializors = @(
)
$ExternalAdTests = @(
<# Can't execute this test during deployment as Get-KdsRootK... |
combined_dataset/train/non-malicious/sample_2_43.ps1 | sample_2_43.ps1 | #************************************************
# DC_HyperVNetworkVirtualization.ps1
# Version 1.0
# Date: May 2014
# Author: Boyd Benson (bbenson@microsoft.com) with assistance from Tim Quinn (tiquinn@microsoft.com)
# Description: PS cmdlets
# Called from: Networking Diags
#**********************************... |
combined_dataset/train/non-malicious/3804.ps1 | 3804.ps1 | param(
[string]$first,
[string]$second
)
Write-Host This is a sample script with parameters $first $second
Write-Host "Second line with escaped characters"
|
combined_dataset/train/non-malicious/exclude properties_1.ps1 | exclude properties_1.ps1 | $server = "dcserver1.mafoberg.net"
$session = new-pssession -computer $server -cred $creds
icm -Session $session -ScriptBlock {
import-module activedirectory
(get-ADUser -filter "*" -properties GivenName, SurName, EmailAddress | select -ExcludeProperty PSComputerName, RunspaceId, PSShowComputerName )
... |
combined_dataset/train/non-malicious/sample_46_70.ps1 | sample_46_70.ps1 | #
# Module manifest for module 'OCI.PSModules.Limits'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Limits.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_0_89.ps1 | sample_0_89.ps1 | #************************************************
# DC_Repadmin.ps1
# Version 1.0.1
# Date: 03-6-2013
# Authors : Andre Teixeira/ David Fisher (CSS)/ Craig Landis
# Description: Run Repadmin utility to obtain Kerberos tickets and TGT
#************************************************
if($debug -eq $true){[vo... |
combined_dataset/train/non-malicious/PoshCode ISE Addon.ps1 | PoshCode ISE Addon.ps1 | if (!(Get-Module WPK)) {Import-Module -global WPK}
if (!(Get-Module PoshCode)) {Import-Module -global PoshCode}
Function Get-PoshCodePreferences {
if (Get-Item $global:xmlPath -ErrorAction SilentlyContinue) {
try {
$pcPreferences = Import-Clixml -Path $global:xmlPath
$global:... |
combined_dataset/train/non-malicious/4060.ps1 | 4060.ps1 |
[CmdletBinding()]
param
(
[string]$Parameters = 'INSTALL_SILENT=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_ANALYTICS=Disable EULA=Disable REBOOT=Disable'
)
function Get-Architecture {
[CmdletBinding()][OutputType([string])]
param ()
$OSArchitecture = (Get-WmiObject -Class Win32_OperatingSystem | Select-O... |
combined_dataset/train/non-malicious/4233.ps1 | 4233.ps1 |
$arploaded = $null
function Invoke-Arpscan {
param (
[Parameter(Mandatory = $False)]
[string]$IPCidr,
[Parameter(Mandatory=$False)]
[switch]$Resolve,
[Parameter(Mandatory=$False)]
[switch]$AddType
)
if ($AddType.IsPresent) {
echo "[+] Loading Assembly using AddType"
echo ""
Add-Type -Type... |
combined_dataset/train/non-malicious/sample_8_72.ps1 | sample_8_72.ps1 | #************************************************
# TS_RegKeyCheck.ps1
# Version 1.0.1
# Date: 03-27-2011
# Author: Your Name - Your Email Address
# Description: This script checks if there is a registry value called 'DetectRootCause' in HKLM\SOFTWARE\Microsoft\Test
# And then flag it as a root cau... |
combined_dataset/train/non-malicious/sample_49_29.ps1 | sample_49_29.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... |
combined_dataset/train/non-malicious/sample_47_59.ps1 | sample_47_59.ps1 | #
# Module manifest for module 'OCI.PSModules.Loggingingestion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported... |
combined_dataset/train/non-malicious/sample_42_62.ps1 | sample_42_62.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\vite@5.0.12\node_modules\vite\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\vite@5.0.12\no... |
combined_dataset/train/non-malicious/sample_6_62.ps1 | sample_6_62.ps1 | // Class: DCIM_CLPProtocolEndpoint => DCIM_CLPEndpointOwningJobElement => DCIM_CLPConcreteJob
[dynamic, provider("dcismprovider")]
class DCIM_CLPEndpointOwningJobElement : CIM_OwningJobElement
{ };
/* SIG # Begin signature block */
/* MIItDgYJKoZIhvcNAQcCoIIs/zCCLPsCAQExDzANBglghkgBZQMEAgEFADB5Bgor */
/* BgEEAYI3... |
combined_dataset/train/non-malicious/2866.ps1 | 2866.ps1 | task default -depends 'TaskAFromModuleA'
task 'TaskAFromModuleA' -FromModule TaskModuleA -minimumVersion 0.1.0
task 'TaskAFromModuleB' -Frommodule TaskModuleB -minimumVersion 0.2.0
task 'TaskBFromModuleA' -FromModule TaskModuleA -Version 0.1.0
|
combined_dataset/train/non-malicious/1081.ps1 | 1081.ps1 |
$connectionStringName = "TEST_CONNECTION_STRING_NAME"
$connectionStringValue = "TEST_CONNECTION_STRING_VALUE"
$connectionStringNewValue = "TEST_CONNECTION_STRING_NEW_VALUE"
$providerName = 'Carbon.Set-DotNetConnectionString'
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-Ca... |
combined_dataset/train/non-malicious/JSON 1.1.ps1 | JSON 1.1.ps1 | #requires -version 2.0
# Version History:
# v 0.5 - First Public version
# v 1.0 - Made ConvertFrom-Json work with arbitrary JSON
# - switched to xsl style sheets for ConvertTo-JSON
# v 1.1 - Changed ConvertFrom-Json to handle single item results
# There is no help (yet) because I'm still changing and r... |
combined_dataset/train/non-malicious/CapsLock Notifier.ps1 | CapsLock Notifier.ps1 | <#
.NOTES
Name : CapsLockNotifier.ps1
Author : Bryan Jaudon <bryan.jaudon@gmail.com>
Version : 1.0
Date : 10/25/2012
.Description
Adds a notification icon to show current CapsLock status. Double clicking or by using the context menu, allows for
toggling of the Cap... |
combined_dataset/train/non-malicious/sample_47_71.ps1 | sample_47_71.ps1 | 9A PIN-kód helytelen. Adja meg az új hitelesítő adatokat. ÕA PIN-kód helytelen. Adja meg az új hitelesítő adatokat.
Ha a(z) %s nem támogatja a Hálózati szintű hitelesítést, akkor nem fogja elfogadni ezeket a hitelesítő adatokat. Segítségért forduljon a rendszergazdához. ųA Távoli asztal nem tudja ellenőrizni a távoli ... |
combined_dataset/train/non-malicious/sample_56_36.ps1 | sample_56_36.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/1505.ps1 | 1505.ps1 |
function Assert-DirectoryExists
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[string]
$Path,
[Parameter(Position=1)]
[string]
$Message
)
Set-StrictMode -Version 'Latest'
if( -not (Test-Path -Path $Path -Pat... |
combined_dataset/train/non-malicious/sample_8_75.ps1 | sample_8_75.ps1 | ConvertFrom-StringData @'
progressbar_id_crm_org_version_deployment_check=Verifying Organization Databases Revision Not Greater Than Deployment Revision
progressbar_id_crm_org_version_deployment_checkdesc=Verifying Organization Databases Revision Not Greater Than Deployment Revision
'@
# SIG # Begin signature blo... |
combined_dataset/train/non-malicious/3310.ps1 | 3310.ps1 |
function Install-Plugin {
[PoshBot.BotCommand(
Aliases = ('ip', 'installplugin'),
Permissions = 'manage-plugins'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string]$Name,
[parameter(Positio... |
combined_dataset/train/non-malicious/sample_42_91.ps1 | sample_42_91.ps1 | param(
[Parameter(Mandatory = $true, HelpMessage="Enable or disable mandatory ASLR for the target executables.")][ValidateSet('Enable', 'Disable')][string]$Action,
[Parameter(mandatory=$true, ValueFromRemainingArguments=$true, HelpMessage="The paths of the target executables.")][string[]]$paths
)
# Define a st... |
combined_dataset/train/non-malicious/2676.ps1 | 2676.ps1 | param(
[switch]$Force
)
. $PSScriptRoot/shared.ps1
$templateConfigurationsList = '/Lists/Templates'
$baseModulesLibrary = 'BaseModules'
$subModulesLibrary = 'AppsModules'
$timerIntervalMinutes = 30;
function GetUniqueUrlFromName($title) {
Connect -Url $tenantAdminUrl
$cleanName = $title -replace '[^a-z0-... |
combined_dataset/train/non-malicious/sample_55_14.ps1 | sample_55_14.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/sample_17_83.ps1 | sample_17_83.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 = '80.0.0'
# Sup... |
combined_dataset/train/non-malicious/sample_60_77.ps1 | sample_60_77.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... |
combined_dataset/train/non-malicious/sample_30_55.ps1 | sample_30_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Dts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dts.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_15_42.ps1 | sample_15_42.ps1 | #
# Module manifest for module 'Microsoft.SME.LocalUsersGroups'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.LocalUsersGroups.psm1'
# Version number of this module.
ModuleVersion = '4.10.0'
# Supported PSEditions
# CompatiblePSEditions = @()
#... |
combined_dataset/train/non-malicious/sample_64_58.ps1 | sample_64_58.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmcontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmcontrolplane.dll'
# Version number of this module.
ModuleVersion = '88.1.0'
# Supported P... |
combined_dataset/train/non-malicious/2600.ps1 | 2600.ps1 | [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServr.Rmo")
$servername = "STGSQL610"
$repserver = New-Object "Microsoft.SqlServer.Replication.ReplicationServer"
$srv = New-Object "Microsoft.SqlServer.Management.Common.ServerConnection" $servername
$srv.connect()
$repserver.ConnectionContext = $srv
$d... |
combined_dataset/train/non-malicious/sample_16_65.ps1 | sample_16_65.ps1 | #!powershell
# Copyright: (c) 2015, Corwin Brown <corwin@corwinbrown.com>
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#AnsibleRequires -CSharpUtil Ansible.Basic
#Requires -Module Ansible.ModuleUtils.CamelC... |
combined_dataset/train/non-malicious/sample_44_60.ps1 | sample_44_60.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function ConvertTo-ScriptExtent {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding()]
[OutputType([System.Management.Automation.Language.IScriptExtent])]
param(
[Parameter(... |
combined_dataset/train/non-malicious/Get-UIInput.ps1 | Get-UIInput.ps1 | function Get-UIInput {
#.Synopsis
# Prompt the user for input with a pretty dialog
#.Parameter PromptText
# The text to prompt the user for (an array of one or more strings)
#.Example
# Get-UIInput "First Name:", "Last Name:", "Age:"
Param([string[]]$PromptText = "Ple... |
combined_dataset/train/non-malicious/sample_33_32.ps1 | sample_33_32.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.