full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/1415.ps1 | 1415.ps1 |
function Convert-CXmlFile
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$Path,
[Parameter(Mandatory=$true,ParameterSetName='ByXdtFile')]
[string]
$XdtPath,
[Parameter(Mandatory=$true,P... |
combined_dataset/train/non-malicious/778.ps1 | 778.ps1 | enum PsesLogLevel {
Diagnostic
Verbose
Normal
Warning
Error
}
enum PsesLogMessageType {
Log
Exception
HandledException
Request
Response
Notification
}
enum PsesNotificationSource {
Unknown
Client
Server
}
class PsesLogMessage {
[string]$Data
[int]$DataS... |
combined_dataset/train/non-malicious/552.ps1 | 552.ps1 |
function Get-SPOSolutionId
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$solutionName
)
$fileUrl = Join-SPOParts -Separator '/' -Parts $clientContext.Site.ServerRelativeUrl, "/_catalogs/solutions/", $solutionName
$solution = $clientContext.Site.RootWeb.GetFileByServ... |
combined_dataset/train/non-malicious/574.ps1 | 574.ps1 |
function Get-SPOPrincipal
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$username
)
$principal = $clientContext.Web.EnsureUser($username)
$clientContext.Load($principal)
$clientContext.ExecuteQuery()
return $principal
}
|
combined_dataset/train/non-malicious/sample_17_33.ps1 | sample_17_33.ps1 | @{
RootModule = 'PSModule.psm1'
ModuleVersion = '2.2.5'
GUID = '1d73a601-4a6c-43c5-ba3f-619b18bbb404'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = '(c) Microsoft Corporation. All rights reserved.'
D... |
combined_dataset/train/non-malicious/Binary Clock_1.ps1 | Binary Clock_1.ps1 | function get-binary($number,$words=1+(1*[int]($number -gt 255))) {
# Takes the passed numerical value and converts to a Binary word.
# Pads 0 to the left to make it a proper set of 8 or 16
#
# If you use this function outside of the clock, it is automatically
# designed to generate a 16 bit output padded if t... |
combined_dataset/train/non-malicious/Get-TwitterReply.ps1 | Get-TwitterReply.ps1 | # Its a modification from the version in http://blogs.technet.com/jamesone/archive/2009/02/16/how-to-drive-twitter-or-other-web-tools-with-powershell.aspx
# usees https and gets all replies
Function Get-TwitterReply {
param ($username, $password)
if ($WebClient -eq $null) {$Global:WebClient=new-object System.N... |
combined_dataset/train/non-malicious/sample_41_6.ps1 | sample_41_6.ps1 | ZНевозможно выполнить метод, если хранилище с несколькими моментальными снимками отключено.Запрос был ограничен из-за слишком большого числа инициированных пользователем запросов на обновление источника данных за короткий период времени.gНедостаточно разрешений для обновления таблицы Direct Lake. Обратитесь к создател... |
combined_dataset/train/non-malicious/1674.ps1 | 1674.ps1 |
function Get-Powercfg {
$schemes = powercfg /l | ? {$_ -match ':'} | % {
$split = $_ -split ':|\s{2}' | % {$_.trim()}
$guid = $split[1]
$name = $split[2]
$active = $name.endswith('*')
if ($active) {
$name = $name.substring(1, $name.length - 4)
} else ... |
combined_dataset/train/non-malicious/280.ps1 | 280.ps1 |
$groupId = " FILL ME IN "
$newGatewayId = " FILL ME IN "
$datasetId = " FILL ME IN "
$clientId = " FILL ME IN "
function GetAuthToken
{
if(-not (Get-Module AzureRm.Profile)) {
Import-Module AzureRm.Profile
}
$redirectUri = "urn:ietf:wg:oauth:2.... |
combined_dataset/train/non-malicious/sample_53_2.ps1 | sample_53_2.ps1 | # Localized 12/03/2020 06:20 PM (GMT) 303:4.80.0411 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Sí
PromptNoString=&No
BundleFound=Agrupación encontrada: {0}
PackageFound=Paquete encontrado: {0}
EncryptedBundleFound=Se ha encontrado un conjunto cifrado: {0}
En... |
combined_dataset/train/non-malicious/New-ArgsTestExe.ps1 | New-ArgsTestExe.ps1 | Add-Type -Type @"
using System;
internal class ArgsTest
{
private static void Main(string[] args)
{
Console.WriteLine();
/*
I've commented this out because (at least in C#)
it is the same as Environment.GetCommandLineArgs()
Except that GetCommandLineArgs shows p... |
combined_dataset/train/non-malicious/sample_46_95.ps1 | sample_46_95.ps1 | #
# Module manifest for module 'OCI.PSModules.Networkfirewall'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Networkfirewall.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported P... |
combined_dataset/train/non-malicious/2301.ps1 | 2301.ps1 | param ([string]$Computername,[string]$GroupName,[string]$Username)
$group = [ADSI]"WinNT://$Computername/$GroupName,group"
$group.Add("WinNT://$Computername/$Username,user") |
combined_dataset/train/non-malicious/Out-DataTable.ps1 | Out-DataTable.ps1 | #######################
<#
.SYNOPSIS
Creates a DataTable for an object
.DESCRIPTION
Creates a DataTable based on an objects properties.
.INPUTS
Object
Any object can be piped to Out-DataTable
.OUTPUTS
System.Data.DataTable
.EXAMPLE
$dt = Get-Alias | Out-DataTable
This example creates a DataTable fro... |
combined_dataset/train/non-malicious/sample_62_99.ps1 | sample_62_99.ps1 | /*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-------------... |
combined_dataset/train/non-malicious/sample_2_48.ps1 | sample_2_48.ps1 | [dynamic, provider("dcismprovider"), Association]
class DCIM_CLPServiceServiceDependency : DCIM_RBAServiceServiceDependency
{
[
Description ("Dependent represents the object that is dependent on the Antecedent."),
Override ("Dependent"),
Required
]
CIM_Service REF Depende... |
combined_dataset/train/non-malicious/ASPX Mailbox (5 of 6).ps1 | ASPX Mailbox (5 of 6).ps1 | <%@ Page Language="C#" AutoEventWireup="true" CodeFile="MailboxTaskResults.aspx.cs" Inherits="MailboxTaskResults" %>
<%@ Reference Page="~/MailboxConfirm.aspx" %>
<%@ PreviousPageType VirtualPath="~/MailboxConfirm.aspx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DT... |
combined_dataset/train/non-malicious/VMware guest information.ps1 | VMware guest information.ps1 | # vminfo.ps1
#
# Give this a VMware guest and it will attempt to dump all the information available.
#
# Example: .\\vminfo.ps1 "guestname"
#
# This scripts assumes that you have already connected to a VirtualCenter server.
#
# This was developed and tested using VMware vSphere PowerCLI version 4.1.1.2816
# o... |
combined_dataset/train/non-malicious/sample_22_17.ps1 | sample_22_17.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Invoke-AMTPowerManagement {
<#
.Synopsis
Invokes an Intel Active Management Technology power control command
.Description
This CmdLet invokes an Intel Active Management Technology (AMT) power control operations (Power On, ... |
combined_dataset/train/non-malicious/sample_28_14.ps1 | sample_28_14.ps1 | #
# Module manifest for module 'OCI.PSModules.Recovery'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Recovery.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/WPFDiskSpace.ps1 | WPFDiskSpace.ps1 | #Usage: Get-WmiObject -computername Z002 Win32_LogicalDisk -filter "DriveType=3" | ./WPFDiskSpace.ps1
#Note: Requires .NET 3.5, Visifire Charts (tested on v2.1.0), Powerboots (tested on v0.1)
$libraryDir = Convert-Path (Resolve-Path "$ProfileDir\\Libraries")
[Void][Reflection.Assembly]::LoadFrom( (Convert-Path (Re... |
combined_dataset/train/non-malicious/AD attributes.ps1 | AD attributes.ps1 | <%@ Language=VBScript %>
<% StartTime = Timer %>
<!--#include file = "global.inc"-->
<html>
<head><title><%=strCompany%> - Search List</title>
</head>
<body>
<!--#include file="default.htm"-->
<link rel="stylesheet" href="/server/default.css" TYPE="text/css" media="screen">
<%
Dim MyVariable
MyVariable=Reque... |
combined_dataset/train/non-malicious/SearchZIP_3.psm1 .ps1 | SearchZIP_3.psm1 .ps1 | function SearchZIPfiles {
<#
.SYNOPSIS
Search for (filename) strings inside compressed ZIP or RAR files (V2.4).
.DESCRIPTION
In any directory containing a large number of ZIP/RAR compressed Web Page files
this procedure will search each individual file name for simple text strings,
listing both the source RAR... |
combined_dataset/train/non-malicious/sample_32_38.ps1 | sample_32_38.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 = '83.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/3538.ps1 | 3538.ps1 |
$location = "southeastasia"
$resourceGroupName = "pstestFSRG1bca8f8e"
$vaultName = "PSTestFSRSV1bca8f8e"
$fileShareFriendlyName = "pstestfs1bca8f8e"
$fileShareName = "AzureFileShare;pstestfs1bca8f8e"
$saName = "pstestsa1bca8f8e"
$saRgName = "pstestFSRG1bca8f8e"
$targetSaName = "pstestsa3rty7d7s"
$targetFi... |
combined_dataset/train/non-malicious/sample_50_23.ps1 | sample_50_23.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplace'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplace.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/Test-TCPPort_2.ps1 | Test-TCPPort_2.ps1 | function Test-TCPPort {
param (
[parameter(Mandatory=$true)]
[string] $ComputerName,
[parameter(Mandatory=$true)]
[string] $Port
)
try {
$TimeOut = 5000
$IsConnected = $false
$Addresses = [System.Net.Dns]::GetHostAddresses($ComputerName) | ? {$_.AddressFamily -eq 'InterNetwork'}
$Ad... |
combined_dataset/train/non-malicious/sample_12_57.ps1 | sample_12_57.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'https://aka... |
combined_dataset/train/non-malicious/2863.ps1 | 2863.ps1 | function FormatTaskName {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
$format
)
$psake.context.Peek().config.taskNameFormat = $format
}
|
combined_dataset/train/non-malicious/860.ps1 | 860.ps1 | function Start-MapReduce {
$ErrorActionPreference = "Stop"
$context = Get-AzContext
if ($context -eq $null)
{
Connect-AzAccount
}
$context
$clusterName = Read-Host -Prompt "Enter the HDInsight cluster name"
$creds=Get-Credential -Message "Enter the login for... |
combined_dataset/train/non-malicious/1474.ps1 | 1474.ps1 |
function Assert-ModuleVersion
{
param(
[Parameter(Mandatory=$true)]
[string]
$ManifestPath,
[string[]]
$AssemblyPath,
[string]
$ReleaseNotesPath,
[string]
$NuspecPath,
[string[]]
... |
combined_dataset/train/non-malicious/sample_21_65.ps1 | sample_21_65.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeai'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeai.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/3255.ps1 | 3255.ps1 |
class Stream {
[object[]]$Debug = @()
[object[]]$Error = @()
[object[]]$Information = @()
[object[]]$Verbose = @()
[object[]]$Warning = @()
}
|
combined_dataset/train/non-malicious/sample_48_6.ps1 | sample_48_6.ps1 | [CmdletBinding()]
param (
[string]$ACLPath,
[string]$TargetPath
)
# Get the ACL from the source folder
$acl = Get-Acl -Path $ACLPath
$acl | fl
# Split the target path into individual folder names
$folders = $targetPath.Split('\')
# Initialize the folder variable into empty string
$folder = ""
... |
combined_dataset/train/non-malicious/2513.ps1 | 2513.ps1 |
$Error.Clear()
$erroractionpreference = "SilentlyContinue"
$a = New-Object -comobject Excel.Application
$a.visible = $True
$b = $a.Workbooks.Add()
$c = $b.Worksheets.Item(1)
$c.Cells.Item(1,1) = "Machine Name"
$c.Cells.Item(1,2) = "SNMP Updated"
$d = $c.UsedRange
$d.Interior.ColorIndex = 19
$d.Font.ColorIndex = 11
$... |
combined_dataset/train/non-malicious/Dumping COM.ps1 | Dumping COM.ps1 | $arr = @()
$key = "HKLM:\\SOFTWARE\\Classes\\CLSID"
foreach ($i in (gci $key)) {
$des = $key + "\\" + $i.PSChildName + "\\ProgID"
Write-Progress "Dumping. Please, standby..." $des
foreach ($a in (gp -ea 0 $des)."(default)") {
$arr += $a
}
}
[array]::Sort([array]$arr)
$arr | Out-File -file C:... |
combined_dataset/train/non-malicious/Get-DiskUsage_4.ps1 | Get-DiskUsage_4.ps1 | Function Get-DiskUsage {
<#
.SYNOPSIS
A tribute to the excellent Unix command DU.
.DESCRIPTION
This command will output the full path and the size of any object
and it's subobjects. Using just the Get-DiskUsage command without
any parameters will result in an output of the directory you are
currently p... |
combined_dataset/train/non-malicious/1272.ps1 | 1272.ps1 |
function Remove-CDotNetAppSetting
{
[CmdletBinding(SupportsShouldProcess=$true, DefaultParameterSetName='All')]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[Switch]
$Framework,
[Switch]
$Framework64,
... |
combined_dataset/train/non-malicious/1256.ps1 | 1256.ps1 |
function Get-CTrustedHost
{
[CmdletBinding()]
param(
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
$trustedHosts = (Get-Item $TrustedHostsPath -Force).Value
if( $trustedHosts )
{
return $trustedHosts -s... |
combined_dataset/train/non-malicious/sample_27_47.ps1 | sample_27_47.ps1 | #
# Module manifest for module 'Az.SecurityInsights'
#
# Generated by: Microsoft Corporation
#
# Generated on: 23/04/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.SecurityInsights.psm1'
# Version number of this module.
ModuleVersion = '3.1.2'
# Suppo... |
combined_dataset/train/non-malicious/3522.ps1 | 3522.ps1 |
function Test-AzDtlVMsPerLabPolicy
{
$policy = Set-AzDtlVMsPerLabPolicy -MaxVMs 5 -LabName $labName -ResourceGroupName $rgname
$readBack = Get-AzDtlVMsPerLabPolicy -LabName $labName -ResourceGroupName $rgname
Invoke-For-Both $policy $readBack `
{
Param($x)
Assert-Are... |
combined_dataset/train/non-malicious/sample_43_62.ps1 | sample_43_62.ps1 | #
# Module manifest for module 'Az.HealthcareApis'
#
# Generated by: Microsoft Corporation
#
# Generated on: 23/04/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.HealthcareApis.psm1'
# Version number of this module.
ModuleVersion = '2.0.1'
# Supported... |
combined_dataset/train/non-malicious/sample_23_25.ps1 | sample_23_25.ps1 | ConvertFrom-StringData @'
IPAddressDisplayNameFormat=IP アドレス: {0}
NetworkNameDisplayNameFormat=名前: {0}
NetworkNameOfflineDisplayNameFormat=IP アドレス: "{0}" 上のアドレス
CreateClusterProgressValidationStart=フェールオーバー クラスターに対するサーバーの適合性を検証しています。
CreateClusterProgressValidationEnd=フェールオーバー クラスターに対するサーバーの適合性の検証が完了しました。
CreateC... |
combined_dataset/train/non-malicious/sample_24_71.ps1 | sample_24_71.ps1 | <#
.SYNOPSIS
Creates and throws an invalid argument exception.
.PARAMETER Message
The message explaining why this error is being thrown.
.PARAMETER ArgumentName
The name of the invalid argument that is causing this error to be thrown.
#>
function New-InvalidArgumentExcept... |
combined_dataset/train/non-malicious/1142.ps1 | 1142.ps1 |
$username = 'CarbonGrantPrivilege'
$password = 'a1b2c3d4
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
Install-User -Username $username -Password $password -Description 'Account for testing Carbon Grant-Pr... |
combined_dataset/train/non-malicious/egg_timer_1.ps1 | egg_timer_1.ps1 | function GenerateForm {
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
$form_main = New-Object System.Windows.Forms.Form
$reset_button = New-Object System.Windows.Forms.Button
$label1 = New-Object Sys... |
combined_dataset/train/non-malicious/sample_59_91.ps1 | sample_59_91.ps1 | <#
.Synopsis
Activate a Python virtual environment for the current PowerShell session.
.Description
Pushes the python executable for a virtual environment to the front of the
$Env:PATH environment variable and sets the prompt to signify that you are
in a Python virtual environment. Makes use of the command line... |
combined_dataset/train/non-malicious/sample_1_62.ps1 | sample_1_62.ps1 | #************************************************
# DC_SummaryReliability.ps1
# Version 0.1
# Date: 3/19/2012
# By Craig Landis (clandis@microsoft.com)
#************************************************
# 2023-02-20 WalterE mod Trap #we#
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.Inv... |
combined_dataset/train/non-malicious/3161.ps1 | 3161.ps1 | Function Convert-CsvToPsDt
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true,
HelpMessage = 'The csv input file path.')]
[string]$Infile,
[Parameter(Mandatory = $true,
HelpMessage = 'The output file path.')]
[string]$Outfile = ".\MyPsDataTable.ps1"
... |
combined_dataset/train/non-malicious/Export-HTML.ps1 | Export-HTML.ps1 | #Requires -Version 2.0
<#
Export-Html behaves exactly like native ConvertTo-HTML
However it has one optional parameter -Path
Which lets you specify the output file: e.g.
Get-Process | Export-Html C:\\temp\\processes.html
(c) Dmitry Sotnikov
http://dmitrysotnikov.wordpress.com
Proxy generated usin... |
combined_dataset/train/non-malicious/sample_51_72.ps1 | sample_51_72.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/337d4ddf-c2e9-4243-8681-ea4303a40040.ps1 | 337d4ddf-c2e9-4243-8681-ea4303a40040.ps1 | None |
combined_dataset/train/non-malicious/sample_30_21.ps1 | sample_30_21.ps1 | #
# Module manifest for module 'OCI.PSModules.Bastion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bastion.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/Convert-SchemaGUID.ps1 | Convert-SchemaGUID.ps1 | # List of Guids not properly defined in AD but used
# Used to initialize GuidCache.
New-Variable -Name GuidCache -Force -Option AllScope -Scope Script -Description "Cached GUIDs from AD. :: [redtoo]"
$Script:GuidCache = @{
"a05b8cc2-17bc-4802-a710-e7c15ab866a2" = "Autoenroll"
"00000000-0000-0000-0000-00... |
combined_dataset/train/non-malicious/sample_35_52.ps1 | sample_35_52.ps1 | #
# Script Module file for Dism module.
#
# Copyright (c) Microsoft Corporation
#
#
# Cmdlet aliases
#
Set-Alias Apply-WindowsUnattend Use-WindowsUnattend
Set-Alias Add-ProvisionedAppxPackage Add-AppxProvisionedPackage
Set-Alias Remove-ProvisionedAppxPackage Remove-AppxProvisionedPackage
Set-Alias Get-Pr... |
combined_dataset/train/non-malicious/Map a Network Drive.ps1 | Map a Network Drive.ps1 | function MapNetDrive
{
param(
#Non-Boolean parameters (Values)
#
[Parameter(Position=0,Mandatory=$true)]
[string]$DriveLetter="Z:",
[Parameter(Position=1,Mandatory=$true)]
[string]$Path,
#Boolean switches (On/Off)
#
[Parameter(Position=2,Mandatory=$false)]... |
combined_dataset/train/non-malicious/Start-BootsTimer_2.ps1 | Start-BootsTimer_2.ps1 | 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 to be spoken by a voice when the time is up...
#.Parameter StartMessag... |
combined_dataset/train/non-malicious/Appscanner v0.10.ps1 | Appscanner v0.10.ps1 | #######################
#Appscanner V0.10
#Author Adam Liquorish
#Creation Date 08/11/11
#Change log:
# 14/11/11 Removed unrequired step
# 02/12/11 Created input choice for domain.local,cached rather than auto determine
# 02/12/11 Added all supported filetypes for applockers ".bat",".cmd",".... |
combined_dataset/train/non-malicious/divide integer.ps1 | divide integer.ps1 | function divide-integer ([int]$dividend , [int]$divisor ){ [int]$local:remainder = $Null;return [Math]::DivRem($dividend,$divisor,[ref]$local:remainder);}
set-alias i/ divide-integer
i/ 10 3
function divide-integerpipe ([int]$divisor )
{ begin { [int]$local:remainder = $Null}
process { [Math]::DivRem($_ ,$di... |
combined_dataset/train/non-malicious/4350.ps1 | 4350.ps1 | function ThrowError
{
param
(
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCmdlet]
$CallerPSCmdlet,
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String]
$ExceptionName,
[p... |
combined_dataset/train/non-malicious/3776.ps1 | 3776.ps1 | $ErrorActionPreference = "Stop"
$scriptpath = $MyInvocation.MyCommand.Path
$scriptDirectory = Split-Path $scriptpath
$scriptFileName = Split-Path $scriptpath -Leaf
function prompt
{
Write-Host "[$((Get-Location).Path)]"
Write-Host "StorageSyncDevOps " -NoNewLine -foreground White
"PS> "
}
function relo... |
combined_dataset/train/non-malicious/sample_59_71.ps1 | sample_59_71.ps1 | <##############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
##############################################################>... |
combined_dataset/train/non-malicious/sample_13_48.ps1 | sample_13_48.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/601.ps1 | 601.ps1 |
function Get-CleanSPUrl {
param(
[Parameter(Mandatory=$true)]
[String]
$Url
)
[Uri]$Url = $Url
if($Url -match "(/Forms/).*?\.(aspx$)"){
[Uri]$ListUrl = $Url.AbsoluteUri -replace "(/Forms/).*?\.(aspx)",""
[Uri]$WebUrl = $Url.Absolut... |
combined_dataset/train/non-malicious/sample_44_48.ps1 | sample_44_48.ps1 | @{
GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @('MSFT_MpPerformanceRecording.psm1')
FormatsToProcess = @(... |
combined_dataset/train/non-malicious/sample_47_49.ps1 | sample_47_49.ps1 | #
# Module manifest for module 'OCI.PSModules.Nosql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Nosql.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_59_32.ps1 | sample_59_32.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="$basedir\..\..\..\..\..\rollup@4.16.1\node_modules"
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node... |
combined_dataset/train/non-malicious/1806.ps1 | 1806.ps1 |
Describe "Validate basic Variable provider cmdlets" -Tags "CI" {
BeforeAll {
$testVarName = "MyTestVarThatWontConflict"
$testVarValue = 1234
$testVarDescription = "This is a test variable for provider test purposes."
}
BeforeEach {
New-Variable -Name $testVarName -Value $t... |
combined_dataset/train/non-malicious/sample_62_90.ps1 | sample_62_90.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 = '86.2.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_44_68.ps1 | sample_44_68.ps1 | pipeline {
agent {
kubernetes {
inheritFrom 'docker-node'
}
}
environment{
PROJECT = "vscode-plugin-for-sf"
PUBLISHER = "QualityClouds"
VS_PUBLISH_TOKEN = credentials("vs-publish-token")
}
stages {
stage ('Install Dependencies')... |
combined_dataset/train/non-malicious/Get-GPOSettings.ps1 | Get-GPOSettings.ps1 | <#
.SYNOPSIS
Get-GPOSettings
.DESCRIPTION
This script gets a list of all Group Policy Objects in the domain filtered on the value
of GPOSettingName. For each GPO if the Extension Name matches GPOSettingName the Extensions
are then reported back.
.PARAMETER GPOSettingN... |
combined_dataset/train/non-malicious/sample_23_31.ps1 | sample_23_31.ps1 | Describe "Test-EngineLibrary" {
It "Calls Get-Date" {
{Get-Date} | Should Not Throw
}
}
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFl... |
combined_dataset/train/non-malicious/sample_35_57.ps1 | sample_35_57.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcemanager.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_64_6.ps1 | sample_64_6.ps1 | param( [string]$DataPath, `
[switch]$AcceptEula, `
[switch]$Trace, `
[switch]$Logs, `
[switch]$Activity, `
[switch]$Fwd, `
[switch]$FwdCli, `
[switch]$RemShell, `
[switch]$HTTPSYS, `
[switch]$WinHTTP, `
[switch]$CAPI, `
[switch]$Ker... |
combined_dataset/train/non-malicious/955.ps1 | 955.ps1 |
$uniqueId=$(-join ((97..122) + (48..57) | Get-Random -Count 15 | % {[char]$_}))
$apiVersion = "2015-04-08"
$location = "West US 2"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount-$uniqueId"
$resourceType = "Microsoft.DocumentDb/databaseAccounts"
$locations = @(
@{ "locationName"="West U... |
combined_dataset/train/non-malicious/sample_30_62.ps1 | sample_30_62.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/2322.ps1 | 2322.ps1 |
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string[]]$ComputerName,
[Parameter()]
[ValidateNotNullOrEmpty()]
[pscredential]$Credential
)
<<<<<<< HEAD
$ErrorActionPreference = 'Stop'
$scriptBlock = {
function Test-RegistryKey {
[OutputType('bool')... |
combined_dataset/train/non-malicious/sample_57_3.ps1 | sample_57_3.ps1 | import{a0 as s}from"./index-BzFgRtn_.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
* Released under the MIT license
* https://github.com/microsoft/monaco-edi... |
combined_dataset/train/non-malicious/FTP download.ps1 | FTP download.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/Get-WebPage_1.ps1 | Get-WebPage_1.ps1 | function Get-WebPage {
<#
.SYNOPSIS
Downloads web page from site.
.DESCRIPTION
Downloads web page from site and displays source code or displays total bytes of webpage downloaded
.PARAMETER Url
URL of the website to test access to.
.PARAMETER UseDefaultCredentials
Use the currently authentica... |
combined_dataset/train/non-malicious/sample_46_52.ps1 | sample_46_52.ps1 | #
# Module manifest for module 'OCI.PSModules.Applicationmigration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Applicationmigration.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# S... |
combined_dataset/train/non-malicious/Set-Blur.ps1 | Set-Blur.ps1 | Add-Type -Type @"
using System;
using System.Runtime.InteropServices;
namespace Huddled {
public class Dwm {
[DllImport("user32.dll")]
public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
[DllImport("user32.dll", SetLastError=true)]
public stati... |
combined_dataset/train/non-malicious/3572.ps1 | 3572.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Clean-ResourceGroup($rgname)
{
Remove-AzResourceGroup -Name $rgname -Force
}
function Create-ResourceGroup
{
$resourceGroupName = Get-ResourceGroupName
return New-AzResourceGroup -Name $resourceGroupName -Location WestUS
}
|
combined_dataset/train/non-malicious/sample_4_65.ps1 | sample_4_65.ps1 | PARAM ([array]$Principals = ($env:USERNAME), $OSEmulation)
#************************************************
# TS_MaxTokenSizeChecks.ps1
# Version 1.0
# Date: 9-4-2013
# Author: Tspring
# Description: Script to detect user token sizing problems which may effect
# use of domain services which require authenticat... |
combined_dataset/train/non-malicious/3371.ps1 | 3371.ps1 |
param(
[ValidateNotNullOrEmpty()]
[ValidateSet('Debug', 'Release')]
[System.String]$BuildConfig
)
$ProjectPaths = @( "$PSScriptRoot\..\artifacts\$BuildConfig" )
$DependencyMapPath = "$PSScriptRoot\..\artifacts\StaticAnalysisResults\DependencyMap.csv"
$DependencyMap = Import-Csv -Path $Depende... |
combined_dataset/train/non-malicious/sample_63_54.ps1 | sample_63_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplacepublisher'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplacepublisher.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# S... |
combined_dataset/train/non-malicious/sample_67_37.ps1 | sample_67_37.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/971.ps1 | 971.ps1 |
$SubscriptionId = '<replace with your subscription id>'
$resourceGroupName = "myResourceGroup-$(Get-Random)"
$location = "westus2"
$firstPoolName = "MyFirstPool"
$secondPoolName = "MySecondPool"
$adminSqlLogin = "SqlAdmin"
$password = "<EnterYourComplexPasswordHere>"
$serverName = "server-$(Get-Random)"
$firstDat... |
combined_dataset/train/non-malicious/sample_51_2.ps1 | sample_51_2.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/1957.ps1 | 1957.ps1 |
Describe "Select-String" -Tags "CI" {
BeforeAll {
$nl = [Environment]::NewLine
$currentDirectory = $pwd.Path
}
AfterAll {
Push-Location $currentDirectory
}
Context "String actions" {
$testinputone = "hello","Hello","goodbye"
$testinputtwo = "hello","Hello... |
combined_dataset/train/non-malicious/sample_61_62.ps1 | sample_61_62.ps1 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
#-------------------------------------------------------------------------
Function CheckConfigureAccountPermissionsPrerequisites
{
# Check if all the features installed by ... |
combined_dataset/train/non-malicious/2180.ps1 | 2180.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/1186.ps1 | 1186.ps1 |
$serviceBaseName = 'CarbonUninstallServiceTest'
$serviceName = $serviceBaseName
$servicePath = Join-Path -Path $PSScriptRoot -ChildPath 'Service\NoOpService.exe' -Resolve
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
function Uninstall-TestService
{
if( (Get-Service ... |
combined_dataset/train/non-malicious/Get-WebFile 3.5.ps1 | Get-WebFile 3.5.ps1 | ## Get-WebFile.ps1 (aka wget for PowerShell)
##############################################################################################################
## Downloads a file or page from the web
## History:
## v3.5 - Add -Quiet switch to turn off the progress reports ...
## v3.4 - Add progress report for files w... |
combined_dataset/train/non-malicious/1016.ps1 | 1016.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_40_68.ps1 | sample_40_68.ps1 | ##############################################################################
# PREVIEW VERSION OF PSAKE SCRIPT FOR MODULE BUILD & PUBLISH TO THE PSGALLERY
##############################################################################
#
# We are hoping to add support for publishing modules to the PowerShell galler... |
combined_dataset/train/non-malicious/sample_61_98.ps1 | sample_61_98.ps1 | Y表“%{oii_IMBITableName/}”的列“%{oii_IMBIColumnName/}”中包含空白值,这对于多对一关系中的一方上的列或用作表的主键的列而言是不允许的。=表未处于可查询状态,因为基础增量表“%{oii_deltaTableName/}”中的数据已更改。请查看更改并刷新数据集。ă无法将值“%{ccon_value/}”转换为 Direct Lake 表列“%{oii_tableName/}”[“%{oii_columnName/}”] 的类型“%{semanticType/}”、基础 parquet 逻辑类型“%{logicalType/}”和物理类型“%{physicalType/}”。请将列的数据类型转... |
combined_dataset/train/non-malicious/1660.ps1 | 1660.ps1 |
function Check-Flags ($sam = $env:USERNAME) {
$uac = [int](([adsisearcher]"samaccountname=$sam").FindOne().Properties.useraccountcontrol | Out-String).Trim()
if ($uac -eq 0) {
throw 'UAC is 0'
}
$flags = @{
SCRIPT = 1
ACCOUNTDISABLE = 2
HOMEDIR_REQUIRED = 8
... |
combined_dataset/train/non-malicious/3795.ps1 | 3795.ps1 |
$global:ps_test_tag_name = 'crptestps6050'
function get_vm_config_object
{
param ([string] $rgname, [string] $vmsize)
$st = Write-Verbose "Creating VM Config Object - Start";
$vmname = $rgname + 'vm';
$p = New-AzVMConfig -VMName $vmname -VMSize $vmsize;
$st = Write-Verbo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.