full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/Add Voice to Powershell_2.ps1 | Add Voice to Powershell_2.ps1 | ###
# Description: Add Voice to Powershell
# Version: 1.1 (11 Nov 2008)
# Mike Hays / www.mike-hays.net / blog.mike-hays.net
# Virtualization, Powershell, and more...
###
# This is the actual speaking part. I cheat by adding spaces
# (This makes the word sound right).
$spokenText = "Super ca li fragilistic e... |
combined_dataset/train/non-malicious/sample_14_37.ps1 | sample_14_37.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 = '80.0.0'
# Supported... |
combined_dataset/train/non-malicious/4141.ps1 | 4141.ps1 | Function GetRelativePath {
$Global:RelativePath=(split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\"
}
Function GetPrinterList {
Set-Variable -Name Count -Scope Local -Force
Set-Variable -Name DefaultPrinter -Scope Local -Force
Set-Variable -Name Printers -Scope Local -Force
Set-Variable -Name Temp -Sc... |
combined_dataset/train/non-malicious/Execute-SQLCommand_2.ps1 | Execute-SQLCommand_2.ps1 | function Execute-SQLCommand {param( [string]$Server, #the host name of the SQL server
[string]$Database, #the name of the database
[System.Data.SqlClient.SqlCommand]$Command) #the command to execute (name of stored procedure)
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection
$sqlCo... |
combined_dataset/train/non-malicious/sample_57_72.ps1 | sample_57_72.ps1 | # Import the helper functions
Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false
function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param
(
[parameter(Mandatory = $true)]
[System.String]
$Category
)
#Write-Verbose "Use this cmdlet t... |
combined_dataset/train/non-malicious/Highlight-Syntax 1.0.ps1 | Highlight-Syntax 1.0.ps1 | # Highlight-Syntax.ps1
# version 1.0
# by Jeff Hillman
#
# this script uses regular expressions to highlight PowerShell
# syntax with HTML.
param( [string] $code, [switch] $LineNumbers )
if ( Test-Path $code -ErrorAction SilentlyContinue )
{
$code = Get-Content $code | Out-String
}
$backgroundColor... |
combined_dataset/train/non-malicious/Build-TFSProjects_2.ps1 | Build-TFSProjects_2.ps1 | #-------------------------------------------------------------------------
# Script that will:
# 1. Create a workspace. Workspacce Name: _Root
# 2. Get the latest code from repository
#-------------------------------------------------------------------------
Param(
[switch]
$CSRWEB,
[switch]... |
combined_dataset/train/non-malicious/sample_14_71.ps1 | sample_14_71.ps1 | #************************************************
# DC_NgenCollect.ps1
# Version 1.0
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects .Net Framework nGen files
# Called from: TS_AutoAddCommands_Apps.ps1
#*******************************************************
Trap [Excep... |
combined_dataset/train/non-malicious/1987.ps1 | 1987.ps1 |
Describe "New-Alias DRT Unit Tests" -Tags "CI" {
It "New-Alias Constant should throw SessionStateUnauthorizedAccessException"{
New-Alias -Name "ABCD" -Value "foo" -Option "Constant" -Force:$true
$e = { New-Alias -Name "ABCD" -Value "foo" -Force:$true -Scope 1 -ErrorAction Stop } |
Should -Throw -ErrorId "Alia... |
combined_dataset/train/non-malicious/validate an IP address_3.ps1 | validate an IP address_3.ps1 | # validate given IP address as an IPAdress (given string input)
PARAM($IP=$(read-host "Enter any IP Address"))
## YOU could do this, but ...
# $IP -match "(\\d{1,3}).(\\d{1,3}).(\\d{1,3}).(\\d{1,3})" -and -not ([int[]]$matches[1..4] -gt 255)
## you shouldn't parse things yourself when it's in the framework. You... |
combined_dataset/train/non-malicious/sample_64_87.ps1 | sample_64_87.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param (
[Parameter(Manda... |
combined_dataset/train/non-malicious/sample_19_62.ps1 | sample_19_62.ps1 | <#
.SYNOPSIS
Turns on WinRM service and adds the IP address for the given machine to the WinRM TrustedHosts file.
.PARAMETER HyperVmName
The name of the computer to register remote management for (i.e. your TestVM/DevVm).
The first valid IPv4 address for this machine will be discovered and added to t... |
combined_dataset/train/non-malicious/sample_42_39.ps1 | sample_42_39.ps1 | #
# Module manifest for module 'OCI.PSModules'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
# ID u... |
combined_dataset/train/non-malicious/Repair-ScriptQuotes.ps1 | Repair-ScriptQuotes.ps1 | function Repair-ScriptQuotes {
param (
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string]$path
)
if ( !( Test-Path $path ) ) {
Write-Warning "'$path' does not exist."
Continue
}
(( Get-Content $path) |
ForEach-Object {
... |
combined_dataset/train/non-malicious/Powershell Only Outlook.ps1 | Powershell Only Outlook.ps1 | #connect to outlook
$GetOutlook = New-Object -com "Outlook.Application";
$olName = $GetOutlook.GetNamespace("MAPI")
$olxEmailFolder = $olName.GetDefaultFolder(‘olFolderInbox’)
$olxEmailFolder.Name
$olxEmailItem = $olxemailFolder.items
#show unread emails in inbox
$olxEmailItem | ?{$_.Unread -eq $True} | select ... |
combined_dataset/train/non-malicious/941.ps1 | 941.ps1 |
$apiVersion = "2015-04-08"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$accountResourceName = $accountName + "/sql/"
$databaseName = "database1"
$databaseResourceName = $accountName + "/sql/" + $databaseName
$databaseResourceType = "Microsoft.DocumentDb/databaseAccounts/apis/databases"
$con... |
combined_dataset/train/non-malicious/sample_18_11.ps1 | sample_18_11.ps1 | 'use strict';$(document).ready(function(){function c(){if("undefined"!==typeof window.partnerScripts&&"undefined"!==typeof window.partnerScripts.contentSquare){var a=document.createElement("script");a.type="text/javascript";a.setAttribute("src",window.partnerScripts.contentSquare.entryFile);a.setAttribute("id","content... |
combined_dataset/train/non-malicious/New-VMHostShellAccount.ps1 | New-VMHostShellAccount.ps1 | # original by c_shanklin @ http://communities.vmware.com/message/1013362#1013362
function New-VMHostShellAccount {
param (
$Name,
$Password = $null,
$Description = $null,
$PosixId = $null
)
$SvcInstance = Get-View serviceinstance
$AcctMgr = Get-View $SvcInstance.Content.AccountManager
$AcctSpec... |
combined_dataset/train/non-malicious/sample_30_26.ps1 | sample_30_26.ps1 | #
# Module manifest for module 'Az.ApplicationInsights'
#
# Generated by: Microsoft Corporation
#
# Generated on: 23/04/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.ApplicationInsights.psm1'
# Version number of this module.
ModuleVersion = '2.2.5'
#... |
combined_dataset/train/non-malicious/sample_1_53.ps1 | sample_1_53.ps1 | #************************************************
# DC_RDSSession.ps1
# Version 1.0.1
# Date: 29-01-2012
# Author: Daniel Grund - dgrund@microsoft.com
# Description:
# This script gets the RDP Session Broker info
# and checks vital signs to inform user.
# 1.0.0 Beta release
#********************************... |
combined_dataset/train/non-malicious/sample_6_1.ps1 | sample_6_1.ps1 | <#
.SYNOPSIS
This module is part of TSS FW and implements support for tracing Container scenarios
.DESCRIPTION
This module is part of TSS FW and implements support for tracing Container scenarios
.NOTES
Dev. Lead: wiaftrin, milanmil
Authors : wiaftrin, milanmil
Requires : PowerShell V4(Supported f... |
combined_dataset/train/non-malicious/sample_30_92.ps1 | sample_30_92.ps1 | # Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
$ociTopLevelCommands = @()
$ociSubcommands = @{}
$ociCommandsToLongParams = @{}
$ociCommandsToShortParams = @{}
$PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
$slash = [IO.Path]::DirectorySeparatorChar
$FolderP... |
combined_dataset/train/non-malicious/290.ps1 | 290.ps1 | function Enable-PSFTaskEngineTask
{
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Enable-PSFTaskEngineTask')]
Param (
[Parameter(ValueFromPipeline = $true, Mandatory = $true)]
[PSFramework.TaskEngine.PsfTask[]]
$Task
)
begin
{
$didSomething = $false
}
process
{... |
combined_dataset/train/non-malicious/sample_43_30.ps1 | sample_43_30.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Autoscale.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Autoscale.internal.psm1'
if(Test-Path $internalModulePath) {
... |
combined_dataset/train/non-malicious/Chassis Type.ps1 | Chassis Type.ps1 | $SystemEnclosure = Get-WMIObject -Class Win32_SystemEnclosure; $Type = $SystemEnclosure.ChassisTypes; CLS ; Write-Host -BackgroundColor White -ForegroundColor Blue "Chassis Type:"
if ($Type -eq 1)
{Write-Host "$Type - Other"}
elseif ($Type -eq 2)
{Write-Host "$Type - Virtual Machine"}
elseif ($Type -eq 3)
... |
combined_dataset/train/non-malicious/Invoke-LongRunningOperat.ps1 | Invoke-LongRunningOperat.ps1 | ##############################################################################\n##\n## Invoke-LongRunningOperation\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS... |
combined_dataset/train/non-malicious/Script permissions.ps1 | Script permissions.ps1 | <#
.SYNOPSIS
Applies permissions and roles to vSphere vApps
.DESCRIPTION
Applies permissions and roles to vSphere vApps
-VIServer (Optional, defaults to Development) {FQDN of VCentre Server}
-AppName (Required) {VApp Label}
-ADGroup (Optional) {Domain\\Group_Object}
-Role (Optional) {vSphere Role, ReadO... |
combined_dataset/train/non-malicious/3992.ps1 | 3992.ps1 |
function ServiceBusTopicTests {
$location = Get-Location
$resourceGroupName = getAssetName "RGName-"
$namespaceName = getAssetName "Namespace-"
$nameTopic = getAssetName "Topic-"
Write-Debug "Create resource group"
New-AzResourceGroup -Name $resourceGroupName -Location $loc... |
combined_dataset/train/non-malicious/1232.ps1 | 1232.ps1 |
[CmdletBinding()]
param(
)
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Carbon\Import-Carbon.ps1' -Resolve)
$installRoot = Get-PowerShellModuleInstallPath
$carbonModuleRoot = Join-Path -Path $installRoot -ChildPath 'Carbon'
Install-Junction -Link $carbonModuleRoot -Targe... |
combined_dataset/train/non-malicious/sample_17_41.ps1 | sample_17_41.ps1 | ConvertFrom-StringData @'
id_appliedsectemploutput=Applied Security Templates
id_appliedsectemplobtaining=Gathering applied security templates
'@
# SIG # Begin signature block
# MIIoVAYJKoZIhvcNAQcCoIIoRTCCKEECAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
#... |
combined_dataset/train/non-malicious/sample_55_53.ps1 | sample_55_53.ps1 | function Invoke-RunTests {
Param(
[Parameter(Mandatory = $true)]
$ContainerName,
[Parameter(Mandatory = $false)]
$Tenant,
[Parameter(Mandatory = $true)]
$CompanyName,
[Parameter(Mandatory = $false)]
[pscredential]$Credential,
[Parameter(Mandato... |
combined_dataset/train/non-malicious/sample_31_0.ps1 | sample_31_0.ps1 | #
# Module manifest for module 'OCI.PSModules.Managementagent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Managementagent.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported P... |
combined_dataset/train/non-malicious/Invoke-Standby.ps1 | Invoke-Standby.ps1 | #Autor: Mateusz Świetlicki
#Site: mateusz.swietlicki.net
#Create: 2010-10-04
function Invoke-Shutdown
{
&"$env:SystemRoot\\System32\\shutdown.exe" -s
}
function Invoke-Reboot
{
&"$env:SystemRoot\\System32\\shutdown.exe" -r
}
function Invoke-Logoff
{
&"$env:SystemRoot\\System32\\shutd... |
combined_dataset/train/non-malicious/sample_23_98.ps1 | sample_23_98.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.Synopsis
Registers or unregisters the PowerShell ETW manifest
.Parameter Path
The fully qualified path to the PowerShell.Core.Instrumentation.man manifest file.
The default value is the location of this script.
.Paramet... |
combined_dataset/train/non-malicious/sample_50_48.ps1 | sample_50_48.ps1 | #
# This script handles common telemetry tasks for Install.ps1 and Add-AppDevPackage.ps1.
#
function IsVsTelemetryRegOptOutSet()
{
$VsTelemetryRegOptOutKeys = @(
"HKLM:\SOFTWARE\Policies\Microsoft\VisualStudio\SQM",
"HKLM:\SOFTWARE\Wow6432Node\Microsoft\VSCommon\16.0\SQM",
"HKLM:\S... |
combined_dataset/train/non-malicious/1641.ps1 | 1641.ps1 |
function Get-MAC ($comp = $env:computername) {
$ping = New-Object System.Net.NetworkInformation.Ping
$result = $ping.Send($comp)
if ($result.Status -eq 'Success') {
$ip = $result.Address
$port = 137
$ipEP = New-Object System.Net.IPEndPoint ([ipaddress]::Parse($ip), $port)
... |
combined_dataset/train/non-malicious/sample_67_41.ps1 | sample_67_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Adm'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Adm.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_58_73.ps1 | sample_58_73.ps1 | #
# Module manifest for module 'OCI.PSModules.Tenantmanagercontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Tenantmanagercontrolplane.dll'
# Version number of this module.
ModuleVersion = '83... |
combined_dataset/train/non-malicious/sample_17_38.ps1 | sample_17_38.ps1 | #
# Module manifest for module 'OCI.PSModules.Datalabelingservicedataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datalabelingservicedataplane.dll'
# Version number of this module.
ModuleVersion... |
combined_dataset/train/non-malicious/New-WebServiceProxy_2.ps1 | New-WebServiceProxy_2.ps1 | #
# New-WebServiceProxy.ps1 (v3.0 Sep 23, 2009)
#
# Oisin Grehan <oising@gmail.com> (x0n)
#
# Usage:
# $proxy = .\\New-WebServiceProxy.ps1 [-Url] http://site/service.asmx [-Anonymous] [[-SoapProtocol] <Soap | Soap12>] [-Namespace <namespace>]
#
# to see available webmethods:
# $proxy | gm
#
# $url = "h... |
combined_dataset/train/non-malicious/sample_37_83.ps1 | sample_37_83.ps1 | #
# Module manifest for module 'OCI.PSModules.Goldengate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Goldengate.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_12_94.ps1 | sample_12_94.ps1 | #************************************************
# TS_VeritasVXIOBadConfigFlags.ps1
# Version 1.0.1
# Date: 5/16/2012
# Author: v-kaw
# Description: [Idea ID 3919] [Windows] Create Shadow Copy fail only on VERTIAS storage foundation volume
# Rule number: 3919
# Rule URL: //sharepoint/sites/rules/Rule%20Submi... |
combined_dataset/train/non-malicious/TheGameOfLife_1.ps1 | TheGameOfLife_1.ps1 | #TheGameOfLife.ps1
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
$SCRIPT:hostProperties = @{};
$SCRIPT:hostState = $null;
$SCRIPT:BoardWidth = 50;
$SCRIPT:BoardHeight = 50;
Function Initialize-Host
{
Param(
[Parameter(Mandatory=$false)]
$wndTitle = "Game of Life... |
combined_dataset/train/non-malicious/2169.ps1 | 2169.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, HelpMessag... |
combined_dataset/train/non-malicious/3782.ps1 | 3782.ps1 |
function Test-CloudEndpoint
{
$resourceGroupName = Get-ResourceGroupName
Write-Verbose "RecordMode : $(Get-StorageTestMode)"
try
{
$storageSyncServiceName = Get-ResourceName("sss")
$syncGroupName = Get-ResourceName("sg")
$cloudEndpointName = Get-Resou... |
combined_dataset/train/non-malicious/sample_54_14.ps1 | sample_54_14.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 = '82.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/1120.ps1 | 1120.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldNotFindNonExistentAppPool
{
$exists = Test-IisAppPool -Name 'ANameIMadeUpThatShouldNotExist'
Assert-False $exists "A non-existent app pool exists."
Assert-NoError
}
... |
combined_dataset/train/non-malicious/sample_1_9.ps1 | sample_1_9.ps1 | ConvertFrom-StringData @'
id_ctsbitsserver=BITS Server Component
id_ctsbitsserverdescription=Collects information about the BITS server component.
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNL... |
combined_dataset/train/non-malicious/sample_0_64.ps1 | sample_0_64.ps1 | [dynamic, provider("dcismprovider"), Association]
class DCIM_IPMISOLRBAIdentityMemberOfCollection : CIM_MemberOfCollection
{
[
Description ("The aggregated member of the Collection."),
Key,
Override ("Member")
]
CIM_ManagedElement REF Member;
[
Aggregate,
... |
combined_dataset/train/non-malicious/sample_64_66.ps1 | sample_64_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Announcementsservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Announcementsservice.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# S... |
combined_dataset/train/non-malicious/sample_13_83.ps1 | sample_13_83.ps1 | <#
.SYNOPSIS
Scenario module for collecting machine licensing/activation related data
.DESCRIPTION
Collect machine licensing/activation related troubleshooting data
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedback : htt... |
combined_dataset/train/non-malicious/sample_10_93.ps1 | sample_10_93.ps1 | ConvertFrom-StringData @'
id_remotedesktoplserverkb2512845_sd=The version of Terminal Services Licensing installed on this computer is incompatible with Windows Server 2008 (or newer) Remote Desktop Services
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgE... |
combined_dataset/train/non-malicious/sample_37_17.ps1 | sample_37_17.ps1 | BeforeAll {
$ModuleManifestName = 'SampleModule.psd1'
Import-Module $PSScriptRoot\..\$ModuleManifestName
}
Describe 'Module Manifest Tests' {
It 'Passes Test-ModuleManifest' {
Test-ModuleManifest -Path $PSScriptRoot\..\$ModuleManifestName
$? | Should -Be $true
}
}
# SIG # Beg... |
combined_dataset/train/non-malicious/sample_18_79.ps1 | sample_18_79.ps1 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apa... |
combined_dataset/train/non-malicious/sample_58_48.ps1 | sample_58_48.ps1 | #
# Module manifest for Dell Command | PowerShell Provider 'DellBIOSProvider'
#
# Generated by: Dell BizClient Team
#
# Generated on: 4/30/2014
#
@{
# Script module or binary module file associated with this manifest
RootModule = 'DellBIOSProvider.dll'
# Version number of this module.
ModuleVersion = '... |
combined_dataset/train/non-malicious/vProfiles_1.ps1 | vProfiles_1.ps1 | #
# vProfiles V1
# By Alan Renouf
# http://virtu-al.net
#
#Generated Form Function
function GenerateForm {
########################################################################
# Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) v1.0.3.0
# Generated On: 27/06/2009 9:17 PM
# Generated... |
combined_dataset/train/non-malicious/sample_48_80.ps1 | sample_48_80.ps1 | #
# Module manifest for module 'OCI.PSModules.Computecloudatcustomer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computecloudatcustomer.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
... |
combined_dataset/train/non-malicious/sample_31_70.ps1 | sample_31_70.ps1 | # Nushell Environment Config File
#
# version = "0.91.0"
def create_left_prompt [] {
let dir = match (do --ignore-shell-errors { $env.PWD | path relative-to $nu.home-path }) {
null => $env.PWD
'' => '~'
$relative_pwd => ([~ $relative_pwd] | path join)
}
let path_color = (if (is-adm... |
combined_dataset/train/non-malicious/sample_26_57.ps1 | sample_26_57.ps1 | @{
GUID="c61d6278-02a3-4618-ae37-a524d40a7f44 "
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
ModuleToProcess="PSDiagnostics.psm1"
Func... |
combined_dataset/train/non-malicious/ISE-Comments.ps1 | ISE-Comments.ps1 | #requires -version 2.0
## ISE-Comments module v 1.0
## DEVELOPED FOR CTP3
## See comments for each function for changes ...
##############################################################################################################
## Provides Comment cmdlets for working with ISE
## ConvertTo-BlockComment - C... |
combined_dataset/train/non-malicious/sample_67_76.ps1 | sample_67_76.ps1 | #
# Module manifest for module 'OCI.PSModules.Adm'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Adm.dll'
# Version number of this module.
ModuleVersion = '90.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_32_37.ps1 | sample_32_37.ps1 | #
# Module manifest for module 'OCI.PSModules.Devops'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Devops.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/Highlight-Syntax _1.0.ps1 | Highlight-Syntax _1.0.ps1 | # Highlight-Syntax.ps1
# version 1.0
# by Jeff Hillman
#
# this script uses regular expressions to highlight PowerShell
# syntax with HTML.
param( [string] $code, [switch] $LineNumbers )
if ( Test-Path $code -ErrorAction SilentlyContinue )
{
$code = Get-Content $code | Out-String
}
$backgroundColor... |
combined_dataset/train/non-malicious/4287.ps1 | 4287.ps1 |
function createdropper($killdate, $enckey, $domainfrontheader, $ipv4address, $serverport, $username, $password, $proxyurl, [switch]$Daisy, [switch]$Proxy, [switch]$Insecure, $useragent, $referer) {
$newImplant = $urlstring -split ","
$newImplantURL = $newImplant[0] -replace '"',''
if ($Daisy.IsPresent) {
$conne... |
combined_dataset/train/non-malicious/531.ps1 | 531.ps1 |
function Get-SPUrl {
param(
[Parameter(Mandatory=$true)]
$SPobject
)
if($SPobject.PsObject.TypeNames -contains "System.String"){
[Uri]$Url = $SPobject
if($Url -match "(/Forms/).*?\.(aspx$)"){
New-Object PSObject -Property @{... |
combined_dataset/train/non-malicious/sample_24_16.ps1 | sample_24_16.ps1 | #
# This script just calls the Add-AppDevPackage.ps1 script that lives next to it.
#
param(
[switch]$Force = $false,
[switch]$SkipLoggingTelemetry = $false
)
$scriptArgs = ""
if ($Force)
{
$scriptArgs = '-Force'
}
if ($SkipLoggingTelemetry)
{
if ($Force)
{
$scriptArgs +... |
combined_dataset/train/non-malicious/2397.ps1 | 2397.ps1 | function Get-MissingUpdates {
[CmdletBinding()]
[OutputType([System.Management.Automation.PSCustomObject])]
param (
[Parameter(Mandatory,
ValueFromPipeline,
ValueFromPipelineByPropertyName)]
[string]$ComputerName
)
begin {
function Get-32BitProgramFilesPath {
if ((Get-Architecture) -eq 'x64') {
${... |
combined_dataset/train/non-malicious/sample_12_87.ps1 | sample_12_87.ps1 |
# This script has dependencies on utils_CTS and utils_DSD
#
param ( [Object[]] $instances )
# 2023-02-20 WalterE mod Trap #we#
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($... |
combined_dataset/train/non-malicious/sample_49_23.ps1 | sample_49_23.ps1 | # Localized 04/14/2024 08:54 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=是(&Y)
PromptNoString=否(&N)
BundleFound=找到了捆绑: {0}
PackageFound=找到包: {0}
EncryptedBundleFound=找到加密的包: {0}
EncryptedPackageFound=找到加密的包: {0}
CertificateFound=找到证书: ... |
combined_dataset/train/non-malicious/sample_18_46.ps1 | sample_18_46.ps1 | [CmdletBinding(PositionalBinding=$false)]
Param(
[string] $configuration = 'Debug',
[string] $task,
[string] $verbosity = 'minimal',
[string] $msbuildEngine = $null,
[switch] $restore,
[switch] $prepareMachine,
[switch] $help,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)
$ci = ... |
combined_dataset/train/non-malicious/3967.ps1 | 3967.ps1 |
function Test-NetworkSecurityGroupCRUD
{
$rgname = Get-ResourceGroupName
$vnetName = Get-ResourceName
$subnetName = Get-ResourceName
$nsgName = Get-ResourceName
$nicName = Get-ResourceName
$domainNameLabel = Get-ResourceName
$rglocation = Get-ProviderLocation ResourceMana... |
combined_dataset/train/non-malicious/PowerShell Template_5.ps1 | PowerShell Template_5.ps1 | Function new-script
{
$strName = $env:username
$date = get-date -format d
$name = Read-Host "Filename"
$email = Read-Host "eMail Address"
$file = New-Item -type file "c:\\Scripts\\$name.ps1" -force
add-content $file "#=========================================================================="
add-content $file ... |
combined_dataset/train/non-malicious/sample_58_25.ps1 | sample_58_25.ps1 | #
# Module manifest for module 'OCI.PSModules.Ocvp'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ocvp.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/style acording video res_1.ps1 | style acording video res_1.ps1 | ---------------------------------------------------------------------------------------------------------------------------
this code is copied from http://www.ti4fun.com/myouikar/JavaScript/rotina.aspx?r=JJiKNeLQlIA[[ti&l=STN[ti]5tehuTA[[ti
---------------------------------------------------------------------------... |
combined_dataset/train/non-malicious/Convert-ToCHexString_3.ps1 | Convert-ToCHexString_3.ps1 | function Convert-ToCHexString {
param([String] $input
$ans = ''
[System.Text.Encoding]::ASCII.GetBytes($str) | % { $ans += "0x{0:X2}, " -f $_ }
return $ans.Trim(',',' ')
}
|
combined_dataset/train/non-malicious/sample_43_15.ps1 | sample_43_15.ps1 | c:\development\directories\projects\vscode-extensions\modules\node-dependencies dev error @typescript-eslint/parser
, Error: Command failed: c:\development\directories\projects\vscode-extensions\modules\node-dependencies npm i -D @typescript-eslint/parser
'c:\development\directories\projects\vscode-extensions\modules\n... |
combined_dataset/train/non-malicious/sample_60_73.ps1 | sample_60_73.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 = '90.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/ESX Lun Latencies_1.ps1 | ESX Lun Latencies_1.ps1 | function Get-VMHostLunLatency {
param([parameter(Mandatory=$true, ValueFromPipeline=$true)] $VMHost)
process {
$luns = Get-ScsiLun -VmHost $VMHost
$DiskStats = $VMHost |
Get-Stat -stat disk.totalreadlatency.average,disk.totalwritelatency.average -maxsamples 1 -realtime
foreach ($lun in $l... |
combined_dataset/train/non-malicious/352.ps1 | 352.ps1 | function Get-PSFFeature
{
[CmdletBinding()]
param (
[string]
$Name = "*"
)
process
{
[PSFramework.Feature.FeatureHost]::Features.Values | Where-Object Name -Like $Name
}
} |
combined_dataset/train/non-malicious/Set-IPAddress_4.ps1 | Set-IPAddress_4.ps1 | # ahhh ... much better. Don't ask for prompts. It's not scriptable if you do.
function Set-IPAddress {
param( [string]$networkinterface,
[string]$ip,
[string]$mask,
[string]$gateway,
[string]$dns1,
[string]$dns2,
[string]$registerDns=$true
)
$dns = $dns1
if($dns2){$dns ="$dns1","... |
combined_dataset/train/non-malicious/3550.ps1 | 3550.ps1 |
function Test-AzureVMGetItems
{
$location = Get-ResourceGroupLocation
$resourceGroupName = Create-ResourceGroup $location
try
{
$vm = Create-VM $resourceGroupName $location 1
$vm2 = Create-VM $resourceGroupName $location 12
$vault = Create-RecoveryServicesVault $resourceGroupName $location
... |
combined_dataset/train/non-malicious/2865.ps1 | 2865.ps1 | task default -depends test
task test {
Push-Location 'missing_build_file'
$result = invoke-psake -Docs | Out-String
Pop-Location
Assert ($result -match 'adefaulttask') 'Default build file should a task called adefaulttask'
} |
combined_dataset/train/non-malicious/3020.ps1 | 3020.ps1 | function GetPesterPsVersion {
(Get-Variable 'PSVersionTable' -ValueOnly).PSVersion.Major
}
function GetPesterOs {
if ((GetPesterPsVersion) -lt 6) {
'Windows'
}
elseif (Get-Variable -Name 'IsWindows' -ErrorAction 'SilentlyContinue' -ValueOnly ) {
'Windows'
}
elseif (Get... |
combined_dataset/train/non-malicious/sample_18_14.ps1 | sample_18_14.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.SYNOPSIS
Starts the language and debug services from the PowerShellEditorServices module.
.DESCRIPTION
PowerShell Editor Services Bootstrapper Script
----------------------------------------------
This script contains... |
combined_dataset/train/non-malicious/sample_16_87.ps1 | sample_16_87.ps1 | ConvertFrom-StringData @'
id_whoamioutput=Whoami Diagnostic Tool
id_whoamistatus=Running Whoami.exe to gather the user's SID, group memberships and privileges
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w... |
combined_dataset/train/non-malicious/4462.ps1 | 4462.ps1 |
Get-PSResource 'TestModule'
Get-PSResource -name 'TestModule'
Get-PSResource 'TestModule' -Type 'Module'
Get-PSResource 'TestModule' -Type 'Module', 'Script', 'Library'
Get-PSResource 'TestModule1', 'TestModule2', 'TestModule3'
Get-PSResource 'TestModule' -MinimumVersion '1.5.0'
Get-PSResource 'TestMod... |
combined_dataset/train/non-malicious/sample_63_48.ps1 | sample_63_48.ps1 | ##########################################################################
# DELL PROPRIETARY INFORMATION
#
# This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this
# software to you under the terms of a license agreement,nondisclosure agreement or both.
# You may not copy, disclose, o... |
combined_dataset/train/non-malicious/Get-FtpList.ps1 | Get-FtpList.ps1 |
function Get-FtpList {
#.Synopsis
# Read a list of files (and directories) from FTP
#.Description
# An initial implementation of a string-parsing lister for FTP which converts lists to objects (in the one format that I've seen -- there are other formats)
#
# This implementation will use whatever proxy is set... |
combined_dataset/train/non-malicious/sample_64_32.ps1 | sample_64_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.apa... |
combined_dataset/train/non-malicious/gpupdate on remote pc's.ps1 | gpupdate on remote pc's.ps1 | ###############################################################################
#
# Get all servers from a OU and run GPUpdate /force on this machines.
#
# Version 1.0
#
# (C) 2009 - Arne Fokkema
# www.ict-freak.nl
#
# Install the Quest AD cmdlets first!!
#
###############################################... |
combined_dataset/train/non-malicious/sample_3_22.ps1 | sample_3_22.ps1 | ConvertFrom-StringData @'
id_2k3poolusagemaximum_sd=Memory Manager trimming process threshold currently set on this machine
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAI... |
combined_dataset/train/non-malicious/1870.ps1 | 1870.ps1 |
Describe "PSReadLine" -tags "CI" {
BeforeAll {
if (Get-Module PSReadLine) {
$originalEditMode = (Get-PSReadLineOption).EditMode
Remove-Module PSReadLine
}
}
It "Should import the module correctly" {
Import-Module PSReadLine
$module = Get-Module PSRe... |
combined_dataset/train/non-malicious/sample_28_51.ps1 | sample_28_51.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/Dell Order Status_2.ps1 | Dell Order Status_2.ps1 | # Version: 0.1
# Author: Stefan Stranger
# Description: Retrieve Dell Order Status
# Start Page Order Status USA: https://support.dell.com/support/order/status.aspx?c=us&cs=19&l=en&s=dhs&~ck=pn
# Start Page Order Status EMEA(nl): http://support.euro.dell.com/support/index.aspx?c=nl&l=nl&s=gen&~ck=bt
# Example Dell... |
combined_dataset/train/non-malicious/sample_60_75.ps1 | sample_60_75.ps1 | $scriptPath = Switch ($Host.name) {
'Visual Studio Code Host' { $psEditor.GetEditorContext().CurrentFile.Path }
'Windows PowerShell ISE Host' { $psISE.CurrentFile.FullPath }
'ConsoleHost' { $PSCommandPath }
default { Write-Error 'Unknown host-process or caller!' }
}
$scriptDirectory = Split-Path $scriptPath -... |
combined_dataset/train/non-malicious/2637.ps1 | 2637.ps1 | $files = ls \\GLWASSQL\Backup2\GLWASSQL\ -Directory -Filter '*FULL*' -Recurse |
Where-Object {$_.FullName -notmatch 'master|model|msdb|SSISDB|Images'} |
ForEach-Object {Get-ChildItem $_.FullName | Sort-Object LastWriteTime -Descending | Select-Object -First 1} |
Sort-Object Size
"--Restore Script Generat... |
combined_dataset/train/non-malicious/1842.ps1 | 1842.ps1 |
return
$cmdletName = "Import-Counter"
. "$PSScriptRoot/CounterTestHelperFunctions.ps1"
$SkipTests = SkipCounterTests
if ( ! $SkipTests )
{
$counterPaths = @(
(TranslateCounterPath "\Memory\Available Bytes")
(TranslateCounterPath "\processor(*)\% Processor time")
(TranslateCount... |
combined_dataset/train/non-malicious/sample_49_12.ps1 | sample_49_12.ps1 | #
# Module manifest for module 'OCI.PSModules.Oda'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Oda.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_32_18.ps1 | sample_32_18.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
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# ... |
combined_dataset/train/non-malicious/415.ps1 | 415.ps1 | function Convert-PsfConfigValue
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseOutputTypeCorrectly", "")]
[CmdletBinding()]
Param (
[string]
$Value
)
begin
{
}
process
{
$index = $Value.IndexOf(":")
if ($index -lt 1) { throw "No type identifier found!" }
$type = $Value.Substring(0, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.