full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_67_19.ps1 | sample_67_19.ps1 | @{
RootModule = 'PSReadLine.psm1'
NestedModules = @("Microsoft.PowerShell.PSReadLine2.dll")
ModuleVersion = '2.1.0'
GUID = '5714753b-2afd-4492-a5fd-01d9e2cff8b5'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = '(c) Microsoft Corporation. All rights reserved.'
Description = 'Gr... |
combined_dataset/train/non-malicious/sample_63_42.ps1 | sample_63_42.ps1 | # Welcome to Teams Toolkit!
## Quick Start
> **Prerequisites**
>
> To run this app template in your local dev machine, you will need:
>
> - [Visual Studio 2022](https://aka.ms/vs) 17.11 or higher and [install Teams Toolkit](https://aka.ms/install-teams-toolkit-vs)
> - A [Microsoft 365 account for development](https:/... |
combined_dataset/train/non-malicious/1152.ps1 | 1152.ps1 |
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$GroupName = 'AddMemberToGroup'
$user2 = $null
$user1 = $CarbonTestUser
$user2 = Install-User -Credential (New-Credential -UserName 'CarbonTestUser2' -Password 'P@ssw0rd!') -PassThru
func... |
combined_dataset/train/non-malicious/460.ps1 | 460.ps1 | Set-PSFConfig -Module 'PSFramework' -Name 'ComputerManagement.PSSession.IdleTimeout' -Value (New-TimeSpan -Minutes 15) -Initialize -Validation 'timespan' -Handler { [PSFramework.ComputerManagement.ComputerManagementHost]::PSSessionIdleTimeout = $args[0] } -Description "The idle timeout for cached pssessions. When using... |
combined_dataset/train/non-malicious/sample_52_94.ps1 | sample_52_94.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Get-AMTUserConsent {
<#
.Synopsis
Gets the Intel Active Management Technology user consent state
.Description
This CmdLet gets the Intel Active Management Technology (AMT) user consent state from clients that have Intel AM... |
combined_dataset/train/non-malicious/435.ps1 | 435.ps1 |
Register-PSFTeppArgumentCompleter -Command Export-PSFConfig -Parameter FullName -Name 'PSFramework-config-fullname'
Register-PSFTeppArgumentCompleter -Command Export-PSFConfig -Parameter Module -Name 'PSFramework-config-module'
Register-PSFTeppArgumentCompleter -Command Export-PSFConfig -Parameter Name -Name 'PSFramew... |
combined_dataset/train/non-malicious/2005.ps1 | 2005.ps1 |
param ([String]$Path)
try
{
$driveLetter = [char[]](70..89) | Where-Object {$_ -notin (Get-PSDrive).Name} | Select-Object -Last 1
$dir = New-Item $Path -ItemType Directory -Force
subst.exe "$driveLetter`:" $dir.Parent.FullName
$exitCode = $LASTEXITCODE
if ($exitCode -ne 0) { Write-Err... |
combined_dataset/train/non-malicious/sample_26_41.ps1 | sample_26_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Dashboardservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dashboardservice.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported... |
combined_dataset/train/non-malicious/2751.ps1 | 2751.ps1 |
$pfconf = (Get-ItemProperty "hklm:\system\currentcontrolset\control\session manager\memory management\prefetchparameters").EnablePrefetcher
Switch -Regex ($pfconf) {
"[1-3]" {
$o = "" | Select-Object FullName, CreationTimeUtc, LastAccessTimeUtc, LastWriteTimeUtc
ls $env:windir\Prefetch\*.pf | % {... |
combined_dataset/train/non-malicious/4028.ps1 | 4028.ps1 |
function Test-CreatesNewSimpleResource
{
$rgname = Get-ResourceGroupName
$rname = Get-ResourceName
$rglocation = Get-Location "Microsoft.Resources" "resourceGroups" "West US"
$location = Get-Location "Microsoft.Sql" "servers" "West US"
$apiversion = "2014-04-01"
$resourceType... |
combined_dataset/train/non-malicious/FTP module.ps1 | FTP module.ps1 | <#
.Synopsis
Utilities for communicating with FTP server.
#>
function Get-ScriptPath {
Split-Path $myInvocation.ScriptName
}
Import-Module (Join-Path (Get-ScriptPath) common.psm1) -Force
<#
.Synopsis
Lists contents of directory via FTP.
.Parameter oath
URL of directory to list.
.Para... |
combined_dataset/train/non-malicious/38.ps1 | 38.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 -N... |
combined_dataset/train/non-malicious/Create SP2010 Farm V_5.ps1 | Create SP2010 Farm V_5.ps1 | ############################################################################
## Create-SPFarm
## V 0.3
## Jos.Verlinde
############################################################################
Param ( [String] $Farm = "SP2010",
[String] $SQLServer = $env:COMPUTERNAME,
[String] $Passphrase = "pass@word1"... |
combined_dataset/train/non-malicious/sample_6_32.ps1 | sample_6_32.ps1 | #************************************************
# TS_SurfacePro3DetectWifiDriverVersion.ps1
# Version 1.0.09.19.14: Created and tested SurfacePro3 scripts from Sep12-19
# Version 1.1.10.09.14: Modified the detection method from file version to product version because the file version does not change between versio... |
combined_dataset/train/non-malicious/sample_19_97.ps1 | sample_19_97.ps1 | data LocalizedData
{
# culture="en-US"
ConvertFrom-StringData @'
PathNotFoundError=The path '{0}' either does not exist or is not a valid file system path.
ExpandArchiveInValidDestinationPath=The path '{0}' is not a valid file system directory path.
InvalidZipFileExtensionError={0} is not a su... |
combined_dataset/train/non-malicious/Resize Console Window.ps1 | Resize Console Window.ps1 | ##
## Author : Roman Kuzmin
## Synopsis : Resize console window/buffer using arrow keys
##
function Size($w, $h)
{
New-Object System.Management.Automation.Host.Size($w, $h)
}
function resize()
{
Write-Host '[Arrows] resize [Esc] exit ...'
$ErrorActionPreference = 'SilentlyContinue'
for($ui = $Hos... |
combined_dataset/train/non-malicious/sample_20_14.ps1 | sample_20_14.ps1 | <#
.SYNOPSIS
UninstallSyncServiceIIS.ps1 script file
This is a place-holder file only fofr agent patch build purposes
#>
Write-Host "This file functionality is deprecated and is place-holder only"
# SIG # Begin signature block
# MIIoLAYJKoZIhvcNAQcCoIIoHTCCKBkCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# ... |
combined_dataset/train/non-malicious/Find Local Group Members_4.ps1 | Find Local Group Members_4.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/3820.ps1 | 3820.ps1 |
function Test-SetAzureRmVMSqlServerAKVExtension
{
Set-StrictMode -Version latest; $ErrorActionPreference = 'Stop'
$rgname = Get-ComputeTestResourceName
$loc = Get-ComputeVMLocation
New-AzResourceGroup -Name $rgname -Location $loc -Force;
$vmsize = 'Standard_A2';
$vmname = 'vm... |
combined_dataset/train/non-malicious/3888.ps1 | 3888.ps1 |
function Test-GetWorkspaceCollection_ListAll
{
try {
$resourceGroup = Create-ResourceGroup
$workspaceCollectionNames = 1..2 |% { Get-WorkspaceCollectionName }
$newWorkspaceCollections = $workspaceCollectionNames |% { New-AzPowerBIWorkspaceCollection `
-WorkspaceCollectionName $_ `
-R... |
combined_dataset/train/non-malicious/sample_63_27.ps1 | sample_63_27.ps1 | <#
.SYNOPSIS
Scenario module for collecting Microsoft AVD on Azure Stack HCI related data
.DESCRIPTION
Collect Azure Stack HCI related troubleshooting data
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedback : https://aka.... |
combined_dataset/train/non-malicious/2529.ps1 | 2529.ps1 | param([string[]]$paths = "paths",[string]$ext = "ext", [switch]$del)
function Search($path, $ext, $del)
{
Start-Job {param($path,$ext,$del)
$logfile = "E:\GetFiles-$ext.txt"
$files = gci $path -r -i *.$ext
$files |out-file $logfile
$sum = $files |measure-object -property length -sum
$count = $files... |
combined_dataset/train/non-malicious/New-Event_1.ps1 | New-Event_1.ps1 | function New-Event {
<#
.Synopsis
Generates a new event from a plain English string
.Description
Takes a plain English date-time string like "Scrum every day at 9am" or "Lunch every other Tuesday at noon" and turns it into an event object (see notes).
.Example
New-Event Lunch every other Friday at 11:45... |
combined_dataset/train/non-malicious/sample_24_80.ps1 | sample_24_80.ps1 | #
# Module manifest for module 'OCI.PSModules.Sch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Sch.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/4311.ps1 | 4311.ps1 |
function SuiteSetup {
Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue
Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue
$script:PSGetLocalAppDataPath = Get-PSGetLocalAppDataPath
$script:DscTestScript = "DscTestScript"
Install-NuGe... |
combined_dataset/train/non-malicious/QAD.psm1.ps1 | QAD.psm1.ps1 | #
# Module manifest for module 'QAD'
#
# Generated from: Quest.ActiveRoles.ADManagement
#
# Generated on: 1/28/2011
#
@{
# Script module or binary module file associated with this manifest
ModuleToProcess = 'Quest.ActiveRoles.ArsPowerShellSnapIn.dll'
# Version number of this module.
ModuleVersion = '1.... |
combined_dataset/train/non-malicious/sample_49_58.ps1 | sample_49_58.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_7_99.ps1 | sample_7_99.ps1 | #************************************************
# TS_IntersiteMessagingStateCheck.ps1
# Version 1.0.1
# Date: 6/6/2012
# Author: v-kaw
# Description: [Idea ID 2882] [Windows] The stop of Intersite Messaging service on ISTG causes DFSN cannot calculate site costs
# Rule number: 2882
# Rule URL: http://sharep... |
combined_dataset/train/non-malicious/sample_44_14.ps1 | sample_44_14.ps1 | $ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
$script:GCInstallPath = "$PSScriptRoot\..\..\.."
$script:GCBinariesFolderName = "GC"
$script:GCBinariesPath = Join-Path $script:GCInstallPath $script:GCBinariesFolderName
$script:CleanupExePath = Join-Path $script:GCBinariesPath "em_extension_cleanup... |
combined_dataset/train/non-malicious/sample_62_46.ps1 | sample_62_46.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
#
# Azure File Sync (AFS): repair the corrupted event channels
#
... |
combined_dataset/train/non-malicious/3633.ps1 | 3633.ps1 |
$location = 'southeastasia'
function Test-UpdateTransparentDataEncryption
{
$rg = Create-ResourceGroupForTest
$server = Create-ServerForTest $rg $location
$databaseName = Get-DatabaseName
$db = New-AzSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseN... |
combined_dataset/train/non-malicious/Reverse filename sequenc_3.ps1 | Reverse filename sequenc_3.ps1 | # Reverse filename sequence v 0.9
# Author: Sean Wendt
#
# This script will rename a sequenced set of files in a directory.
# For example, you have foobar01.jpg, foobar02.jpg, foobar03.jpg
# -- it will reverse the order, so the last file is now 01, the second to last 02, etc..
#
# Limitations: -You cannot us... |
combined_dataset/train/non-malicious/sample_35_33.ps1 | sample_35_33.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 = '73.1.0'
# Sup... |
combined_dataset/train/non-malicious/sample_62_11.ps1 | sample_62_11.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 = '85.2.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_19_14.ps1 | sample_19_14.ps1 | #
# Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker'
#
# Generated by: Microsoft Corporation
#
# Generated on: 19/01/2022
#
@{
# Script module or binary module file associated with this manifest.
RootModule = ''
# Version number of this module.
ModuleVersion = '1.2100.25... |
combined_dataset/train/non-malicious/sample_8_16.ps1 | sample_8_16.ps1 | param (
[string]$InstallDir
)
function Import-Renode {
$renodeUrl = "https://github.com/renode/renode/releases/download/v1.15.3/renode_1.15.3.zip"
$extractDir = "renode_1.15.3"
$fileName = "renode_1.15.3.zip"
$renodePath = Join-Path -Path $installDir -ChildPath "renode\bin\Renode.exe"
... |
combined_dataset/train/non-malicious/Logoff all users_1.ps1 | Logoff all users_1.ps1 | function RemoveSpace([string]$text) {
$private:array = $text.Split(" ", `
[StringSplitOptions]::RemoveEmptyEntries)
[string]::Join(" ", $array) }
$quser = quser
foreach ($sessionString in $quser) {
$sessionString = RemoveSpace($sessionString)
$session = $sessionString.split()
i... |
combined_dataset/train/non-malicious/494.ps1 | 494.ps1 |
function Get-FileEncoding{
[CmdletBinding()]
param(
[Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)]
[string]
$Path
)
[byte[]]$byte = get-content -Encoding byte -ReadCount 4 -TotalCount 4 -Path $Path
if($byte[0] -eq 0xef -and $byte[1] -e... |
combined_dataset/train/non-malicious/2441.ps1 | 2441.ps1 | function Install-VMIntegrationService
{
[CmdletBinding()]
param
(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[Microsoft.HyperV.PowerShell.VirtualMachine[]]$VM,
[Parameter(Mandatory,ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
[Alias('ComputerName')]
[stri... |
combined_dataset/train/non-malicious/sample_34_38.ps1 | sample_34_38.ps1 | #
# Module manifest for module 'OCI.PSModules.Blockchain'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Blockchain.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/1503.ps1 | 1503.ps1 |
function Assert-NotNull
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[object]
$InputObject,
[Parameter(Position=1)]
[string]
$Message
)
Set-StrictMode -Version 'Latest'
if( $InputObject -eq $null )
... |
combined_dataset/train/non-malicious/sample_22_64.ps1 | sample_22_64.ps1 | #
# Script module for module 'PackageManagement'
#
Set-StrictMode -Version Latest
Microsoft.PowerShell.Utility\Import-LocalizedData LocalizedData -filename PackageManagement.Resources.psd1
# Summary: PackageManagement is supported on Windows PowerShell 3.0 or later, Nano Server and PowerShellCore
$isCore = ($P... |
combined_dataset/train/non-malicious/sample_29_41.ps1 | sample_29_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Emaildataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emaildataplane.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSE... |
combined_dataset/train/non-malicious/3157.ps1 | 3157.ps1 | $global:ThemeSettings = New-Object -TypeName PSObject -Property @{
CurrentThemeLocation = "$PSScriptRoot\Themes\Agnoster.psm1"
MyThemesLocation = '~\Documents\WindowsPowerShell\PoshThemes'
ErrorCount = 0
PromptSymbols = @{
StartSymbol = ' '
Truncat... |
combined_dataset/train/non-malicious/343.ps1 | 343.ps1 | function Register-PSFConfig
{
[CmdletBinding(DefaultParameterSetName = "Default", HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFConfig')]
Param (
[Parameter(ParameterSetName = "Default", Position = 0, ValueFromPipeline = $true)]
[PSFramework.Configuration.Config[]]
$Config,
... |
combined_dataset/train/non-malicious/sample_8_76.ps1 | sample_8_76.ps1 | ConvertFrom-StringData @'
id_rdsserverprogress=Gathering RDS Information:
id_rdscb=Getting Connection Broker configuration.
id_rdscbevent902=Check if Event 902 is logged in TerminalServices-SessionBroker/Admin.
id_rdscbevent902solution=see: http://technet.microsoft.com/en-us/library/ee890857(v=WS.10).aspx for more ... |
combined_dataset/train/non-malicious/sample_55_42.ps1 | sample_55_42.ps1 | """
Microsoft IIS site management via WebAdministration powershell module
:maintainer: Shane Lee <slee@saltstack.com>, Robert Booth <rbooth@saltstack.com>
:platform: Windows
:depends: PowerShell
:depends: WebAdministration module (PowerShell) (IIS)
.. versionadded:: 2016.3.0
"""
import decimal
im... |
combined_dataset/train/non-malicious/sample_23_12.ps1 | sample_23_12.ps1 | #
# Module manifest for module 'OCI.PSModules.Datasafe'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datasafe.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_7_3.ps1 | sample_7_3.ps1 | # DC_RunSqlDiagScripts.ps1
# This script has dependencies on utils_CTS and utils_DSD
#
param( [Object[]] $instances, [switch]$CollectSqlDiag, [switch]$CollectAlwaysOnInfo )
#_# SQLDIAG script name for SQL Server 2014
New-Variable SQL_SCRIPT_SQLDIAG_2014 -Value "sp_sqldiag12.sql" -Option ReadOnly
#... |
combined_dataset/train/non-malicious/Find FSMO Roles.ps1 | Find FSMO Roles.ps1 | $DCs = ([System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()).DomainControllers
$DCs | % { if ($_.Roles -ne '') {
"Server $_ has roles:"
""
foreach ($role in $_.roles) {
$role.tostring().padleft($role.tostring().length + 10)
}
""
}
}
|
combined_dataset/train/non-malicious/786.ps1 | 786.ps1 |
function Get-Token {
[CmdletBinding()]
[OutputType([System.Management.Automation.Language.Token])]
[System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseOutputTypeCorrectly', '', Justification='Issue
param(
[Parameter(Position=0, ValueFromPipeline, ValueFromPipelineByPropertyName)]
... |
combined_dataset/train/non-malicious/sample_34_82.ps1 | sample_34_82.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydomains'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydomains.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported P... |
combined_dataset/train/non-malicious/Get-SNMPHost.ps1 | Get-SNMPHost.ps1 | Param($VC,$ESXCreds=(Get-Credential))
Write-Host "Connecting to VC to get ESX Hosts"
Connect-VIServer $VC | out-null
$ESXHosts = Get-VMHost
foreach($esxhost in $ESXHosts)
{
Write-Host " Connecting to $esxhost"
Connect-VIServer $esxhost.name -cred $ESXCreds | out-null
$SNMPHost = Get-VMHostSnmp
... |
combined_dataset/train/non-malicious/sample_19_55.ps1 | sample_19_55.ps1 | # Web Deploy: Powershell script to configure automatic backups on the server.
# Copyright (C) Microsoft Corp. 2010
#
# Requirements: IIS 7, Windows Server 2008 (or higher)
#
$BackupSectionName = "system.webServer/wdeploy/backup"
$TurnedOnAttrName = "turnedOn"
$EnabledAttrName = "enabled"
$BackupPathAttrName = "... |
combined_dataset/train/non-malicious/sample_30_63.ps1 | sample_30_63.ps1 | #
# Module manifest for module 'OCI.PSModules.Disasterrecovery'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Disasterrecovery.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported... |
combined_dataset/train/non-malicious/414.ps1 | 414.ps1 | function Write-PsfConfigFile
{
[CmdletBinding()]
Param (
[PSFramework.Configuration.Config[]]
$Config,
[string]
$Path,
[switch]
$Replace
)
begin
{
$parent = Split-Path -Path $Path
if (-not (Test-Path $parent))
{
$null = New-Item $parent -ItemType Directory -Force
}
$data = @{ }... |
combined_dataset/train/non-malicious/User Logon details.ps1 | User Logon details.ps1 | ########
#
#Used for enumerating local workstation for user details
#Author: Adam Liquorish
#Date: 12/10/11
########
########Define Parameters
param(
[Parameter(Mandatory=$true,
HelpMessage="Enter Path for output ie c:\\Temp\\output.html.")]
[ValidateNotNullOrEmpty()]
[string]$outputpath=$(Read-Host -pr... |
combined_dataset/train/non-malicious/sample_59_73.ps1 | sample_59_73.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/egg_timer.ps1 | egg_timer.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/1328.ps1 | 1328.ps1 |
function Resolve-WindowsFeatureName
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string[]]
$Name
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
Write-Warning -Message (... |
combined_dataset/train/non-malicious/Set-PsBreakPointLastErro.ps1 | Set-PsBreakPointLastErro.ps1 | Set-StrictMode -Version Latest\n\n$lastError = $error[0]\nSet-PsBreakpoint $lastError.InvocationInfo.ScriptName `\n $lastError.InvocationInfo.ScriptLineNumber
|
combined_dataset/train/non-malicious/1733.ps1 | 1733.ps1 |
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string] $Manifest,
[string] $Name = 'EventResource',
[Parameter()]
[ValidateNotNullOrEmpty()]
[string] $Namespace = 'System.Management.Automation.Tracing',
[Parameter(Mandatory)]
[ValidateNotNullOrEmp... |
combined_dataset/train/non-malicious/1487.ps1 | 1487.ps1 | [CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Path
)
Set-StrictMode -Version 'Latest'
function ConvertTo-Expression
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string]
$InputObject
)
process
... |
combined_dataset/train/non-malicious/sample_30_72.ps1 | sample_30_72.ps1 | # These Pester tests are for the for parameter-* and ex-path* snippets.
# Take a look at the .vscode\tasks.json file to see how you can create
# and configure a test task runner that will run all the Pester tests
# in your workspace folder.
# To run these Pester tests, press Ctrl+Shift+T or press Ctrl+Shift+P,
#... |
combined_dataset/train/non-malicious/1565.ps1 | 1565.ps1 |
function Add-MrStartupVariable {
[CmdletBinding(SupportsShouldProcess)]
param (
[Parameter(Mandatory)]
[ValidateSet('AllUsersAllHosts', 'AllUsersCurrentHost', 'CurrentUserAllHosts', 'CurrentUserCurrentHost')]
$Location
)
$Content = @'
$StartupVars = @()
$StartupVars = Get-Va... |
combined_dataset/train/non-malicious/2001.ps1 | 2001.ps1 |
using namespace System.Text
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
Import-Module HelpersCommon
Import-Module PSSysLog
enum LogLevel
{
LogAlways = 0x0
Critical = 0x1
Error = 0x2
Warning = 0x3
Informational = 0x4
Verbose = 0x5
Debug = 0x14
}
enum LogChannel
{
... |
combined_dataset/train/non-malicious/sample_48_97.ps1 | sample_48_97.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_15.ps1 | Get-Parameter_15.ps1 | function Get-Parameter
{
[OutputType('System.String')]
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)]
[String]$Command,
[Parameter(Position=1)]
[String[]]$Name=@('*'),
[Parameter()]
[ValidateSet('Name','Type','Pos','BV','... |
combined_dataset/train/non-malicious/Find-MSDN.ps1 | Find-MSDN.ps1 | function New-UrlFile
{
param( $URL = "http://www.google.com")
$UrlFile = [system.io.Path]::ChangeExtension([system.io.Path]::GetTempFileName(),".url")
$UrlFileContents = `
"[InternetShortcut]",
"URL=$URL"
$UrlFileContents | Set-Content -Path $UrlFile
Get-Item $UrlFile
}
function Find-MSDN
{
par... |
combined_dataset/train/non-malicious/2797.ps1 | 2797.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT DISTINCT
CreationDate,
ProcessId,
ParentProcessId,
ExecutablePath,
CommandLine,
PSComputerName
FROM
*ProcsWMI.tsv
WHERE
ExecutablePath like '%Temp%' or
ExecutablePath like '%Tm... |
combined_dataset/train/non-malicious/sample_18_3.ps1 | sample_18_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Bds'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bds.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/Search Files by Date.ps1 | Search Files by Date.ps1 | <#
Author: Matt Schmitt
Date: 11/30/12
Version: 1.0
From: USA
Email: ithink2020@gmail.com
Website: http://about.me/schmittmatt
Twitter: @MatthewASchmitt
Description
A script for finding files in a directory by Last Accessed Date.
#>
Write-Host "Enter Root Direc... |
combined_dataset/train/non-malicious/sample_19_43.ps1 | sample_19_43.ps1 | ConvertFrom-StringData @'
id_crm_server_baselinekb=Microsoft Dynamics CRM Server Baseline Collector
id_crm_server_baselinekbdesc=Collects diagnostic information related to the CRM Server.
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0Bg... |
combined_dataset/train/non-malicious/sample_0_88.ps1 | sample_0_88.ps1 | #************************************************
# TS_InfoCacheLevelCheck.ps1
# Version 1.0
# Date: 1-2-2012
# Author: v-anecho
# Description: If you are experiencing slow logons or slow enumeration of shares, the InfoCacheLevel registry value may resolve the issue.
#*********************************************... |
combined_dataset/train/non-malicious/2188.ps1 | 2188.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed.")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMess... |
combined_dataset/train/non-malicious/sample_6_73.ps1 | sample_6_73.ps1 | ConvertFrom-StringData @'
id_windowssearchlenovorapidbootcheck_st=The Windows Search service is stopped and the HyperW7Svc64.exe service was detected
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63J... |
combined_dataset/train/non-malicious/sample_43_34.ps1 | sample_43_34.ps1 | <#@ assembly name="System.Collections.dll" #>
<#
var props= new System.Collections.Generic.Dictionary<string,string>();
string line;
System.IO.StreamReader file = new System.IO.StreamReader(this.Host.ResolvePath("data.txt"));
while((line = file.ReadLine()) != null)
{
var parts = line.Split('=');
pr... |
combined_dataset/train/non-malicious/sample_41_47.ps1 | sample_41_47.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydataplane.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Support... |
combined_dataset/train/non-malicious/Join-Collections 2.1.ps1 | Join-Collections 2.1.ps1 | #requires -version 2.1
####################################################################################################
## Version History:
##
## Version 2.1 Use a hashtable to improve join performance significantly
## Version 2.0 Added Join-Object and removed dependency on ConvertFrom-Hashtable
## ... |
combined_dataset/train/non-malicious/Email-ExpiringADAccounts_2.ps1 | Email-ExpiringADAccounts_2.ps1 | Function GetMsgBody {
Write-Output @"
<p>Dear $name,</p>
Your ABC network account is about to expire.<br/>
Please email helpdesk@abc.com or simply hit 'reply', and include the following details to have your account extended.<br/>
<br/>
Your name:<br/>
The department you currently volunteer in:<br/>
... |
combined_dataset/train/non-malicious/ConvertTo-ASCII_2.ps1 | ConvertTo-ASCII_2.ps1 | #requires -version 2.0
#region Help
<#
.SYNOPSIS
Automation script for file character set format conversion to ASCII encoding.
.DESCRIPTION
Script for automating the conversion of files to ASCII format. Good for if you've used Out-File without specifying the
encoding. Which would make a Unicode formatted... |
combined_dataset/train/non-malicious/104.ps1 | 104.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_30_88.ps1 | sample_30_88.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerinstances'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerinstances.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Suppo... |
combined_dataset/train/non-malicious/Test 2.ps1 | Test 2.ps1 | \nTesting from PowerShell 2
|
combined_dataset/train/non-malicious/sample_50_72.ps1 | sample_50_72.ps1 |
# This is a sample script to get user's cred roam data from AD only
# The script must be executed in the context of account with at least read access to user's AD account
# Replace Win2019DC2.contoso2016.com with the fqdn of the DC
# Replace contoso2016\credroamtu1 with the domain_name\user_name of the target user... |
combined_dataset/train/non-malicious/sample_14_27.ps1 | sample_14_27.ps1 | ConvertFrom-StringData @'
id_kb2475761title=Checking Event Logs
id_kb2475761description=Checking event logs for known issues.
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIB... |
combined_dataset/train/non-malicious/Get_Set Signature 2.0.ps1 | Get_Set Signature 2.0.ps1 | #Requires -version 2.0
## Authenticode.psm1 updated for PowerShell 2.0 (with time stamping)
####################################################################################################
## Wrappers for the Get-AuthenticodeSignature and Set-AuthenticodeSignature cmdlets
## These properly parse paths, so they... |
combined_dataset/train/non-malicious/811.ps1 | 811.ps1 | class MyClass {
[String] $Name;
[Int32] $Number; }
[bool]$scriptBool = $false
$scriptInt = 42
function Test-Variables {
$strVar = "Hello"
[string]$strVar2 = "Hello2"
$arrVar = @(1, 2, $strVar, $objVar)
$assocArrVar = @{ firstChild = "Child"; secondChild = 42 }
$classVar = [MyClass]::new();
$classVar.Name = "... |
combined_dataset/train/non-malicious/sample_21_85.ps1 | sample_21_85.ps1 | ConvertFrom-StringData @'
###PSLOC
NoCommands = Get-NetTCPConnection and Get-NetUDPEndpoint commands not available. Ensure NetTCPIP module is installed.
CannotReadTargetFile = Unable to read {0}. Error: {1}
ByOpAndService = Getting targets by Operation Type: {0} and Service: {1}
ByOp = Getting targets by Operatio... |
combined_dataset/train/non-malicious/sample_56_9.ps1 | sample_56_9.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/1104.ps1 | 1104.ps1 |
$appPoolName = 'CarbonGetIisAppPool'
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
Install-IisAppPool -Name $appPoolName
}
function Stop-Test
{
if( (Test-IisAppPool -Name $appPoolName) )
{
Uninstall-I... |
combined_dataset/train/non-malicious/Update phone # in AD.ps1 | Update phone # in AD.ps1 | #------------------------------------------------------------------------------
# Strips off the '1-' prefix from phone numbers stored in Active Directory.
# Requires 'ActiveRoles Management Shell for Active Directory' from Quest
# Software.
#-------------------------------------------------------------------------... |
combined_dataset/train/non-malicious/Export-PSCredential_3.ps1 | Export-PSCredential_3.ps1 | # Author: Hal Rottenberg <hal@halr9000.com>
# Url: http://halr9000.com/article/tag/lib-authentication.ps1
# Purpose: These functions allow one to easily save network credentials to disk in a relatively
# secure manner. The resulting on-disk credential file can only [1] be decrypted
# by the same user account... |
combined_dataset/train/non-malicious/1348.ps1 | 1348.ps1 |
function Get-CSslCertificateBinding
{
[CmdletBinding()]
[OutputType([Carbon.Certificates.SslCertificateBinding])]
param(
[IPAddress]
$IPAddress,
[UInt16]
$Port
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PS... |
combined_dataset/train/non-malicious/518.ps1 | 518.ps1 |
function Export-SPList{
param(
[Parameter(Mandatory=$true)]
[String]
$ListUrl,
[Parameter(Mandatory=$false)]
[String]
$Path = "C:\temp",
[Switch]
$NoFileCompression
)
if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue... |
combined_dataset/train/non-malicious/AddTo-HostsFile_2.ps1 | AddTo-HostsFile_2.ps1 | function AddTo-HostsFile{
<#
.DESCRIPTION
This function checks to see if an entry exists in the hosts file.
If it does not, it attempts to add it and verifies the entry.
.EXAMPLE
Networkign.AddTo-Hosts -IPAddress 192.168.0.1 -HostName MyMachine
.EXTERNALHELP
None.
.FORWARDHELPTARGE... |
combined_dataset/train/non-malicious/1743.ps1 | 1743.ps1 |
param (
[string] $location = "/powershell",
[string] $destination = '/mnt',
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")]
[ValidateNotNullOrEmpty()]
[string]$ReleaseTag,
[switch]$TarX64,
[switch]$TarArm,
[switch]$TarArm64,
[switch]$FxDependent,
[switch]$Alpi... |
combined_dataset/train/non-malicious/d2585c36-111c-47e6-87c4-568d89c06c20.ps1 | d2585c36-111c-47e6-87c4-568d89c06c20.ps1 | hi
i want a script in powershell that talks to the sharepoint and takes two arguments one is Ip address or server name other is config.xml file.
It checks if server exists and if yes it asks for user name and password and display error to the user accordingly . also it checks for duplicate entries in config.xml ... |
combined_dataset/train/non-malicious/2102.ps1 | 2102.ps1 |
Describe "NativeLinuxCommands" -tags "CI" {
BeforeAll {
$originalDefaultParams = $PSDefaultParameterValues.Clone()
$PSDefaultParameterValues["It:Skip"] = $IsWindows
$originalPath = $env:PATH
$env:PATH += [IO.Path]::PathSeparator + $TestDrive
}
AfterAll {
$global:PS... |
combined_dataset/train/non-malicious/sample_7_18.ps1 | sample_7_18.ps1 | ConvertFrom-StringData @'
id_Files=Collecting Log Files
ID_FilesCab=Cabinet Files
ID_FilesLogs=Log Files
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCG... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.