full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/4431.ps1 | 4431.ps1 | function Find-RoleCapability
{
[CmdletBinding(HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=718029')]
[outputtype('PSCustomObject[]')]
Param
(
[Parameter(Position = 0)]
[ValidateNotNullOrEmpty()]
[string[]]
$Name,
[Parameter()]
[ValidateNotNullO... |
combined_dataset/train/non-malicious/sample_22_37.ps1 | sample_22_37.ps1 | #
# Module manifest for module 'OCI.PSModules.Onesubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_60_51.ps1 | sample_60_51.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/Findup_10.ps1 | Findup_10.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;
namespace Findup
{
public class FileInfoExt
{
public FileInfoExt(FileInfo fi)
... |
combined_dataset/train/non-malicious/3442.ps1 | 3442.ps1 | [CmdletBinding()]
Param(
[Parameter(Mandatory=$False, Position=0)]
[String]$Folder
)
function SyncVersion([string]$FilePath)
{
$FolderPath = [System.IO.Path]::GetDirectoryName($FilePath)
Write-Output "Folder Path: $FolderPath"
$matches = ([regex]::matches((Get-Content $FilePath), "ModuleVersion = '([\d\.... |
combined_dataset/train/non-malicious/sample_16_78.ps1 | sample_16_78.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudbridge'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudbridge.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/1401.ps1 | 1401.ps1 |
if( -not (Get-Command -Name 'Get-WindowsFeature*' | Where-Object { $_.ModuleName -ne 'Carbon' }) )
{
function Get-CWindowsFeature
{
[CmdletBinding()]
param(
[Parameter()]
[string]
$Name
)
Set-StrictMode -Version... |
combined_dataset/train/non-malicious/Powershell iTunes.ps1 | Powershell iTunes.ps1 | #
#*****************************************************************
#
# Powershell iTunes v1 $Rev: 752 $
# (c) 2004-2010 Thomas Maurer. All rights reserved.
# created by Thomas Maurer
#
# http://www.thomasmaurer.ch
# http://www.thomasmaurer.ch/projects
#
# last Update by $Author: tmaurer $ on $Date: 2010-11... |
combined_dataset/train/non-malicious/MoveExch2010SP1Archives.ps1 | MoveExch2010SP1Archives.ps1 | #=================================================================================
# MoveArchives.ps1
#
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
# KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
# PART... |
combined_dataset/train/non-malicious/4058.ps1 | 4058.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/2187.ps1 | 2187.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed.")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMess... |
combined_dataset/train/non-malicious/sample_29_92.ps1 | sample_29_92.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydataplane.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Support... |
combined_dataset/train/non-malicious/sample_22_75.ps1 | sample_22_75.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
function Save-ComputerLogsBeforeRemoval
{
... |
combined_dataset/train/non-malicious/sample_54_4.ps1 | sample_54_4.ps1 | #
# Module manifest for module 'OCI.PSModules.Datascience'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datascience.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_2_78.ps1 | sample_2_78.ps1 | # <copyright>
# INTEL CONFIDENTIAL
#
# Copyright 2022 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you ("License").
# Unless the License provides otherwise, you may not us... |
combined_dataset/train/non-malicious/Search cmdlet help_1.ps1 | Search cmdlet help_1.ps1 | function Search-Help($term) {
Get-Command | Where { Get-Help -full -ea SilentlyContinue $_ |
Out-String | Select-String $term }
}
|
combined_dataset/train/non-malicious/sample_60_97.ps1 | sample_60_97.ps1 | <UserControl x:Class="Avast.Net.Console.Network.Views.PasswordSettingsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:groupbox="clr-namespace:Groupbox;assembly=Groupbox"
xmlns:ViewModels="clr-namespace:Ava... |
combined_dataset/train/non-malicious/sample_28_2.ps1 | sample_28_2.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 = '81.0.0'
... |
combined_dataset/train/non-malicious/dc580007-f61d-477a-a409-395481ffb01a.ps1 | dc580007-f61d-477a-a409-395481ffb01a.ps1 | CREATE LOGIN [vCenter_Owner] WITH PASSWORD=N'KVx$!|mhQ^', CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
--Modify Drive and size to match your environment
CREATE DATABASE [vCenter] ON PRIMARY
( NAME = N'vCenter', FILENAME = N'S:\\Data\\vCenter.mdf' , SIZE = 100MB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%)
LOG ON
(... |
combined_dataset/train/non-malicious/4337.ps1 | 4337.ps1 | function Validate-ModuleCommandAlreadyAvailable
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true)]
[PSModuleInfo]
$CurrentModuleInfo,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$InstallLocation,
[Parameter()]
... |
combined_dataset/train/non-malicious/3952.ps1 | 3952.ps1 |
function Test-ListAzureFirewallFqdnTag
{
$alwaysPresentTag = "WindowsUpdate"
$availableFqdnTags = Get-AzFirewallFqdnTag
Assert-True { $availableFqdnTags.Count -gt 0 }
Assert-AreEqual 1 $availableFqdnTags.Where({$_.FqdnTagName -eq $alwaysPresentTag}).Count
}
|
combined_dataset/train/non-malicious/FTP upload_2.ps1 | FTP upload_2.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/sample_29_65.ps1 | sample_29_65.ps1 | #
# Module manifest for module 'OCI.PSModules.Workrequests'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Workrequests.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_55_2.ps1 | sample_55_2.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
PowerShell Diagnostics Module
This module contains a set of wrapper scripts that
enable a user to use ETW tracing in Windows
PowerShell.
#>
$script:Logman="$env:windir\system32\logman.exe"
$script:wsmanlogfile = "$env:wind... |
combined_dataset/train/non-malicious/Get-WmiNamespace.ps1 | Get-WmiNamespace.ps1 | # In order to enumerate all the WMI namespaces, you must first connect to the "root" namespace,
# query for all the "__NAMESPACE" instances, and for each instance recursively repeat this process.
# You can use the computerName parameter of Get-WmiNamespace to list the WMI namespaces on the remote computer.
functio... |
combined_dataset/train/non-malicious/Delete Files per folder.ps1 | Delete Files per folder.ps1 | <#
.SYNOPSIS
Deletes files in directory based on age measured in days
.DESCRIPTION
Delete files in folder with use of regular filter, either recursive or not.
.PARAMETER DelFilter
Provide a filter like "*.txt" or "mylogs*"
.PARAMETER DelPath
The directory where files are to be deleted from, use the Rec... |
combined_dataset/train/non-malicious/667.ps1 | 667.ps1 |
$reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl }
Function Set-FolderReportDataSource
{
param (
[string]
$NewFolderPath
)
$tempProxy = New-RsWebServiceProxy -ReportServerUri $reportServerUri
$localResources... |
combined_dataset/train/non-malicious/Out-Posh.ps1 | Out-Posh.ps1 | # Personally, I use this as a script (just save in your path as Out-Posh.ps1, and delete all but the middle line (that starts with "end")
function out-posh {
end { New-BootsWindow { $input } -inline }
}
|
combined_dataset/train/non-malicious/sample_40_8.ps1 | sample_40_8.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 = '83.1.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_67_31.ps1 | sample_67_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/Reset Time Sync Setting.ps1 | Reset Time Sync Setting.ps1 | ########################################################
# Created by Brian English
# Brian.English@charlottefl.com
# eddiephoenix@gmail.com
#
# for Charlotte County Government
# No warranty suggested or implied
########################################################
# Purpose: Cycle through all VMs on a... |
combined_dataset/train/non-malicious/Calculate HA Capaicty.ps1 | Calculate HA Capaicty.ps1 | ### Written by Mark A. Weaver
## Date: 7/27/2008
## Version: 1.0
## Blog site: blog.vmweaver.com
##
## Call this function and pass in -ServerName <VC Server Name> -ClusterName <ClusterName>
## Output should be an object containing the information
##
## Feel free to modify as needed to suit your needs, but... |
combined_dataset/train/non-malicious/ServicePWChgReset_1.ps1 | ServicePWChgReset_1.ps1 | # ==============================================================================================
#
# NAME: ServicePWChgReset.ps1
#
# AUTHOR: Saehrig, Steven
# DATE : 8/26/2008
@@# Requires - Quest ActiveRoles Snapin
@@# COMMENT: Please read comments on each section!
# 1st - Search Domain computers for matc... |
combined_dataset/train/non-malicious/3274.ps1 | 3274.ps1 | class SlackConnection : Connection {
[System.Net.WebSockets.ClientWebSocket]$WebSocket
[pscustomobject]$LoginData
[string]$UserName
[string]$Domain
[string]$WebSocketUrl
[bool]$Connected
[object]$ReceiveJob = $null
SlackConnection() {
$this.WebSocket = New-Object System.Net.Web... |
combined_dataset/train/non-malicious/305.ps1 | 305.ps1 | function Get-PSFDynamicContentObject
{
[OutputType([PSFramework.Utility.DynamicContentObject])]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFDynamicContentObject')]
Param (
[Parameter(Mandatory = $true)]
[string[]]
$Name
)
begin
{
}
process
{
foreach... |
combined_dataset/train/non-malicious/2.ps1 | 2.ps1 |
$global:GitPromptSettings = [PoshGitPromptSettings]::new()
$global:GitPromptValues = [PoshGitPromptValues]::new()
$s = $global:GitPromptSettings
if ($Host.UI.RawUI.BackgroundColor -eq [ConsoleColor]::DarkMagenta) {
$s.LocalDefaultStatusSymbol.ForegroundColor = 'Green'
$s.LocalWorkingStatusSymbol.Foreground... |
combined_dataset/train/non-malicious/WIMM Emulator Launcher.ps1 | WIMM Emulator Launcher.ps1 | ##
## Start-WimmEmulator.ps1
##
## Starts the WIMM emulator - must be placed in the add-ons\\addon_wimm_one_7\\tools
## directory along with the rest of the WIMM tools.
##
## http://dev.wimm.com/
if(-not $env:ANDROID_SDK_DIR)
{
$env:ANDROID_SDK_DIR = Resolve-Path (Join-Path $psscriptRoot ..\\..\\..)
}
... |
combined_dataset/train/non-malicious/sample_43_57.ps1 | sample_43_57.ps1 | #
# Module manifest for module 'OCI.PSModules.Cims'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cims.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_19_90.ps1 | sample_19_90.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudguard'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudguard.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/1371.ps1 | 1371.ps1 |
function Install-CDirectory
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Path
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
if( -not (Test-Path -Path $Path -PathType... |
combined_dataset/train/non-malicious/458.ps1 | 458.ps1 |
Set-PSFConfig -Module PSFramework -Name 'Serialization.WorkingDirectory' -Value $script:path_typedata -Initialize -Validation "string" -Description "The folder in which registered type extension files are placed before import. Relevant for Register-PSFTypeSerializationData." |
combined_dataset/train/non-malicious/131.ps1 | 131.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aa... |
combined_dataset/train/non-malicious/Test-Help.ps1 | Test-Help.ps1 | function Test-Help {
<#
.Synopsis
Test-Help -Function Get-USB
.Description
Test-Help was written to get information why that !@##$%#$%# help is not working ;)
For now works only if v2 comments are used (starting with < # and ending with # > )
Using fancy regex that pro... |
combined_dataset/train/non-malicious/694.ps1 | 694.ps1 | function Get-FileExtension
{
param(
[Parameter(Mandatory=$True)]
[string]$TypeName
)
switch ($TypeName)
{
'Report' { return '.rdl' }
'DataSource' { return '.rsds' }
'DataSet' { return '.rsd' }
'MobileReport' { return '.rsmobile' }
'PowerBIRe... |
combined_dataset/train/non-malicious/1973.ps1 | 1973.ps1 |
Describe "Get-Date DRT Unit Tests" -Tags "CI" {
It "Get-Date with all parameters returns proper results" {
$date = [datetime]::Now + ([timespan]::new(0,0,30))
$result = Get-Date -Date $date -Year 1973 -Month 2 -Day 22 -Hour 15 -Minute 40 -Second 10 -Millisecond 200
$result | Should -BeOfT... |
combined_dataset/train/non-malicious/369.ps1 | 369.ps1 | function Import-PSFLocalizedString
{
[PSFramework.PSFCore.NoJeaCommand()]
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string]
$Path,
[Parameter(Mandatory = $true)]
[string]
$Module,
[PsfValidateSet(TabCompletion = 'PSFramework-LanguageNames', NoResults = 'Continue')]
[string]
$... |
combined_dataset/train/non-malicious/3329.ps1 | 3329.ps1 |
function Update-GroupDescription {
[PoshBot.BotCommand(
Permissions = 'manage-groups'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string]$Name,
[parameter(Mandatory, Position = 1)]
[string]... |
combined_dataset/train/non-malicious/2294.ps1 | 2294.ps1 |
$vCenterServer = "server.contoso.com"
try {
if(-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) {
Add-PSSnapin VMware.VimAutomation.Core -ErrorAction Stop
}
Set-PowerCLIConfiguration -DefaultVIServerMode Single -InvalidCertificateAction Ignore -Confirm:$false... |
combined_dataset/train/non-malicious/Get-FeedInfo.ps1 | Get-FeedInfo.ps1 | function Get-FeedInfo([string[]]$feeds) {
# $feeds is an array of rss/atom URLs
$blogs=@(); $broken=@(); $feeds = $feeds | sort -unique {$_}
foreach($feed in $feeds){
try {
$xml = Get-WebPageContent $feed;
} catch {
$broken += $feed
$xml = $null
}
if($xml.html.rss) { $xml = $... |
combined_dataset/train/non-malicious/New-XML 2.ps1 | New-XML 2.ps1 | #requires -version 2.0
#### NOTE: you can revert this to work in PowerShell 1.0 by just removing the [Parameter(...)] lines
#### BUT YOU WILL HAVE TO pass the $Version $Encoding $Standalone parameters EACH TIME
#### UNLESS you remove them, and switch back to a hardcoded XDeclaration ... or something.
##... |
combined_dataset/train/non-malicious/sample_28_27.ps1 | sample_28_27.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ManagedServices.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Module]::Instance
# Export nothing to clear imp... |
combined_dataset/train/non-malicious/2973.ps1 | 2973.ps1 | param($Thumbprint)
$ErrorActionPreference = 'Stop'
$cert = Get-ChildItem Cert:\CurrentUser\My |
Where-Object Thumbprint -eq $Thumbprint
if ($null -eq $cert) {
throw "No certificate was found."
}
if (@($cert).Length -gt 1) {
throw "More than one cerfificate with the given thumbprint was found."
}
"Signing Fi... |
combined_dataset/train/non-malicious/sample_50_59.ps1 | sample_50_59.ps1 | #
# Module manifest for module 'OCI.PSModules.Psql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Psql.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/Impersonation.ps1 | Impersonation.ps1 | $global:ImpContextStack = new-object System.Collections.Generic.Stack[System.Security.Principal.WindowsImpersonationContext]\n$global:IdStack = new-object System.Collections.Generic.Stack[System.Security.Principal.WindowsIdentity]\n\n\n$global:UserToysClass = Add-Type -Namespace Huddled -Name UserToys -MemberDefinition... |
combined_dataset/train/non-malicious/11a7b312-21b4-4faa-8224-35bea9db7f89.ps1 | 11a7b312-21b4-4faa-8224-35bea9db7f89.ps1 | param(
[Parameter(Position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$true)]
[alias("Name","ComputerName")] $Computer = @($env:computername),
[string] $NTDomain = ($env:UserDomain),
[string[]] $LocalGroups = @("Administrators"),
[string[]] $Identities, # can be domain user or group
[switch] $Outpu... |
combined_dataset/train/non-malicious/3295.ps1 | 3295.ps1 |
function Get-PoshBot {
[OutputType([PSCustomObject])]
[cmdletbinding()]
param(
[parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)]
[int[]]$Id = @()
)
process {
if ($Id.Count -gt 0) {
foreach ($item in $Id) {
if ($b = $script:botT... |
combined_dataset/train/non-malicious/sample_29_43.ps1 | sample_29_43.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module -Name "$PSScriptRoot\..\..\Common\... |
combined_dataset/train/non-malicious/3485.ps1 | 3485.ps1 |
function Generate-Name([string] $prefix="hdi-ps-test"){
return getAssetName($prefix)
}
function Generate-StorageAccountName([string] $prefix="psstorage"){
return getAssetName($prefix)
}
function Create-Cluster{
param(
[string] $clusterName="hdi-ps-test",
[string] $location="West US"... |
combined_dataset/train/non-malicious/1939.ps1 | 1939.ps1 |
$ps = Join-Path -Path $PsHome -ChildPath "pwsh"
Describe "Set-PSBreakpoint DRT Unit Tests" -Tags "CI" {
$scriptFileName = Join-Path $TestDrive -ChildPath breakpointTestScript.ps1
$scriptFileNameBug = Join-Path -Path $TestDrive -ChildPath SetPSBreakpointTests.ExposeBug154112.ps1
$contents = @"
funct... |
combined_dataset/train/non-malicious/3202.ps1 | 3202.ps1 | function New-SqlConnection
{
[cmdletbinding()]
[OutputType([System.Data.SqlClient.SQLConnection])]
param(
[Parameter( Position=0,
Mandatory=$true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
Valu... |
combined_dataset/train/non-malicious/73cbcdc1-9397-4ed2-99e3-b043b8c53905.ps1 | 73cbcdc1-9397-4ed2-99e3-b043b8c53905.ps1 | # 1. Create a simple customizations spec:
$custSpec = New-OSCustomizationSpec -Type NonPersistent -OSType Windows -OrgName “My Organization” -FullName “MyVM” -Domain “MyDomain” –DomainAdminUsername “user” –DomainAdminPassword “password”
# 2. Modify the default network customization settings:
$custSpec | Get-OSCustom... |
combined_dataset/train/non-malicious/723.ps1 | 723.ps1 |
function Get-RsFolderContent
{
[cmdletbinding()]
param(
[Alias('ItemPath', 'Path')]
[Parameter(Mandatory = $True, ValueFromPipeline = $true)]
[string[]]
$RsFolder,
[switch]
$Recurse,
[string]
$ReportServerUri,
... |
combined_dataset/train/non-malicious/sample_0_16.ps1 | sample_0_16.ps1 | #************************************************
# DC_WinHTTP-Component.ps1
# Version 1.0
# Version 1.1: Moved $sectionDescription to the correct location.
# Date: 2009-2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about WinHTTP.
# Called from: Main Networking Diag, PKI ... |
combined_dataset/train/non-malicious/2174.ps1 | 2174.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, ParameterSetName="Single", HelpMessage="Site server where the SMS Provider is installed")]
[parameter(ParameterSetName="All")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
... |
combined_dataset/train/non-malicious/1367.ps1 | 1367.ps1 |
function ConvertTo-CInheritanceFlag
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[Carbon.Security.ContainerInheritanceFlags]
[Alias('ContainerInheritanceFlags')]
$ContainerInheritanceFlag
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -C... |
combined_dataset/train/non-malicious/sample_0_19.ps1 | sample_0_19.ps1 | @{
GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
FunctionsToExport = @()
CmdletsToExport = "Get-Credential", "Get-ExecutionP... |
combined_dataset/train/non-malicious/2051.ps1 | 2051.ps1 |
try {
$defaultParamValues = $PSdefaultParameterValues.Clone()
$PSDefaultParameterValues["it:skip"] = ![System.Management.Automation.Platform]::IsWindowsDesktop
Describe 'Basic COM Tests' -Tags "CI" {
BeforeAll {
$null = New-Item -Path $TESTDRIVE/file1 -ItemType File
$null... |
combined_dataset/train/non-malicious/sample_38_36.ps1 | sample_38_36.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/Get-StrictMode.psm1.ps1 | Get-StrictMode.psm1.ps1 | <#
.SYNOPSIS
A very simple module to retrieve the Set-StrictMode setting of the session.
.DESCRIPTION
This procedure is necessary as there is, apparently, no PowerShell variable
for this and enables the user setting to be returned to its original state
after possibly being changed within a script.
The various... |
combined_dataset/train/non-malicious/sample_50_98.ps1 | sample_50_98.ps1 | #
# Module manifest for module 'Az.Attestation'
#
# Generated by: Microsoft Corporation
#
# Generated on: 23/04/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.Attestation.psm1'
# Version number of this module.
ModuleVersion = '2.0.2'
# Supported PSEdi... |
combined_dataset/train/non-malicious/Validate SPN Mappings.ps1 | Validate SPN Mappings.ps1 | ###########################################################################"
#
# NAME: SPNValidation.psm1
#
# AUTHOR: Jan Egil Ring
# BLOG: http://blog.crayon.no/blogs/janegil
#
# COMMENT: Script module for validating SPN mappings.
# For installation instructions and sample usage, see the following blo... |
combined_dataset/train/non-malicious/1237.ps1 | 1237.ps1 |
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,Position=0)]
[string]
$Name
)
Set-StrictMode -Version 'Latest'
$Name = [Text.Encoding]::Unicode.GetString( [Convert]::FromBase64String($Name) )
Add-Type -AssemblyName System.Configuration
$config = [Configuration.ConfigurationManager]::OpenM... |
combined_dataset/train/non-malicious/sample_35_30.ps1 | sample_35_30.ps1 | #
# Module manifest for module 'OCI.PSModules.Recovery'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Recovery.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/ModuleWriteError.psd1.ps1 | ModuleWriteError.psd1.ps1 | #
# Module manifest for module 'ModuleWriteError'
#
# Generated by: Thell Fowler
#
# Generated on: 1/13/2010
#
@{
# Script module or binary module file associated with this manifest
ModuleToProcess = 'ModuleWriteError.psm1'
# Version number of this module.
ModuleVersion = '1.0'
# ID used to uniquely... |
combined_dataset/train/non-malicious/IE Proxy Toggle (Silent).ps1 | IE Proxy Toggle (Silent).ps1 | # Process command line parameter (if present).
[bool] $DISABLE_PROXY = $false;
foreach ($param in $MyInvocation.UnboundArguments) {
if ($param -like 'disable') { $DISABLE_PROXY = $true; }
}
# Apply/refresh the organization's default proxy settings.
@@ [string] $proxyServer = '###.###.###.###:####';
... |
combined_dataset/train/non-malicious/1715.ps1 | 1715.ps1 | function Get-ServiceNowUserGroup{
[OutputType([System.Management.Automation.PSCustomObject])]
[CmdletBinding(DefaultParameterSetName, SupportsPaging)]
Param(
[Parameter(Mandatory = $false)]
[string]$OrderBy = 'name',
[Parameter(Mandatory = $false)]
[Validat... |
combined_dataset/train/non-malicious/1605.ps1 | 1605.ps1 |
write-host "
write-host "
write-host "
write-host "
write-host "
write-host "
$a = (Get-Host).PrivateData
$a.WarningBackgroundColor = "red"
$a.WarningForegroundColor = "white"
gc env:computername
Get-Date
function Read-Choice {
PARAM([string]$message, [string[]]$choices, [int]$defaultChoice=12... |
combined_dataset/train/non-malicious/sample_64_14.ps1 | sample_64_14.ps1 | # --------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All Rights Reserved.
# Microsoft Corporation (or based on where you live, one of its affiliates) licenses this sample code for your internal testing purposes only.
# Microsoft provides the following sample cod... |
combined_dataset/train/non-malicious/sample_53_0.ps1 | sample_53_0.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 = '83.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/Sith.ps1 | Sith.ps1 | ' Script: Master_Audit_AD_Account_Management - 2008 v4 S1S2.vbs (Version 4 Section1 and Section2 combi script)
' Purpose: Parse a DC's security event log and generate account management events, log and e-mail for past 24hs
' Author: Paperclips (The Dark Lord)
' Email: magiconion_M@hotmail.com
' Date: ... |
combined_dataset/train/non-malicious/sample_3_94.ps1 | sample_3_94.ps1 | # ***********************************************************************************************
# File: utils_ConfigMgr12-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 variables/functions. View utils_ConfigM... |
combined_dataset/train/non-malicious/sample_44_92.ps1 | sample_44_92.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/Script for mBull.ps1 | Script for mBull.ps1 | $endDate = New-Object datetime(2013,1, 1)
for ($date = [DateTime]::Today; $date -le $endDate; $date = $date.AddDays(1);)
{
if ($date.DayOfWeek -ne [DayOfWeek]::Saturday -and $date.DayOfWeek -ne [DayOfWeek]::Saturday)
{
New-Item -type directory $date.ToShortDateString()
}
}
|
combined_dataset/train/non-malicious/2581.ps1 | 2581.ps1 |
Set-ExecutionPolicy Unrestricted
c:\temp\InitPowerSMO.ps1
$server = SMO_Server
$db = SMO_Database $server "PowerDW"
function global:PsDisk ($servername,$dn)
{
$Tablename='disk'
$var=@'
$disk $SizeMB $FreeMB $PercFree
'@
$out=''
$out=C:\Dexma\bin\psinfo \\$servername -d Disk
if ($out -LT '') {$Disc... |
combined_dataset/train/non-malicious/sample_41_16.ps1 | sample_41_16.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.2.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/4152.ps1 | 4152.ps1 |
cls
$Errors = 0
$SourceDrive = Read-Host 'Enter source folder'
$DestinationDrive = Read-Host 'Enter destination folder'
$TempDrive = Get-Item -Path $SourceDrive
$SourceDrive = $TempDrive.FullName
$TempDrive = Get-Item -Path $DestinationDrive
$DestinationDrive = $TempDrive.FullName
$SourceFolders = Get-ChildItem ... |
combined_dataset/train/non-malicious/d599ff7e-17c4-40a4-b3fc-8666dd953df5.ps1 | d599ff7e-17c4-40a4-b3fc-8666dd953df5.ps1 | function Get-VCTime() {
return (Get-View "ServiceInstance-ServiceInstance").CurrentTime()
}
$lastCheckTime = Get-VCTime
while ($true)
{
$modifiedVMs = @()
$freshEventsStartTime = $lastCheckTime
$lastCheckTime = Get-VCTime
# Get all the VM network edit events
foreach ($event in Get... |
combined_dataset/train/non-malicious/sample_17_71.ps1 | sample_17_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Blockchain'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Blockchain.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_44_85.ps1 | sample_44_85.ps1 | #
# Module manifest for module 'OCI.PSModules.Databasemigration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Databasemigration.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Support... |
combined_dataset/train/non-malicious/582.ps1 | 582.ps1 |
function Get-RemoteConnection{
param(
[parameter(Mandatory=$false)]
[string[]]
$Name
)
function New-ObjectRemoteConnection{
param(
[string]$Name,
[string]$Server,
[string]$User,
[string]$Description,
[string... |
combined_dataset/train/non-malicious/1014.ps1 | 1014.ps1 |
$random = (New-Guid).ToString().Substring(0,8)
$subscriptionId = "my-azure-subscription-id"
$apimServiceName = "apim-$random"
$resourceGroupName = "apim-rg-$random"
$location = "Japan East"
$organisation = "Contoso"
$adminEmail = "admin@contoso.com"
$swaggerUrl = "http://petstore.swagger.io/v2/swagger.json"
... |
combined_dataset/train/non-malicious/sample_34_7.ps1 | sample_34_7.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.DiagnosticSetting.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module]::Instance
# Export nothing ... |
combined_dataset/train/non-malicious/sample_15_73.ps1 | sample_15_73.ps1 | ## Copyright (c) Microsoft Corporation. All rights reserved.
<#
.SYNOPSIS
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans.
.DESCRIPTION
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans. These performance recordings contain Microsoft-Antimal... |
combined_dataset/train/non-malicious/Reverse filename sequenc_2.ps1 | Reverse filename sequenc_2.ps1 | # Reverse filename sequence v 0.9
# Author: Sean Wendt
#
# This script will rename a sequenced set of files in a directory.
# For example, you have foobar01.jpg, foobar02.jpg, foobar03.jpg
# -- it will reverse the order, so the last file is now 01, the second to last 02, etc..
#
# Limitations: -You cannot us... |
combined_dataset/train/non-malicious/sample_14_72.ps1 | sample_14_72.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=O módulo do PowerShell necessário (FailoverClusters) não foi encontrado. Use a Ferramenta Funções e Recursos para instalar: Ferramentas de Administração de Servidor Remoto | Ferramentas de Administração de Recursos | Ferramentas de Cluster de Failover | Módulo d... |
combined_dataset/train/non-malicious/sample_33_3.ps1 | sample_33_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Osuborganizationsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll'
# Version number of this module.
ModuleVersion... |
combined_dataset/train/non-malicious/sample_17_76.ps1 | sample_17_76.ps1 | #************************************************
# TS_PrintCSRBloatingCheck.ps1
# Version 1.0.1
# Date: 6/26/2012
# Author: v-maam
# Description: [Idea ID 2374] [Windows] Spooler service hangs since CSR exhausts the 512 threads in thread pool
# Rule number: 2374
# Rule URL: http://sharepoint/sites/rules/Rule... |
combined_dataset/train/non-malicious/3470.ps1 | 3470.ps1 |
function ConsumerGroupsTests
{
$location = Get-Location
$resourceGroupName = getAssetName "RSG"
$namespaceName = getAssetName "Namespace-"
$eventHubName = getAssetName "EventHub-"
$consumerGroupName = getAssetName "ConsumerGroup-"
Write-Debug " Create resource group"
Write-Debug... |
combined_dataset/train/non-malicious/2763.ps1 | 2763.ps1 |
if (Test-Path "$env:SystemRoot\sigcheck.exe") {
& $env:SystemRoot\sigcheck.exe /accepteula -a -e -c -h -q -s -r $("$env:SystemDrive\") 2> $null |
ConvertFrom-Csv |
ForEach-Object { $_ }
}
else {
Write-Error "Sigcheck.exe not found in $env:SystemRoot."
} |
combined_dataset/train/non-malicious/sample_66_3.ps1 | sample_66_3.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.