full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/1414.ps1 | 1414.ps1 |
function Revoke-CPrivilege
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Identity,
[Parameter(Mandatory=$true)]
[string[]]
$Privilege
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cm... |
combined_dataset/train/non-malicious/sample_62_54.ps1 | sample_62_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Mediaservices'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Mediaservices.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_14_6.ps1 | sample_14_6.ps1 | $script:THIS_PATH = $myinvocation.mycommand.path
$script:BASE_DIR = Split-Path (Resolve-Path "$THIS_PATH/..") -Parent
function global:deactivate([switch] $NonDestructive) {
if (Test-Path variable:_OLD_VIRTUAL_PATH) {
$env:PATH = $variable:_OLD_VIRTUAL_PATH
Remove-Variable "_OLD_VIRTUAL_PATH" -Scope... |
combined_dataset/train/non-malicious/Get-BinarySum.ps1 | Get-BinarySum.ps1 | function Get-BinarySum
{
<#
.SYNOPSIS
Performs binary addition of two Int32 values.
.DESCRIPTION
If a numeric overflow occurs in PowerShell, an error is generated making it impossible
to perform binary addition. Get-BinarySum will add two Int32 numbers together and if
the result exceeds [Int32]::MaxValue, the... |
combined_dataset/train/non-malicious/3968.ps1 | 3968.ps1 |
function Test-EmptyRouteTable
{
$rgname = Get-ResourceGroupName
$routeTableName = Get-ResourceName
$rglocation = Get-ProviderLocation ResourceManagement
$resourceTypeParent = "Microsoft.Network/routeTables"
$location = Get-ProviderLocation $resourceTypeParent
try
{
... |
combined_dataset/train/non-malicious/sample_50_93.ps1 | sample_50_93.ps1 | #
# Module manifest for module 'OCI.PSModules.Redis'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Redis.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_24_56.ps1 | sample_24_56.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubusage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubusage.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/iSCSI Module.ps1 | iSCSI Module.ps1 | # Copyright (c) 2011 Code Owls LLC, All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use, copy, mod... |
combined_dataset/train/non-malicious/Update VM Tools_1.ps1 | Update VM Tools_1.ps1 | ########################################################
# Created by Brian English
# for Charlotte County Government
# No warranty suggested or implied
########################################################
########################################################
#connect to VirtualCenter server (i.e. virtua... |
combined_dataset/train/non-malicious/sample_1_59.ps1 | sample_1_59.ps1 | ConvertFrom-StringData @'
id_dpm_getsysinfo_activity=Gathering system information
id_dpm_status_getsysinfo=Running DC_GetSystemInfo.ps1
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQ... |
combined_dataset/train/non-malicious/Resizer of pictures_2.ps1 | Resizer of pictures_2.ps1 | [reflection.assembly]::LoadWithPartialName("System.Drawing")
$SizeLimit=1280 # required size of picture's long side
$logfile="resizelog.txt" # log file for errors
$toresize=$args[0] # list of directories to find and resize images. can be empty
if ([string]$toresize -eq “”) { # if scr... |
combined_dataset/train/non-malicious/1624.ps1 | 1624.ps1 |
function Test-Port {
param (
$ip = '127.0.0.1',
$port = '515'
)
begin {
$tcp = New-Object Net.Sockets.TcpClient
}
process {
try {
$tcp.Connect($ip, $port)
} catch {}
if ($tcp.Connected) {
$tcp.Close... |
combined_dataset/train/non-malicious/sample_35_2.ps1 | sample_35_2.ps1 | #
# Module manifest for module 'OCI.PSModules.Governancerulescontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Governancerulescontrolplane.dll'
# Version number of this module.
ModuleVersion =... |
combined_dataset/train/non-malicious/2814.ps1 | 2814.ps1 |
$data = $null
foreach ($file in (ls *svcall.xml)) {
$data += Import-Clixml $file
}
$data | Select-Object Caption, StartName | Sort-Object Caption, StartName | Group-Object Caption, StartName | Sort-Object Name |
combined_dataset/train/non-malicious/60e46e16-ef39-4620-84a5-bc955433e811.ps1 | 60e46e16-ef39-4620-84a5-bc955433e811.ps1 | [void]([reflection.assembly]::LoadWithPartialName("Microsoft.office.server"))
$serverContext = [Microsoft.Office.Server.ServerContext]::Default
$upm = [Microsoft.Office.Server.UserProfiles.UserProfileManager]$serverContext
@@ $upm.psbase.properties | ? { $_.isvisibleonviewer } | select DisplayName, name, displa... |
combined_dataset/train/non-malicious/2596.ps1 | 2596.ps1 |
function Split-Job (
$Scriptblock = $(throw 'You must specify a command or script block!'),
[int]$MaxPipelines=10,
[switch]$UseProfile,
[string[]]$Variable,
[string[]]$Alias
) {
$Queue = [Collections.Queue]::Synchronized([Collections.Queue]@($Input))
$QueueLength = ... |
combined_dataset/train/non-malicious/3101.ps1 | 3101.ps1 |
$powershellCoreModules = @(
"Microsoft.PowerShell.Host"
"Microsoft.PowerShell.Core"
"Microsoft.PowerShell.Diagnostics"
"Microsoft.PowerShell.Management"
"Microsoft.PowerShell.Security"
"Microsoft.PowerShell.Utility"
"Microsoft.WsMan.Management"
)
$extension = ".cab"
$testCases = @{
... |
combined_dataset/train/non-malicious/Get-WebSite_5.ps1 | Get-WebSite_5.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/sample_26_13.ps1 | sample_26_13.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 = '75.1.0'
# Supported PSE... |
combined_dataset/train/non-malicious/530.ps1 | 530.ps1 |
function Backup-AllSPWebs{
[CmdletBinding()]
param(
[Parameter(Position=0, Mandatory=$true)]
[String]
$Path
)
if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Microsoft.SharePoint.PowerShell"}
$SPSites = $SPWebApp | Get-SPsite -Limi... |
combined_dataset/train/non-malicious/sample_63_8.ps1 | sample_63_8.ps1 | # Get the version of the Torizon IDE Extension from package.json
$env:TEST_EXTENSION_VERSION = ((Get-Content "package.json" -Raw) | ConvertFrom-Json).version
$env:TEST_VSCODE_CLEANUP = $true
# Start the tests from a clean environment, unless explictly setting to false
# the env variable
if ($env:TEST_VSCODE_CLEANUP -E... |
combined_dataset/train/non-malicious/Bulk Change AD Passwords.ps1 | Bulk Change AD Passwords.ps1 |
#-------------------------------------------------------------
# install http://www.quest.com/powershell/activeroles-server.aspx
Add-PSSnapin Quest.ActiveRoles.ADManagement
# CSV Format : NTAccountName,oldpassword,newpassword
$UserList = Import-Csv c:\\temp\\users.csv # | select-object -first 2
$userli... |
combined_dataset/train/non-malicious/sample_50_24.ps1 | sample_50_24.ps1 | # powershell completion for azcmagent -*- shell-script -*-
function __azcmagent_debug {
if ($env:BASH_COMP_DEBUG_FILE) {
"$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE"
}
}
filter __azcmagent_escapeStringWithSpecialChars {
$_ -replace '\s|#|@|\$... |
combined_dataset/train/non-malicious/sample_20_4.ps1 | sample_20_4.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubbillingschedule'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubbillingschedule.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Sup... |
combined_dataset/train/non-malicious/sample_12_75.ps1 | sample_12_75.ps1 | #
# Module manifest for module 'OCI.PSModules.Mysql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Mysql.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_60_65.ps1 | sample_60_65.ps1 | #
# Module manifest for module 'OCI.PSModules.Artifacts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Artifacts.dll'
# Version number of this module.
ModuleVersion = '88.1.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_64_39.ps1 | sample_64_39.ps1 | #
# Module manifest for module 'OCI.PSModules.Threatintelligence'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Threatintelligence.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Suppo... |
combined_dataset/train/non-malicious/2227.ps1 | 2227.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[string]$SiteServer,
[parameter(Mandatory=$false, HelpMessa... |
combined_dataset/train/non-malicious/Get-WindowsExperience.ps1 | Get-WindowsExperience.ps1 | function Get-WindowsExperienceRating {
#.Synopsis
# Gets the Windows Experience Ratings
#.Parameter ComputerName
# The name(s) of the computer(s) to get the Windows Experience (WinSat) numbers for.
[CmdletBinding()]
param(
[Parameter(ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
[string[... |
combined_dataset/train/non-malicious/sample_11_80.ps1 | sample_11_80.ps1 | ConvertFrom-StringData @'
id_netframeworkngenfiles_title=.Net Framework nGen files
id_netframeworkngenfiles_status=Collecting .Net Framework nGen files
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE... |
combined_dataset/train/non-malicious/sample_39_37.ps1 | sample_39_37.ps1 | #
# Module manifest for module 'Microsoft.Sdn.LoadBalancers'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.Sdn.LoadBalancers.psm1'
# Version number of this module.
ModuleVersion = '3.17.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID us... |
combined_dataset/train/non-malicious/1582.ps1 | 1582.ps1 |
function Find-MrModuleUpdate {
[CmdletBinding()]
[OutputType('Mr.ModuleUpdate')]
param (
[ValidateNotNullOrEmpty()]
[string[]]$Name,
[ValidateSet('AllUsers', 'CurrentUser')]
[string]$Scope
)
$AllUsersPath = "$env:ProgramFiles\WindowsPowerShell\Modules\*"
$Cu... |
combined_dataset/train/non-malicious/validate an IP address_1.ps1 | validate an IP address_1.ps1 | # validate given IP address in $ip1 variable
$ip1 = "192.168.22.455"
($ip1.split(".") | where-object { $_ -ge 1 -and $_ -le 255 } | Where-Object { $_ -match "\\d{1,3}"} | Measure-Object).count -eq 4
|
combined_dataset/train/non-malicious/922.ps1 | 922.ps1 |
$resourceGroup = "myResourceGroup"
$location = "westeurope"
$vmName = "myVM"
New-AzResourceGroup -Name $resourceGroup -Location $location
$cred = Get-Credential -Message "Enter a username and password for the virtual machine."
New-AzVM `
-ResourceGroupName $resourceGroup `
-Name $vmName `
-Location $locati... |
combined_dataset/train/non-malicious/sample_56_17.ps1 | sample_56_17.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudmigrations'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudmigrations.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported P... |
combined_dataset/train/non-malicious/3945.ps1 | 3945.ps1 |
function Test-VirtualNetworkeExpressRouteGatewayConnectionCRUD
{
$rgname = "onesdkTestConnection"
$vnetConnectionName = Get-ResourceName
$location = Get-ProviderLocation "Microsoft.Network/vpnGateways" "West US"
try
{
$resourceGroup = Get-AzResourceGroup -Name... |
combined_dataset/train/non-malicious/Findup_20.ps1 | Findup_20.ps1 | using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.IO;
using System.Text.RegularExpressions;
namespace Findup
{
public class FileLengthComparer : I... |
combined_dataset/train/non-malicious/sample_43_72.ps1 | sample_43_72.ps1 | ---
name: Request a gRPC C# feature
about: Suggest an idea for this project
labels: kind/enhancement, priority/P2, lang/C#
assignees: apolcyn
---
<!--
PLEASE DO NOT POST A QUESTION HERE.
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers at ... |
combined_dataset/train/non-malicious/3799.ps1 | 3799.ps1 |
function Log($test, $message)
{
Out-File -FilePath "$test.log" -Append -InputObject $message
}
function Test-AEMExtensionBasicWindowsWAD
{
$rgname = Get-ComputeTestResourceName
$loc = Get-ComputeVMLocation
try
{
$vm = Create-AdvancedVM -rgname $rgname -loc $loc
... |
combined_dataset/train/non-malicious/sample_42_10.ps1 | sample_42_10.ps1 | #
# Module manifest for module 'OCI.PSModules.Artifacts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Artifacts.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_58_70.ps1 | sample_58_70.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
[CmdletBinding(DefaultParamet... |
combined_dataset/train/non-malicious/3578.ps1 | 3578.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Get-ApiManagementServiceName
{
return getAssetName
}
function Get-ProviderLocation($provider)
{
$locations = Get-ProviderLocations $provider
if ($locations -eq $null) {
"West US"
} else {
$locations[0]... |
combined_dataset/train/non-malicious/Note, open Notepad++.ps1 | Note, open Notepad++.ps1 | # Limited Notepad++ support with the simple call 'Note' So long Notepad!
function Note
{
<#
.Synopsis
Opens Notepad++
.Description
Opens Notepad++
.Parameter File
File name(s) to open, accepts wildcards. (absolute or relative path name)
.Parameter MultiInstance
Launch another Notepad++ instanc... |
combined_dataset/train/non-malicious/sample_42_24.ps1 | sample_42_24.ps1 | #
# Module manifest for module 'ThreadJob'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = '.\Microsoft.PowerShell.ThreadJob.dll'
# Version number of this module.
ModuleVersion = '2.0.3'
# ID used to uniquely identify this module
GUID = '0e7b895d-2fec-43f7-8cae-11... |
combined_dataset/train/non-malicious/sample_8_45.ps1 | sample_8_45.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 = '92.1.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_62_76.ps1 | sample_62_76.ps1 | # Localized 06/28/2023 08:07 AM (GMT) 303:7.0.30723 rs_iesecuritylevels.psd1
ConvertFrom-StringData @'
###PSLOC
Reset_securitysettings=Rétablissez les paramètres de sécurité par défaut de toutes les zones.
Report_name_resetIEsettings=Paramètres de sécurité
Report_description_resetIEsettings=Zones de sécurité dont... |
combined_dataset/train/non-malicious/3314.ps1 | 3314.ps1 | function Slap {
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string] $User,
[parameter(Position = 1)]
[string] $Object
)
$objects = @{
trout = @{
item = 'large trout'
thu... |
combined_dataset/train/non-malicious/sample_58_67.ps1 | sample_58_67.ps1 | #
# Module manifest for module 'OCI.PSModules.Functions'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Functions.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/3104.ps1 | 3104.ps1 | param(
[string]$buildCorePowershellUrl = "https://opbuildstorageprod.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1",
[string]$parameters
)
$errorActionPreference = 'Stop'
echo "download build core script to local with source url: $buildCorePowershellUrl"
$repositoryRoot = Split-Path -Par... |
combined_dataset/train/non-malicious/sample_11_25.ps1 | sample_11_25.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 = '74.1.0'
... |
combined_dataset/train/non-malicious/sample_25_62.ps1 | sample_25_62.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/Prevent-Screensaver.ps1 | Prevent-Screensaver.ps1 | #########################################################
# Prevent-Screensaver
#########################################################
# This script "presses" a keyboard key every minute
# for specified number of minutes which makes
# Windows "think" you are at your desktop
# so the screensaver does not start ... |
combined_dataset/train/non-malicious/1703.ps1 | 1703.ps1 |
Properties {
$ProjectRoot = Resolve-Path $ENV:BHProjectPath
if(-not $ProjectRoot)
{
$ProjectRoot = Resolve-Path "$PSScriptRoot\.."
}
$StepVersionBy = $null
$Timestamp = Get-date -uformat "%Y%m%d-%H%M%S"
$PSVersion = $PSVersionTable.PSVersion.Major
$TestFile = "TestResults... |
combined_dataset/train/non-malicious/sample_33_8.ps1 | sample_33_8.ps1 | #
# Module manifest for module 'OCI.PSModules.Events'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Events.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/TabExpansion_12.ps1 | TabExpansion_12.ps1 | ## Tab-Completion
#################
## Please dot souce this script file.
## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list.
##
## What this can do is:
##
## [datetime]::n<tab>
## [datetime]::now.d<tab>
## $a = New-Object "Int32[,]" 2,3; $b = "PowerShell","Pow... |
combined_dataset/train/non-malicious/Migrate UserFolder_3.ps1 | Migrate UserFolder_3.ps1 | param(
$RootFolder = "\\\\server1\\users",
$NewRootFolder = "\\\\server2\\users",
$LogFolder = "C:\\Projects\\HomeDirs",
$NewSubFolders = @("Documents","Favorites","Desktop","Links","Contacts"),
$domain = "domain",
[switch]$SetACL
)
$UserFolders = gci -Path $RootFolder | ?{$_.PSIsContainer}
$UserFolders | fore... |
combined_dataset/train/non-malicious/sample_66_25.ps1 | sample_66_25.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplacepublisher'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplacepublisher.dll'
# Version number of this module.
ModuleVersion = '88.1.0'
# S... |
combined_dataset/train/non-malicious/Invoke-SqlCmd_5.ps1 | Invoke-SqlCmd_5.ps1 | #######################
<#
.SYNOPSIS
Runs a T-SQL script.
.DESCRIPTION
Runs a T-SQL script. Invoke-Sqlcmd2 only returns message output, such as the output of PRINT statements when -verbose parameter is specified
.INPUTS
None
You cannot pipe objects to Invoke-Sqlcmd2
.OUTPUTS
System.Data.DataTable
.EXA... |
combined_dataset/train/non-malicious/1336.ps1 | 1336.ps1 |
function Uninstall-CGroup
{
[CmdletBinding(SupportsShouldProcess=$true)]
param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[String]
$Name
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContex... |
combined_dataset/train/non-malicious/sample_21_66.ps1 | sample_21_66.ps1 | #
# Script module for module 'Az.PolicyInsights' that is executed when 'Az.PolicyInsights' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 03/27/2024 07:43:38
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
... |
combined_dataset/train/non-malicious/sample_27_70.ps1 | sample_27_70.ps1 | #
# Module manifest for module 'OCI.PSModules.Dataflow'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dataflow.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/Export top n SQLPlans.ps1 | Export top n SQLPlans.ps1 | <#
ALZDBA SQLServer_Export_SQLPlans_SMO.ps1
Export top n consuming sqlplans (avg_worker_time=cpu) for a given SQLServer (SQL2005+) Instance
#>
#requires -version 2
#SQLServer instance
$SQLInstance = 'yourserver\\yourinstance'
#What number of plans to export per db ?
[int]$nTop = 50
trap {
# Handle all er... |
combined_dataset/train/non-malicious/4388.ps1 | 4388.ps1 | function Get-PSScriptInfoString
{
[CmdletBinding(PositionalBinding=$false)]
Param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$Version,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[Guid]
$Guid,
[Para... |
combined_dataset/train/non-malicious/Split-Job Version 1.2.ps1 | Split-Job Version 1.2.ps1 | #requires -version 1.0
################################################################################
## Run commands in multiple concurrent pipelines
## by Arnoud Jansveld - www.jansveld.net/powershell
##
## Basic "drop in" usage examples:
## - Functions that accept pipelined input:
## Without Spli... |
combined_dataset/train/non-malicious/sample_22_2.ps1 | sample_22_2.ps1 | Signature-Version: 1.0
Created-By: 11.0.13 (International Business Machines Corporation)
SHA-256-Digest-Manifest: 24nsPJJAtZmjXuV3YV+9C4fT0KtdjWlYd05rYBNuiy0=
SHA-256-Digest-Manifest-Main-Attributes: ZPM8w+YRl9N+FEbLmKnGqhF/Bco3/z+
BZ2gk0FSXfr8=
Name: plugin.xml
SHA-256-Digest: HS4k5kzk7m0pjUQJvLR9k++EVmv2eb/w... |
combined_dataset/train/non-malicious/1067.ps1 | 1067.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldGetCanonicalCaseForDirectory
{
$currentDir = (Resolve-Path '.').Path
foreach( $badPath in ($currentDir.ToUpper(),$currentDir.ToLower()) )
{
$canoni... |
combined_dataset/train/non-malicious/2053.ps1 | 2053.ps1 |
Describe "Tests for paths of submodules in module manifest" -tags "CI" {
$moduleName = 'ModuleA'
$moduleFileName = "$moduleName.psd1"
$submoduleName = 'ModuleB'
$submoduleFileName = "$submoduleName.psm1"
$moduleRootPath = Join-Path $TestDrive $moduleName
$moduleFilePath = Join-Path $moduleRoo... |
combined_dataset/train/non-malicious/737.ps1 | 737.ps1 |
function Get-RsItemReference
{
param (
[Alias('ItemPath')]
[Parameter(Mandatory = $True, ValueFromPipeline = $true)]
[string[]]
$Path,
[string]
$ReportServerUri,
[Alias('ReportServerCredentials')]
[System.Management.Automatio... |
combined_dataset/train/non-malicious/sample_26_62.ps1 | sample_26_62.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/3772.ps1 | 3772.ps1 |
function Test-GetReservationOrder
{
$type = "Microsoft.Capacity/reservationOrders"
$reservationOrderId = "704aee8c-c906-47c7-bd22-781841fb48b5"
$reservation = Get-AzReservationOrder -ReservationOrderId $reservationOrderId
Assert-NotNull $reservation
Assert-True { $reservation.Etag... |
combined_dataset/train/non-malicious/sample_55_16.ps1 | sample_55_16.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmcontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmcontrolplane.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported P... |
combined_dataset/train/non-malicious/Get Twitter RSS Feed_8.ps1 | Get Twitter RSS Feed_8.ps1 | param ([String] $ScreenName)
$client = New-Object System.Net.WebClient
$idUrl = "https://api.twitter.com/1/users/show.json?screen_name=$ScreenName"
$data = $client.DownloadString($idUrl)
$start = 0
$findStr = '"id":'
do {
$start = $data.IndexOf($findStr, $start + 1)
if ($start -gt 0) {
$s... |
combined_dataset/train/non-malicious/3332.ps1 | 3332.ps1 |
function Remove-GroupUser {
[PoshBot.BotCommand(
Permissions = 'manage-groups'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string]$Group,
[parameter(Mandatory, Position = 1)]
[string]$User
... |
combined_dataset/train/non-malicious/sample_57_30.ps1 | sample_57_30.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
# Import Observability EventSource
$observabili... |
combined_dataset/train/non-malicious/2460.ps1 | 2460.ps1 | function ConvertTo-CleanScript
{
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$Path,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string[]]$ToRemove = ''
)
begin {
$ErrorActionPreference = 'Stop'
}
process {
try
{
$Ast = [System.Management.Autom... |
combined_dataset/train/non-malicious/296.ps1 | 296.ps1 | function Get-PSFUserChoice
{
[OutputType([System.Int32])]
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[object[]]
$Options,
[string]
$Caption,
[string]
$Message,
[int]
$DefaultChoice = 0
)
begin
{
Write-PSFMessage -Level InternalComment -Message "Bound parameters: $($PS... |
combined_dataset/train/non-malicious/1938.ps1 | 1938.ps1 |
Describe "Measure-Command" -Tags "CI" {
Context "Validate return types for Measure-Command" {
It "Should return TimeSpan as the return type" {
Measure-Command { Get-Date } | Should -BeOfType timespan
}
}
Context "Validate that it is executing commands correctly" {
I... |
combined_dataset/train/non-malicious/FTP upload_1.ps1 | FTP upload_1.ps1 | $File = "D:\\Dev\\somefilename.zip"
$ftp = "ftp://username:password@example.com/pub/incoming/somefilename.zip"
"ftp url: $ftp"
$webclient = New-Object System.Net.WebClient
$uri = New-Object System.Uri($ftp)
"Uploading $File..."
$webclient.UploadFile($uri, $File)
|
combined_dataset/train/non-malicious/4474.ps1 | 4474.ps1 |
$script:dscResourceFriendlyName = 'PSModule'
$script:dcsResourceName = "MSFT_$($script:dscResourceFriendlyName)"
$configurationFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dcsResourceName).config.ps1"
. $configurationFile
Describe "$($script:dcsResourceName)_Integration" {
$configurationName = "$... |
combined_dataset/train/non-malicious/Get-DNSZoneRecords.ps1 | Get-DNSZoneRecords.ps1 | #==========================================================================
#
# NAME: Get-DNSZoneRecords.ps1
# AUTHOR: Saehrig, Steven (trac3r726)
# DATE : 10/17/2008
# @@Requires PSHX-Sapien to be loaded for the Read-inputbox cmdlet.
# @@Requires Powershell CTP 2
#
# COMMENT:
# Just comment out the variable... |
combined_dataset/train/non-malicious/sample_13_55.ps1 | sample_13_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Identity'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identity.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_64_91.ps1 | sample_64_91.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 = '86.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/Get-OwnerReport.ps1 | Get-OwnerReport.ps1 | ##############################################################################\n##\n## Get-OwnerReport\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 a l... |
combined_dataset/train/non-malicious/sample_56_50.ps1 | sample_56_50.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/Get-ProcessCount_2.ps1 | Get-ProcessCount_2.ps1 | # Get-ProcessCount uses 2 main variables, server and process name.
# Process name is typically the end exe, such as "svchost.exe"
# Will accept unnamed args (Get-ProcessCount servername processname)
# or named args (Get-ProcessCount -Computer servername -Process processname)
Function Get-ProcessCount([string]$proce... |
combined_dataset/train/non-malicious/Inventory.ps1 | Inventory.ps1 | ############################################################################
#
# Collect.ps1
# Version: 0.2
# Script to Collect Information from (1)Subnet of PCs, or (2)List of PCs
# By: Brad Blaylock
# For: St. Bernards RMC
# Date: 3-25-2010
#
################################################################... |
combined_dataset/train/non-malicious/Set-WinSchedule.ps1 | Set-WinSchedule.ps1 | # Set-WinSchedule
# Written by Tome Tanasovski
# http://powertoe.wordpress.com
# version 1.0
# Created March 2010
#
# Please read through the synopsis->Description to see the list of features that I hope to get
# in a final release. If you choose to work on any of the issues by all means, but please contact
#... |
combined_dataset/train/non-malicious/PowerBot _3.0.ps1 | PowerBot _3.0.ps1 | ## PowerBot 2.0
## A simple framework to get you started writing your own IRC bots in PowerShell
####################################################################################################
## Requires Meebey.SmartIrc4net.dll to be in your ...\\WindowsPowerShell\\Libraries\\
## You can get Meebey.SmartIrc4n... |
combined_dataset/train/non-malicious/Write-Output.ps1 | Write-Output.ps1 | ########################################################################
## Copyright (c) Joel Bennett, 2010
## Free for use under MS-PL, MS-RL, GPL 2, or BSD license. Your choice.
function Write-Output {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)]
[Allow... |
combined_dataset/train/non-malicious/1576.ps1 | 1576.ps1 | function ConvertTo-MrHashTable {
[CmdletBinding()]
param (
[Parameter(Mandatory,
ValueFromPipeline)]
[PSObject[]]$Object
)
PROCESS {
foreach ($o in $Object) {
$hashtable = @{}
foreach ($p in Get-Member -InputObject $o -Membe... |
combined_dataset/train/non-malicious/sample_23_79.ps1 | sample_23_79.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_30_91.ps1 | sample_30_91.ps1 | #
# Module manifest for module 'Microsoft.SME.NetATC'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.NetATC.psm1'
# Version number of this module.
ModuleVersion = '3.6.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to uniquely ... |
combined_dataset/train/non-malicious/sample_67_15.ps1 | sample_67_15.ps1 | # Pipeline creates experimental msbuild insertions.
trigger: none # Prevents this pipeline from triggering on check-ins
pr: none # don't run this on PR as well
parameters:
# Dotnet installer channel from which to take the latest dotnet bits.
- name: DotnetInstallerChannel
displayName: Dotnet installer channel... |
combined_dataset/train/non-malicious/sample_7_39.ps1 | sample_7_39.ps1 | # Localized 06/28/2023 07:58 AM (GMT) 303:7.0.30723 iesecurity_troubleshooter.psd1
ConvertFrom-StringData @'
###PSLOC
Check_PhishingFilter=SmartScreen Filtre ayarları denetleniyor...
Check_Blockpopups=Açılan Pencere Engelleyici denetleniyor...
Check_IEsecuritysettings=Internet Explorer güvenlik ayarları denetleni... |
combined_dataset/train/non-malicious/sample_35_93.ps1 | sample_35_93.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerengine'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerengine.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported P... |
combined_dataset/train/non-malicious/WhoAmI_1.ps1 | WhoAmI_1.ps1 | function whoami
{
[System.Security.Principal.WindowsIdentity]::GetCurrent().Name
}
|
combined_dataset/train/non-malicious/sample_25_31.ps1 | sample_25_31.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_20_37.ps1 | sample_20_37.ps1 | #
# Module manifest for module 'OCI.PSModules.Objectstorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Objectstorage.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/Findup_22.ps1 | Findup_22.ps1 | using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.IO;
using System.Text.RegularExpressions;
namespace Findup
{
public class FileLengthComparer : I... |
combined_dataset/train/non-malicious/3899.ps1 | 3899.ps1 |
function Test-PoolCRUD
{
$context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext
$poolId1 = "pool1"
$poolId2 = "pool2"
try
{
$osFamily = "4"
$targetOSVersion = "*"
$targetDedicated = 0
$vmSize = "small"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.