full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/709.ps1 | 709.ps1 |
function Out-RsRestCatalogItemId
{
[CmdletBinding()]
param (
[Parameter(Mandatory = $True)]
$RsItemInfo,
[ValidateScript({ Test-Path $_ -PathType Container})]
[Parameter(Mandatory = $True)]
[string]
$Destination,
[switch]
$Overwrite,
... |
combined_dataset/train/non-malicious/1308.ps1 | 1308.ps1 |
function Split-CIni
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true,ParameterSetName='ByPath')]
[string]
$Path,
[Switch]
$AsHashtable,
[Switch]
$CaseSensitive
)
Set-Strict... |
combined_dataset/train/non-malicious/sample_8_65.ps1 | sample_8_65.ps1 | ConvertFrom-StringData @'
id_clusteripv6firewallcheck_st=One or more Windows Firewall rules are disabled on nodes with IPv6 enabled
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAI... |
combined_dataset/train/non-malicious/New-WebServiceProxy_1.ps1 | New-WebServiceProxy_1.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/1911.ps1 | 1911.ps1 |
Describe 'Get-Error tests' -Tag CI {
BeforeAll {
$skipTest = -not $EnabledExperimentalFeatures.Contains('Microsoft.PowerShell.Utility.PSGetError')
if ($skipTest) {
Write-Verbose "Test Suite Skipped. The test suite requires the experimental feature 'Microsoft.PowerShell.Utility.PSGetEr... |
combined_dataset/train/non-malicious/sample_42_33.ps1 | sample_42_33.ps1 | #
# Module manifest for module 'OCI.PSModules.Databasemanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Databasemanagement.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Suppo... |
combined_dataset/train/non-malicious/3291.ps1 | 3291.ps1 | enum DiscordMessageType {
DEFAULT = 0
RECIPIENT_ADD = 1
RECIPIENT_REMOVE = 2
CALL = 3
CHANNEL_NAME_CHANGE = 4
CHANNEL_ICON_CHANGE = 5
CHANNEL_PINNED_MESSAGE = 6
GUILD_MEMBER_JOIN = 7
USER_PREMIUM_GUILD_SUBSCRIPTION = 8
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1 = 9
USER_PREMIUM_G... |
combined_dataset/train/non-malicious/Execute-SQLCommand_1.ps1 | Execute-SQLCommand_1.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/VM Performance Report_3.ps1 | VM Performance Report_3.ps1 | <#
.SYNOPSIS
The script creates an HTML report for given vSphere VM's, that contains VM performance data over a given period. The script then emails the report to a given address.
.DESCRIPTION
The script requires an input file, supplied as an argument to the script. The first line of this file contains an e... |
combined_dataset/train/non-malicious/sample_15_2.ps1 | sample_15_2.ps1 | @{
GUID="{Fb6cc51d-c096-4b38-b78d-0fed6277096a}"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
RootModule="Microsoft.Management.Infrastructure.CimCmdlets"
RequiredAssembli... |
combined_dataset/train/non-malicious/sample_60_62.ps1 | sample_60_62.ps1 | function Stop-AzFunctionApp {
[OutputType([System.Boolean])]
[CmdletBinding(DefaultParameterSetName='StopByName', SupportsShouldProcess=$true, ConfirmImpact='Medium')]
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Description('Stops a function app.')]
param(
[Parameter(ParameterSetName='Sto... |
combined_dataset/train/non-malicious/730.ps1 | 730.ps1 |
function Remove-RsCatalogItem
{
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
param (
[Alias('ItemPath', 'Path', 'RsFolder')]
[Parameter(Mandatory = $True, ValueFromPipeline = $true)]
[ System.Object[] ]
$RsItem,
[string]
$Report... |
combined_dataset/train/non-malicious/3675.ps1 | 3675.ps1 |
function Test-SetGetManagedInstanceEncryptionProtectorCI
{
$params = Get-SqlServerKeyVaultKeyTestEnvironmentParameters
$managedInstance = Get-ManagedInstanceForTdeTest $params
$mangedInstanceRg = $managedInstance.ResourceGroupName
$managedInstanceName = $managedInstance.ManagedInstanceName
$encry... |
combined_dataset/train/non-malicious/Set-ConsoleProperties.ps.ps1 | Set-ConsoleProperties.ps.ps1 | ## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n\nSet-StrictMode -Version Latest\n\nPush-Location\nSet-Location HKCU:\\Console\nNew-Item '.\\%SystemRoot%_system32_WindowsPowerShell_v1.0_powershell.exe'\nSet-Location '.\\%SystemRoot%_system32_WindowsPowerShell_v1.0_powe... |
combined_dataset/train/non-malicious/4201.ps1 | 4201.ps1 |
[CmdletBinding()]
param ()
function Get-MaximumResolution {
$Monitors = @()
$HardwareIDs = (Get-WmiObject Win32_PNPEntity | where-object { $_.PNPClass -eq "Monitor" }).HardwareID | ForEach-Object { $_.Split("\")[1] }
foreach ($Monitor in $HardwareIDs) {
$Object = New-Object -TypeName System.Management.Aut... |
combined_dataset/train/non-malicious/Hex2Dec_5.ps1 | Hex2Dec_5.ps1 | <!DOCTYPE html>
<html>
<head>
<title>He2Dec</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript" type="text/javascript">
var num = {
hex2dec : function(n) {
return Number(n) ? Number(n) : 'Wrong data type';
},
... |
combined_dataset/train/non-malicious/sample_56_87.ps1 | sample_56_87.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_29_46.ps1 | sample_29_46.ps1 | #
# Module manifest for module 'OCI.PSModules.Licensemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSE... |
combined_dataset/train/non-malicious/ConvertTo-Hex_4.ps1 | ConvertTo-Hex_4.ps1 | # Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx
param ( [string]$SidString )
# Create SID .NET object using SID string provided
$sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring
# Create a byte array of the proper length
$sidBytes = New-Object byte[] ... |
combined_dataset/train/non-malicious/sample_2_51.ps1 | sample_2_51.ps1 | ConvertFrom-StringData @'
id_ctsdhcpclient=DHCP Client
id_ctsdhcpclientdescription=Collects information about DHCP Client.
'@
# SIG # Begin signature block
# MIIoPAYJKoZIhvcNAQcCoIIoLTCCKCkCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAI... |
combined_dataset/train/non-malicious/sample_32_72.ps1 | sample_32_72.ps1 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
#-------------------------------------------------------------------------
#
# Returns given date-time by locale 'en-us'
#
Function Global:GetDateTimeLocaleEnUs
{
param
... |
combined_dataset/train/non-malicious/sample_50_21.ps1 | sample_50_21.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/3624.ps1 | 3624.ps1 | $files = Get-ChildItem . *.cs -rec
foreach ($file in $files)
{
(Get-Content $file.PSPath) |
Foreach-Object { $_ -replace "Management.Sql", "Management.Sql.LegacySdk" } |
Set-Content $file.PSPath
}
|
combined_dataset/train/non-malicious/sample_7_66.ps1 | sample_7_66.ps1 | # ***********************************************************************************************
# Version 1.0
# Date: 02-17-2012 -- Last edit: 2022-06-01
# Author: Vinay Pamnani - vinpa@microsoft.com
# Description: Utility Script to load common functions.
# 1. Defines commonly used functions in the Troublesho... |
combined_dataset/train/non-malicious/Get-WebFile 3.7.2.ps1 | Get-WebFile 3.7.2.ps1 | ## Get-WebFile (aka wget for PowerShell)
##############################################################################################################
## Downloads a file or page from the web
## History:
## v3.7.2 - Puts a try-catch block around $writer = new-object System.IO.FileStream and returns/breaks to
## ... |
combined_dataset/train/non-malicious/Check latest BIOS Rev_1.ps1 | Check latest BIOS Rev_1.ps1 | $BiosRev = Get-WmiObject -Class Win32_BIOS -ComputerName $ComputerName -Credential $Credentials
# Shortened URL for the Dell Support page, fileid=441102, appears to be the identifier for BIOS downloads
# I tested this on a few different models of Dell workstations.
$DellBIOSPage = "http://support.dell.com/suppor... |
combined_dataset/train/non-malicious/sample_38_24.ps1 | sample_38_24.ps1 | function Invoke-RepoApi {
[CmdletBinding()]
param ()
process {
$token = $(az account get-access-token --resource 6befca88-4c28-430a-957e-f870b267bcfc --query accessToken)
$results = $Null
try {
$results = Invoke-RestMethod -Method Get -Uri "https://buildapi.docs.... |
combined_dataset/train/non-malicious/sample_49_65.ps1 | sample_49_65.ps1 | param([int]$Count=50, [int]$DelayMilliseconds=200)
function Write-Item($itemCount) {
$i = 1
while ($i -le $itemCount) {
$str = "Output $i"
Write-Output $str
# In the gutter on the left, right click and select "Add Conditional Breakpoint"
# on the next line. Use the c... |
combined_dataset/train/non-malicious/702.ps1 | 702.ps1 |
function New-RscatalogItemRoleObject
{
[cmdletbinding()]
param
(
[Parameter(Mandatory=$True)]
[Object[]] $Policy,
[Parameter(Mandatory=$True)]
[String]$Path,
[Parameter(Mandatory=$True)]
[String]$TypeName,
[Parameter(Mandatory=$True)]
... |
combined_dataset/train/non-malicious/sample_51_88.ps1 | sample_51_88.ps1 | ###-begin-{pkgname}-completion-###
Register-ArgumentCompleter -CommandName '{pkgname}' -ScriptBlock {
param(
$WordToComplete,
$CommandAst,
$CursorPosition
)
function __{pkgname}_debug {
if ($env:BASH_COMP_DEBUG_FILE) {
"$args" | Out-File -Append ... |
combined_dataset/train/non-malicious/sample_40_5.ps1 | sample_40_5.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/Get-MSCSRestartAction.ps1 | Get-MSCSRestartAction.ps1 | param($cluster)
gwmi -ComputerName $cluster -Namespace "root\\mscluster" -Class MSCluster_Resource | Select @{n='Cluster';e={$cluster}},Name, RestartAction
|
combined_dataset/train/non-malicious/sample_20_87.ps1 | sample_20_87.ps1 | #************************************************
# TS_4KDriveInfo.ps1
# Version 1.0.2
# Date: 03-21-2011
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script detects 4KB/ 512e drive informaiton
#************************************************
# 2023-02-20 WalterE mod Trap #we#
trap [Exce... |
combined_dataset/train/non-malicious/2554.ps1 | 2554.ps1 |
$Files = Get-Content -Path "e:\Dexma\ClientFilePaths.txt"
IF ($Files)
{
foreach ($file IN $Files)
{
IF (Test-Path $file = $true)
{
Out-File -InputObject $file -FilePath "e:\Dexma\logs\ClientFilesFound.txt" -append -NoClobber
}
else
{
Out-File -InputObject $file -FilePath "e:\Dexma\logs\Cli... |
combined_dataset/train/non-malicious/sample_43_41.ps1 | sample_43_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeaiinference'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeaiinference.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
#... |
combined_dataset/train/non-malicious/1132.ps1 | 1132.ps1 |
$UserName = 'CarbonDscTestUser'
$Password = [Guid]::NewGuid().ToString()
function Start-TestFixture
{
& (Join-Path -Path $TestDir -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
Install-User -Username $UserName -Password $Password
}
function Test-ShouldConvertToNtfsContainerInheritanceFlags
{
... |
combined_dataset/train/non-malicious/1209.ps1 | 1209.ps1 |
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$GroupName = 'Setup Group'
$userName = $CarbonTestUser.UserName
$description = 'Carbon user for use in Carbon tests.'
function Assert-GroupExists
{
$groups = Get-Group
try
{
... |
combined_dataset/train/non-malicious/Sync-Time_2.ps1 | Sync-Time_2.ps1 | function sync-time(
[string] $server = "clock.psu.edu",
[int] $port = 37)
{
$servertime = get-time -server $server -port $port -set
#leave off -set to just check the remote time
write-host "Server time:" $servertime
write-host "Local time :" $(date)
}
|
combined_dataset/train/non-malicious/sample_17_72.ps1 | sample_17_72.ps1 | #
# Module manifest for module 'OCI.PSModules.Jms'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jms.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_12_5.ps1 | sample_12_5.ps1 | #************************************************
# TS_HyperVSCSIDiskEnum.ps1
# Version 1.0.1
# Date: 03-08-2011
# Author: Andre Teixeira - andret
# Description: This checks the number of subkeys under HKLM\System\CurrentControlSet\Enum\SCSI\Disk&Ven_Msft&Prod_Virtual_Disk
# If it is large (more th... |
combined_dataset/train/non-malicious/Get-WebSite_6.ps1 | Get-WebSite_6.ps1 | function Get-WebSite {
<#
.SYNOPSIS
Retrieves information about a website.
.DESCRIPTION
Retrieves information about a website.
.PARAMETER Url
URL of the website to test access to.
.PARAMETER UseDefaultCredentials
Use the currently authenticated user's credentials
.PARAMETER Proxy
Us... |
combined_dataset/train/non-malicious/Get-FileEncoding_2.ps1 | Get-FileEncoding_2.ps1 | ##############################################################################\n##\n## Get-FileEncoding\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nGets th... |
combined_dataset/train/non-malicious/sample_50_49.ps1 | sample_50_49.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
<#
.Synopsis
Create a CIM session to a rem... |
combined_dataset/train/non-malicious/Set-IPAddress_8.ps1 | Set-IPAddress_8.ps1 | function Set-IPAddress {
param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"),
[string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"),
[string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"),
[string]$gateway = $(read-host "Enter... |
combined_dataset/train/non-malicious/Get-GrowthRate_3.ps1 | Get-GrowthRate_3.ps1 | function Get-GrowthRate {
param( $Start, $End, $Period )
$rate = [math]::Abs( [math]::Pow( ( $End / $Start ),( 1 / ( $Period - 1 ) ) ) - 1 )
"{0:P}" -f $rate
}
|
combined_dataset/train/non-malicious/sample_50_36.ps1 | sample_50_36.ps1 | # virtualenv activation module
# Activate with `overlay use activate.nu`
# Deactivate with `deactivate`, as usual
#
# To customize the overlay name, you can call `overlay use activate.nu as foo`,
# but then simply `deactivate` won't work because it is just an alias to hide
# the "activate" overlay. You'd need to call `... |
combined_dataset/train/non-malicious/sample_33_26.ps1 | sample_33_26.ps1 | <##############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
##########################################################... |
combined_dataset/train/non-malicious/sample_54_30.ps1 | sample_54_30.ps1 | # Instructions: select the entire file and hit F8 to
# load the extensions. To see the list of registered
# extensions and run them, hit Ctrl+Shift+P, type 'addi'
# and run the "Show additional commands from PowerShell modules"
# command. A quick pick list will appear with all 3
# extensions registered. Selecti... |
combined_dataset/train/non-malicious/1058.ps1 | 1058.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'Reset-HostsFile' {
$customHostsFile = ''
BeforeEach {
$Global:Error.Clear()
$customHostsFile = Join-Path $env:temp ([IO.Path]::GetRandomFileName())
@"
127.0... |
combined_dataset/train/non-malicious/sample_34_85.ps1 | sample_34_85.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/sample_53_31.ps1 | sample_53_31.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_12_39.ps1 | sample_12_39.ps1 | #************************************************
# DC_Setup_AppCompat.ps1
# Version 1.0
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects additional AppCompat information.
# Called from: TS_AutoAddCommands_Setup.ps1
#*******************************************************
... |
combined_dataset/train/non-malicious/740.ps1 | 740.ps1 |
function Set-RsDataSourcePassword
{
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')]
param (
[Alias('ItemPath')]
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[string[]]
$Path,
[Parameter(Mandatory = $true)]
[string]
... |
combined_dataset/train/non-malicious/PowerShell Talk Mass VMs.ps1 | PowerShell Talk Mass VMs.ps1 | #The PowerShell Talk
#Virtualization Congress 2009
#
#Provision from CSV (csv-provision.ps1)
#Grab from the cli the path to the csv file
Param ( $path_to_csv )
#Get credentials & Connect
Get-Credential | connect-viserver -server "Your vCenter Here"
#Import the CSV, and build our VMs
$csv = Import-Csv -Pa... |
combined_dataset/train/non-malicious/Convert-BounceToX500.ps1 | Convert-BounceToX500.ps1 | # $Id: Convert-BounceToX500.ps1 608 2010-10-31 02:12:44Z jon $
# $Revision: 608 $
#.Synopsis
# Convert Bounce to X500
#.Description
# Convert URL Encoded address in a Bounce message to an X500 address
# that can be added as an alias to the mail-enabled object
#.Parameter bounceAddress
# URL Encoded bounce... |
combined_dataset/train/non-malicious/Add-ADPhoto.ps1 | Add-ADPhoto.ps1 | #Add-ADPhoto Powershell v1 compatibile script for updating
#user thumbnailphoto attribute. Resizes input photo to recommended
#dimensions and size. Only updates for the currently logged in user.
#This is a script for user self service.
#Author: Nathan Linley
#Site: http://myitpath.blogspot.com
$infile = $... |
combined_dataset/train/non-malicious/sample_27_33.ps1 | sample_27_33.ps1 | #
# Module manifest for module 'Az.EventHub'
#
# Generated by: Microsoft Corporation
#
# Generated on: 5/16/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.EventHub.psm1'
# Version number of this module.
ModuleVersion = '5.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_41_41.ps1 | sample_41_41.ps1 | #
# Module manifest for module 'PowerShellEditorServices'
#
# Generated by: daviwil
#
# Generated on: 5/12/2016
#
@{
# Script module or binary module file associated with this manifest.
RootModule = if ($PSEdition -eq 'Core')
{
'bin/Core/Microsoft.PowerShell.EditorServices.Hosting.dll'
}... |
combined_dataset/train/non-malicious/Wacth TechED Sessions.ps1 | Wacth TechED Sessions.ps1 | ipmo WPK
Function Get-TechEDSession {
$url = "https://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/RSS/"
$wc = New-Object net.webclient
#$wc.Proxy.Credentials = Get-Credential
$feed = ([xml]($wc.downloadstring($url))).rss.channel.item
$feed | ForEach {
... |
combined_dataset/train/non-malicious/sample_24_35.ps1 | sample_24_35.ps1 | #
# Module manifest for module 'OCI.PSModules.Databasemanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Databasemanagement.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Suppo... |
combined_dataset/train/non-malicious/CIM SMI-S Query Library_1.ps1 | CIM SMI-S Query Library_1.ps1 | function Invoke-CIM_EnumerateInstances {
<#
.SYNOPSIS
Enumerate Instances of a class on a CIMOM via CIM-XML interface
.DESCRIPTION
Primary use case of this function is to gather inventory and performance information from IT
infrastructure assets. The inventory information feeds into capacity plannin... |
combined_dataset/train/non-malicious/3206.ps1 | 3206.ps1 | function Get-NetworkStatistics {
[OutputType('System.Management.Automation.PSObject')]
[CmdletBinding()]
param(
[Parameter(Position=0)]
[System.String]$ProcessName='*',
[Parameter(Position=1)]
[System.String]$Address='*',
[Parameter(Position=2)]
$Port='*',
[Parameter(Position=3,
... |
combined_dataset/train/non-malicious/Get default AppPath.ps1 | Get default AppPath.ps1 | Function Get-ApplicationPath {
Param ([string[]]$extension)
Write-Verbose "Saving current location"
Push-Location
$extension | % {
try {
Set-Location "HKLM:\\Software\\Classes\\$($_)" -ErrorAction Stop
$default = (Get-ItemProperty -Path $pwd.Path -Name '(Defa... |
combined_dataset/train/non-malicious/sample_56_82.ps1 | sample_56_82.ps1 | <#
.SYNOPSIS Launch Developer PowerShell
.DESCRIPTION
Locates and imports a Developer PowerShell module and calls the Enter-VsDevShell cmdlet. The Developer PowerShell module
is located in one of several ways:
1) From a path in a Visual Studio installation
2) From the latest installation of Visual Studio (hig... |
combined_dataset/train/non-malicious/sample_54_36.ps1 | sample_54_36.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/3779.ps1 | 3779.ps1 |
function Get-StorageTestMode {
try {
$testMode = [Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode;
$testMode = $testMode.ToString();
} catch {
if ($PSItem.Exception.Message -like '*Unable to find type*') {
$testMode = 'Record';
} else {
... |
combined_dataset/train/non-malicious/sample_22_49.ps1 | sample_22_49.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/WPK_TunnelGradient.ps1 | WPK_TunnelGradient.ps1 | [CmdletBinding()]
param (
[string]$InsideColor = 'White',
[string]$OutsideColor = 'Transparent',
[int]$BorderThickness = 5
)
Add-Type -AssemblyName PresentationCore
Add-Type -AssemblyName PresentationFramework
Add-Type -AssemblyName WindowsBase
# script requires STA... let us check it.
if ([Th... |
combined_dataset/train/non-malicious/sample_50_56.ps1 | sample_50_56.ps1 | let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl();
let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/docker.webCore.eventHandlers.js"];
let currentScriptElement = document.querySelector("script[src='Scripts/docker.webCore.plugin.js']");
if (currentScriptElement !== nu... |
combined_dataset/train/non-malicious/sample_43_58.ps1 | sample_43_58.ps1 | # VK_DRIVER_FILES environment variable is not used when running with
# elevated privileges. Add a key to the registry instead.
$hkey_path = "HKLM:\SOFTWARE\Khronos\Vulkan\Drivers\"
$hkey_name = Join-Path -Path $pwd -ChildPath "_install\share\vulkan\icd.d\dzn_icd.x86_64.json"
New-Item -Path $hkey_path -force
New-ItemPro... |
combined_dataset/train/non-malicious/4232.ps1 | 4232.ps1 |
function New-IPv4Range
{
param(
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
Position=0)]
$StartIP,
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
Position=2)]
... |
combined_dataset/train/non-malicious/sample_34_68.ps1 | sample_34_68.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Out-CurrentFile {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding()]
param(
[Switch]$AsNewFile,
[Parameter(ValueFromPipeline, Mandatory = $true)]
$... |
combined_dataset/train/non-malicious/1486.ps1 | 1486.ps1 |
function New-ModuleHelpIndex
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$ModuleName,
[string[]]
$Script,
[string]
$TagsJsonPath
)
Set-StrictMode -Version 'Latest'
if( $TagsJsonPath )
... |
combined_dataset/train/non-malicious/sample_15_83.ps1 | sample_15_83.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/Get-ChildItemColor.ps1 | Get-ChildItemColor.ps1 | function Get-ChildItemColor {
<#
.Synopsis
Returns childitems with colors by type.
.Description
This function wraps Get-ChildItem and tries to output the results
color-coded by type:
Compressed - Yellow
Directories - Dark Cyan
Executables - Green
Text Files - Cyan
Others - Default
See Also... |
combined_dataset/train/non-malicious/sample_34_99.ps1 | sample_34_99.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_28_87.ps1 | sample_28_87.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=Det gick inte att hitta den nödvändiga PowerShell-modulen (FailoverClusters). Använd verktyget Roller & funktioner för att installera: Verktyg för fjärrserveradministration | Funktionsadministrationsverktyg | Redundansklusterverktyg | Redundansklustermodulen för... |
combined_dataset/train/non-malicious/sample_22_68.ps1 | sample_22_68.ps1 | #
# Module manifest for module 'OCI.PSModules.Usageapi'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Usageapi.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/2334.ps1 | 2334.ps1 | param($days_old)
(get-aduser -filter {enabled -eq $true} -Properties passwordlastset,employeenumber,whencreated | ? {($_.passwordlastset -gt (Get-Date).AddDays(-$days_old)) -and ($_.employeenumber) -and ($_.whenCreated -lt (Get-Date).AddDays(-$days_old))}).Count |
combined_dataset/train/non-malicious/4225.ps1 | 4225.ps1 |
function Get-PassNotExp
{
$strFilter = '(&(objectCategory=User)(userAccountControl:1.2.840.113556.1.4.803:=65536))'
$objDomain = New-Object System.DirectoryServices.DirectoryEntry
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.PageSize = 1000
$obj... |
combined_dataset/train/non-malicious/3748.ps1 | 3748.ps1 | $tagName = "testtag"
$tagValue = "testvalue"
$KeyVaultResourceType = "Microsoft.KeyVault/vaults"
$KeyVaultApiVersion = "2015-06-01"
function Test_CreateNewVault
{
Test-CreateNewVault $global:resourceGroupName $global:location $tagName $tagValue
}
function Test_CreateNewPremiumVaultEnabledForDeployment
{
Test... |
combined_dataset/train/non-malicious/3136.ps1 | 3136.ps1 |
[CmdletBinding(DefaultParameterSetName='Decrypt')]
param(
[Parameter(
Position=0,
Mandatory=$true,
HelpMessage='String which you want to encrypt or decrypt')]
[String]$Text,
[Parameter(
Position=1,
HelpMessage='Specify which rotation you want to use (De... |
combined_dataset/train/non-malicious/175.ps1 | 175.ps1 | function Get-ComputerOS
{
[CmdletBinding()]
PARAM (
[Parameter(ParameterSetName = "Main")]
[Alias("CN","__SERVER","PSComputerName")]
[String[]]$ComputerName = $env:ComputerName,
[Parameter(ParameterSetName="Main")]
[Alias("RunAs")]
[System.Management.Automation.... |
combined_dataset/train/non-malicious/1618.ps1 | 1618.ps1 |
function Get-Files {
[cmdletbinding()]
param (
[parameter(ValueFromPipeline=$true)]
[string[]]$Path = $PWD,
[string[]]$Include,
[string[]]$ExcludeDirs,
[string[]]$ExcludeFiles,
[switch]$Recurse,
[sw... |
combined_dataset/train/non-malicious/sample_65_75.ps1 | sample_65_75.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 = '86.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_35_74.ps1 | sample_35_74.ps1 | # Localized 06/28/2023 07:58 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Resolução de Problemas
Troubleshoot_DetectDVDDevice=A verificar o dispositivo de DVD...
Troubleshoot_DetectDVDvideoDecoder=A verificar o descodificador de vídeo para reprodução de DVD... |
combined_dataset/train/non-malicious/1145.ps1 | 1145.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldCreateIssuedPropertiesOnX509Certificate2
{
$cert = Get-Certificate -Path (Join-Path $TEstDir CarbonTestCertificate.cer -Resolve)
Assert-NotNull $cert.IssuedTo ('IssuedTo ... |
combined_dataset/train/non-malicious/4451.ps1 | 4451.ps1 |
Update-PSResource 'TestModule'
Update-PSResource -name 'TestModule'
Update-PSResource 'TestModule1', 'TestModule2', 'TestModule3'
Update-PSResource 'TestModule' -MaximumVersion '1.5.0'
Update-PSResource 'TestModule' -RequiredVersion '1.5.0'
Update-PSResource 'TestModule' -UpdateTo 'PatchVersion'
Upda... |
combined_dataset/train/non-malicious/Autoload (beta 2).ps1 | Autoload (beta 2).ps1 | #Requires -Version 2.0
## Automatically load functions from scripts on-demand, instead of having to dot-source them ahead of time, or reparse them from the script every time.
## To use:
## 1) Create a function. To be 100% compatible, it should specify pipeline arguments
## For example:
<#
function Skip-Object {... |
combined_dataset/train/non-malicious/952.ps1 | 952.ps1 |
$apiVersion = "2015-04-08"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$keyspaceName = "keyspace1"
$tableName = "table1"
$accountResourceName = $accountName + "/cassandra/"
$keyspaceResourceName = $accountName + "/cassandra/" + $keyspaceName
$keyspaceResourceType = "Microsoft.DocumentDb/da... |
combined_dataset/train/non-malicious/Set Resource Limits.ps1 | Set Resource Limits.ps1 | Param([Parameter(Mandatory=$true)] [string]$VMGuest)
$vm = get-vm $VMGuest
$cpuCap = $vm.NumCPU*1000
$cpuRes = $cpuCap/2
$memCap = $vm.MemoryMB
$memRes = $memCap/4
$spec = new-object VMware.Vim.VirtualMachineConfigSpec;
$spec.memoryAllocation = New-Object VMware.Vim.ResourceAllocationInfo;
$spec.memoryAll... |
combined_dataset/train/non-malicious/sample_65_91.ps1 | sample_65_91.ps1 | ###########################################################
#
# 'ExtensionService' module
#
###########################################################
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
Import-Module "$PSScriptRoot\ServiceHelper.psm1"
$script:GCInstallPath = "$PSScriptRoot\..... |
combined_dataset/train/non-malicious/SyntaxHighlighter Brush_1.ps1 | SyntaxHighlighter Brush_1.ps1 | //
/**
* PowerShell 2.0 Brush for highlighter 2.0
*
* SyntaxHighlighter http://alexgorbatchev.com/wiki/SyntaxHighlighter
*
* @version
* 2.1.0 (April 07 2009)
*
* @copyright
* Copyright (C) 2008-2009 Joel Bennett http://HuddledMasses.org/
*
* @license
* This file is for SyntaxHighlighter.
... |
combined_dataset/train/non-malicious/sample_66_88.ps1 | sample_66_88.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcesearch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcesearch.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSE... |
combined_dataset/train/non-malicious/Add Voice to Powershell.ps1 | Add Voice to Powershell.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/Hack ESXi_3.ps1 | Hack ESXi_3.ps1 | $screen = " You see here a virtual switch. ------------ ------
#...........| |....|
--------------- ###------------ |...(|
|..%...........|########## ###-@...|
... |
combined_dataset/train/non-malicious/sample_33_4.ps1 | sample_33_4.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 = '81.0.0'
# Supported... |
combined_dataset/train/non-malicious/sample_20_66.ps1 | sample_20_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Osmanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osmanagement.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/The PowerShell Talk Xen2.ps1 | The PowerShell Talk Xen2.ps1 | #The PowerShell Talk
#Demo 2 - VM Easy Bake Oven
#XenServer
#Connect to XenServer
Get-Credential | connect-Xenserver -Url http://XenServer_URL/sdk
#Create the new VM
Create-XenServer:VM -NameLabel "Dave" -VCPUsAtStartup 1 -MemoryDynamicMax 536870912 -MemoryStaticMax 536870912 -MemoryDynamicMin 536870912 -Memo... |
combined_dataset/train/non-malicious/Farm Backup.ps1 | Farm Backup.ps1 | ##################################
#This errors out in ISE, so use cmd window.
#The script below fixes the error just below.
#Cannot access the local farm. Verify that the local farm is
#properly configured, currently available, and that you have
#the appropriate permissions to access the database before
#tryi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.