full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/441.ps1 | 441.ps1 | Register-PSFConfigValidation -Name "string" -ScriptBlock {
Param (
$Value
)
$Result = New-Object PSObject -Property @{
Success = $True
Value = $null
Message = ""
}
try
{
[string]$data = $Value
}
catch
{
$Result.Message = "Not a string: $Value"
$Result.Success = $False
return $Result
}... |
combined_dataset/train/non-malicious/sample_20_93.ps1 | sample_20_93.ps1 | $waitForTimeSyncScript = "$PSScriptRoot\WaitForTimeSyncBeforeDSC.ps1"
if (Test-Path $waitForTimeSyncScript)
{
# Wait for time on this machine to syncrhonize before we begin the boot-time DSC process.
# This ensures that our transcript times don't get messed up by clock changes during this time.
& $wait... |
combined_dataset/train/non-malicious/2041.ps1 | 2041.ps1 |
Describe "Attribute tests" -Tags "CI" {
BeforeEach {
Remove-Item $testdrive/test.ps1 -Force -ErrorAction SilentlyContinue
}
It "<attribute> attribute returns argument error if empty" -TestCases @(
@{Attribute="HelpMessage"},
@{Attribute="HelpMessageBaseName"},
@{Attribute=... |
combined_dataset/train/non-malicious/1557.ps1 | 1557.ps1 | Function New-DynamicParam {
param(
[string]
$Name,
[System.Type]
$Type = [string],
[string[]]
$Alias = @(),
[string[]]
$ValidateSet,
[switch]
$Mandatory,
[string]
$ParameterSetName="__AllParameterSets",
[int]
$Position,
[switch... |
combined_dataset/train/non-malicious/sample_25_5.ps1 | sample_25_5.ps1 | #
# Module manifest for module 'OCI.PSModules.Limits'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Limits.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_19_4.ps1 | sample_19_4.ps1 | FFFFFFFF 00 F16388ACE371A2400AB0EC90AC8B6716
FFFFFFFE 00 1
FFFFFFFD 00 2
FFFFFFFC 00 3
FFFFFFFB 00 1
00011520 71 System.String System.SR::GetResourceString(System.String)
000115A0 50 System.Resources.ResourceManager System.SR::get_ResourceManager()
000115F0 14 System.String System.SR::get_InvalidOperation_ResourceWrite... |
combined_dataset/train/non-malicious/sample_27_54.ps1 | sample_27_54.ps1 | # .ExternalHelp Microsoft.SystemCenter.OperationsManagerV10.Commands.dll-Help.xml
function Get-SCOMCommand
{
[CmdletBinding(DefaultParameterSetName='CmdletSet')]
param(
[Parameter(ParameterSetName='AllCommandSet', Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)]
[Valida... |
combined_dataset/train/non-malicious/sample_11_14.ps1 | sample_11_14.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="D:\a\1\s\node_modules\.pnpm\vite@2.9.16\node_modules\vite\bin\node_modules;D:\a\1\s\node_modules\.pnpm\vite@2.9.16\node_modules\vite\node_modules;D:\a\1\s\node_modules\.... |
combined_dataset/train/non-malicious/sample_51_94.ps1 | sample_51_94.ps1 | #
# Module manifest for module 'OCI.PSModules.Certificatesmanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Certificatesmanagement.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
... |
combined_dataset/train/non-malicious/1836.ps1 | 1836.ps1 |
Describe "Clear-Item tests" -Tag "CI" {
BeforeAll {
${myClearItemVariableTest} = "Value is here"
}
It "Clear-Item can clear an item" {
$myClearItemVariableTest | Should -BeExactly "Value is here"
Clear-Item -Path variable:myClearItemVariableTest
Test-Path -Path variable:my... |
combined_dataset/train/non-malicious/Call WSPBuilder_1.ps1 | Call WSPBuilder_1.ps1 | function Run-DosCommand($program, [string[]]$programArgs)
{
write-host "Running command: $program";
write-host " Args:"
0..($programArgs.Count-1) | foreach { Write-Host " $($_): $($programArgs[$_])" }
& $program $programArgs
}
#Get-FullPath function defined elsewhere, refers to a "base directory" which all... |
combined_dataset/train/non-malicious/338.ps1 | 338.ps1 | function New-PSFSupportPackage
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingEmptyCatchBlock", "")]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/New-PSFS... |
combined_dataset/train/non-malicious/ASPX Mailbox (3 of 6).ps1 | ASPX Mailbox (3 of 6).ps1 | <%@ Page Language="C#" CodeFile="MailboxConfirm.aspx.cs" AutoEventWireup="true" Inherits="MailboxConfirm" ClassName = "MailboxConfirm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="He... |
combined_dataset/train/non-malicious/sample_67_17.ps1 | sample_67_17.ps1 | # Localized 06/28/2023 08:08 AM (GMT) 303:7.0.30723 msft_packagemanagementsource.strings.psd1
#########################################################################################
#
# Copyright (c) Microsoft Corporation.
#
#######################################################################################... |
combined_dataset/train/non-malicious/sample_18_73.ps1 | sample_18_73.ps1 | # File: DC_WindowsUpdateLog.ps1
# Date: 2009-2019
# Author: + Walter Eder (waltere@microsoft.com)
# Description: Collects additional WindowsUpdate information.
#*******************************************************
PARAM([string]$MachineName = $ComputerName,[string]$Path= $null)
Function CopyWindowsupdateLo... |
combined_dataset/train/non-malicious/Get-WebsiteCertificate.ps1 | Get-WebsiteCertificate.ps1 | function Get-WebsiteCertificate {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)] [System.Uri]
$Uri,
[Parameter()] [System.IO.FileInfo]
$OutputFile,
[Parameter()] [Switch]
$UseSystemProxy,
[Parameter()] [Switch]
$UseDefaultCredentials,
[Parameter()] [Switch]
$TrustAllCerti... |
combined_dataset/train/non-malicious/Import-Certificate_3.ps1 | Import-Certificate_3.ps1 | function Import-Certificate {\n<#\n .SYNOPSIS\n Imports certificate in specified certificate store.\n\n .DESCRIPTION\n Imports certificate in specified certificate store.\n\n .PARAMETER CertFile\n The certificate file to be imported.\n\n .PARAMETER StoreNames\n The certificate store(s) in which the certificate sh... |
combined_dataset/train/non-malicious/Invoke-SqlCmd_1.ps1 | Invoke-SqlCmd_1.ps1 | function Invoke-Sqlcmd2
{
param(
[string]$ServerInstance,
[string]$Database,
[string]$Query,
[Int32]$QueryTimeout=30
)
$conn=new-object System.Data.SqlClient.SQLConnection
$conn.ConnectionString="Server={0};Database={1};Integrated Security=True" -f $ServerInstance,$Database
... |
combined_dataset/train/non-malicious/sample_18_49.ps1 | sample_18_49.ps1 | # Localized 06/28/2023 07:56 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=トラブルシューティング
Troubleshoot_DetectNetworkCache=Windows Media Player のネットワーク キャッシュを確認しています...
Resolution_Title=解決策
Resolution_ResetConfiguration=すべての構成設定をリセットしています...
Resolution_ResetNe... |
combined_dataset/train/non-malicious/sample_34_5.ps1 | sample_34_5.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ApplicationInsights.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module]::Instance
# Export nothing to c... |
combined_dataset/train/non-malicious/sample_5_65.ps1 | sample_5_65.ps1 | #
# Module manifest for module 'OCI.PSModules.Computeinstanceagent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computeinstanceagent.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
# S... |
combined_dataset/train/non-malicious/sample_36_82.ps1 | sample_36_82.ps1 | #
# Module manifest for module 'OCI.PSModules.Jmsjavadownloads'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported... |
combined_dataset/train/non-malicious/sample_10_5.ps1 | sample_10_5.ps1 | ConvertFrom-StringData @'
id_fileacl=Determining file ACL's
'@
# SIG # Begin signature block
# MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA6VsPfmmzM00am
# qvD0ITk80rX9ws5... |
combined_dataset/train/non-malicious/3189.ps1 | 3189.ps1 | function Get-ADMigratedSourceObject {
[cmdletbinding()]
param(
[Parameter( Position=0,
Mandatory = $true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
ParameterSetName='SAM')]
[string[]]$samA... |
combined_dataset/train/non-malicious/sample_20_48.ps1 | sample_20_48.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 = '77.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_10_52.ps1 | sample_10_52.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\mockjs@1.1.0\node_modules\mockjs\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\mockjs@1.1.... |
combined_dataset/train/non-malicious/sample_41_45.ps1 | sample_41_45.ps1 | #
# Module manifest for module 'Microsoft.SME.HyperV'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.HyperV.psm1'
# Version number of this module.
ModuleVersion = '4.21.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to uniquely... |
combined_dataset/train/non-malicious/Split-Every Function.ps1 | Split-Every Function.ps1 | Function Split-Every($list, $count=4) {
$aggregateList = @()
$blocks = [Math]::Floor($list.Count / $count)
$leftOver = $list.Count % $count
for($i=0; $i -lt $blocks; $i++) {
$end = $count * ($i + 1) - 1
$aggregateList += @(,$list[$start..$end])
$start = $en... |
combined_dataset/train/non-malicious/3345.ps1 | 3345.ps1 |
function New-Permission {
[PoshBot.BotCommand(Permissions = 'manage-permissions')]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string]$Name,
[parameter(Mandatory, Position = 1)]
[string]$Plugin,
... |
combined_dataset/train/non-malicious/3930.ps1 | 3930.ps1 |
function Check-CmdletReturnType
{
param($cmdletName, $cmdletReturn)
$cmdletData = Get-Command $cmdletName
Assert-NotNull $cmdletData
[array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") }
[array]$... |
combined_dataset/train/non-malicious/3097.ps1 | 3097.ps1 | Set-StrictMode -Version Latest
$here = $MyInvocation.MyCommand.Path | Split-Path
Import-Module $here/TypeClass.psm1 -DisableNameChecking
function New-Dictionary ([hashtable]$Hashtable) {
$d = new-object "Collections.Generic.Dictionary[string,object]"
$Hashtable.GetEnumerator() | foreach { $d.Add($_.Key, $_.V... |
combined_dataset/train/non-malicious/847.ps1 | 847.ps1 | powershell Set-ExecutionPolicy Unrestricted -Scope CurrentUser
$resourceGroupName = "<Azure resource group name>"
$dataFactoryName = "<Data factory name. Must be globally unique.>"
$dataFactoryRegion = "East US"
$storageAccountName = "<Az.Storage account name> "
$storageAccountKey = "<Az.Storage account key>"
$subsc... |
combined_dataset/train/non-malicious/Invoke-Inline_1.ps1 | Invoke-Inline_1.ps1 | #############################################################################\n##\n## Invoke-Inline\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\nDemonstrates... |
combined_dataset/train/non-malicious/PromptFor-File.ps1 | PromptFor-File.ps1 | function PromptFor-File
{
param
(
[String] $Type = "Open",
[String] $Title = "Select File",
[String] $Filename = $null,
[String[]] $FileTypes,
[switch] $RestoreDirectory,
[IO.DirectoryInfo] $InitialDirectory = $null
)
[void][System.Reflection.Assembly]::LoadWithPartialName('System.Window... |
combined_dataset/train/non-malicious/sample_47_90.ps1 | sample_47_90.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 = '80.0.0'
# Suppo... |
combined_dataset/train/non-malicious/sample_66_13.ps1 | sample_66_13.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerinstances'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerinstances.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Suppo... |
combined_dataset/train/non-malicious/4395.ps1 | 4395.ps1 | function Compare-PrereleaseVersions
{
[CmdletBinding()]
param(
[ValidateNotNullOrEmpty()]
[string]
$FirstItemVersion,
[string]
$FirstItemPrerelease,
[ValidateNotNullOrEmpty()]
[string]
$SecondItemVersion,
[string]
$SecondItemPrer... |
combined_dataset/train/non-malicious/sample_15_79.ps1 | sample_15_79.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 = '79.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_63_46.ps1 | sample_63_46.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 License... |
combined_dataset/train/non-malicious/391.ps1 | 391.ps1 | $moduleRoot = (Resolve-Path "$PSScriptRoot\..\..").Path
. "$PSScriptRoot\FileIntegrity.Exceptions.ps1"
function Get-FileEncoding
{
[CmdletBinding()]
Param (
[Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)]
[Alias('FullName')]
[string]
$Path
)
[byte[]]$byte = get-content -Encoding... |
combined_dataset/train/non-malicious/Resolve-Aliases 1.6.ps1 | Resolve-Aliases 1.6.ps1 | #requires -version 2.0
## ResolveAliases Module v 1.6
########################################################################################################################
## Sample Use:
## Resolve-Aliases Script.ps1 | Set-Content Script.Resolved.ps1
## ls *.ps1 | Resolve-Aliases -Inplace
##############... |
combined_dataset/train/non-malicious/2385.ps1 | 2385.ps1 | function New-XmlSchema
{
[CmdletBinding()]
[OutputType('System.IO.FileInfo')]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[ValidateScript({ Test-Path -Path $_ -PathType Leaf })]
[ValidatePattern('\.xml$')]
[string]$XmlFilePath,
[Parameter()]
[ValidateNotNullOrEmpty()]
[ValidateS... |
combined_dataset/train/non-malicious/sample_45_72.ps1 | sample_45_72.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Set-ScriptExtent {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding(PositionalBinding = $false, DefaultParameterSetName = '__AllParameterSets')]
param(
[Parameter(Posit... |
combined_dataset/train/non-malicious/1188.ps1 | 1188.ps1 |
$alreadyEnabled = $false
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
$alreadyEnabled = Test-FirewallStatefulFtp
if( $alreadyEnabled )
{
Disable-FirewallStatefulFtp
}
}
function Stop-Test
{
... |
combined_dataset/train/non-malicious/sample_60_19.ps1 | sample_60_19.ps1 | <#
.SYNOPSIS
Module for extended installed Windows Updates report
.DESCRIPTION
Collects information on installed Windows Updates and generates a report in .html format
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedback : ... |
combined_dataset/train/non-malicious/sample_9_13.ps1 | sample_9_13.ps1 | ##########################################
# Set Variables
##########################################
$ComputerName = $ENV:COMPUTERNAME
$windir = $Env:windir
$ProgFiles64 = $ENV:ProgramFiles
$ProgFiles86 = ${Env:ProgramFiles(x86)}
$system32 = $windir + "\system32"
$SystemRoot = $Env:SystemRoot
$OS = Get... |
combined_dataset/train/non-malicious/sample_14_53.ps1 | sample_14_53.ps1 | #
# Module manifest for module 'OperationsManagerV10Module'
#
# Generated by: Microsoft Corporation
#
# Generated on: 10/22/2008
#
@{
# These modules will be processed when the module manifest is loaded.
ModuleToProcess = 'OperationsManager.psm1'
# This GUID is used to uniquely identify this module.
GU... |
combined_dataset/train/non-malicious/Deploy VM with Static IP_4.ps1 | Deploy VM with Static IP_4.ps1 | # 1. Create a simple customizations spec:
$custSpec = New-OSCustomizationSpec -Type NonPersistent -OSType Windows `
-OrgName “My Organization” -FullName “MyVM” -Domain “MyDomain” `
–DomainUsername “user” –DomainPassword “password”
# 2. Modify the default network customization settings:
$custSpec | Get-OS... |
combined_dataset/train/non-malicious/2018.ps1 | 2018.ps1 |
Describe 'Basic Job Tests' -Tags 'CI' {
BeforeAll {
Get-Job | Remove-Job -Force
$timeBeforeStartedJob = Get-Date
$startedJob = Start-Job -Name 'StartedJob' -ScriptBlock { 1 + 1 } | Wait-Job
$timeAfterStartedJob = Get-Date
function script:ValidateJobInfo($job, $st... |
combined_dataset/train/non-malicious/New-SqlConnectionString.ps1 | New-SqlConnectionString.ps1 | function New-SqlConnectionString {
#.Synopsis
# Create a new SQL ConnectionString
#.Description
# Builds a SQL ConnectionString using SQLConnectionStringBuilder with the supplied parameters
#.Example
# New-SqlConnectionString -Server DBServer12 -Database NorthWind -IntegratedSecurity -MaxPoolSize 4 -Pooling
#... |
combined_dataset/train/non-malicious/sample_46_19.ps1 | sample_46_19.ps1 | #
# Script module for module 'Az.Security' that is executed when 'Az.Security' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:43
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
... |
combined_dataset/train/non-malicious/sample_8_9.ps1 | sample_8_9.ps1 | . ./utils_cts.ps1
SkipSecondExecution
Consume-GenericMessages
# SIG # Begin signature block
# MIIoPAYJKoZIhvcNAQcCoIIoLTCCKCkCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDMPV42+aNUJPQ4
# ASdUcqzQU9xIEqt... |
combined_dataset/train/non-malicious/UIAutomation _1.9.ps1 | UIAutomation _1.9.ps1 | ## UI Automation v 1.10 -- REQUIRES the Reflection module
##
# WASP 2.0 is getting closer, but this is still just a preview:
# -- a lot of the commands have weird names still because they're being generated ignorantly
# -- eg: Invoke-Toggle.Toggle and Invoke-Invoke.Invoke
# v 1.7 - Fixes using multiple checks... |
combined_dataset/train/non-malicious/sample_43_22.ps1 | sample_43_22.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Get-Token {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding()]
[OutputType([System.Management.Automation.Language.Token])]
[System.Diagnostics.CodeAnalysis.SuppressMessage... |
combined_dataset/train/non-malicious/PowerOracle.ps1 | PowerOracle.ps1 | # Load assembly
[System.Reflection.Assembly]::LoadWithPartialName("Oracle.DataAccess")
# Connection information
$ConnectionString = "Data Source=your_server/sid;User Id=user_name;Password=password"
#Standard SQL Query Syntax
$QueryString = "SELECT * FROM table_name WHERE #Case"
$OracleConnection = New-Objec... |
combined_dataset/train/non-malicious/sample_57_42.ps1 | sample_57_42.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.3.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_53_44.ps1 | sample_53_44.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 = '82.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/3004.ps1 | 3004.ps1 | Set-StrictMode -Version Latest
$scriptRoot = Split-Path (Split-Path $MyInvocation.MyCommand.Path)
$multiLanguageTestData = @{
'en' = @{ namedScenario = 'When something uses MyValidator'; additionalSteps = 4; additionalScenarios = 2 }
'es' = @{ namedScenario = 'Algo usa MiValidator'; additionalSteps = 0; addit... |
combined_dataset/train/non-malicious/2531.ps1 | 2531.ps1 |
param ([string]$sqlserver, [string]$filename)
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Replication") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Rmo") | out-null
$TableQuery = "SELECT DISTINCT Server
FROM SQLDatabases
WHERE DatabaseName LIKE '%distribution%'
... |
combined_dataset/train/non-malicious/3162.ps1 | 3162.ps1 |
Function Dump-AzureDomainInfo-MSOL
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$false,
HelpMessage="Folder to output to.")]
[string]$folder
)
if ($folder){if(Test-Path $folder){if(Test-Path $folder"\MSOL"){}else{New-Item -ItemType Directory $folder"\MSOL"|Ou... |
combined_dataset/train/non-malicious/sample_55_45.ps1 | sample_55_45.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydomains'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydomains.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_16_58.ps1 | sample_16_58.ps1 | ConvertFrom-StringData @'
IPAddressDisplayNameFormat=IP Adresi: {0}
NetworkNameDisplayNameFormat=Ad: {0}
NetworkNameOfflineDisplayNameFormat=IP Adresi: "{0}" üzerindeki adres
CreateClusterProgressValidationStart=Yük devretme kümesi için sunucuların uygunluğu doğrulanıyor.
CreateClusterProgressValidationEnd=Yük dev... |
combined_dataset/train/non-malicious/Note, open Notepad++_1.ps1 | Note, open Notepad++_1.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_39_71.ps1 | sample_39_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Logging'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Logging.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/ISE-Comments_1.ps1 | ISE-Comments_1.ps1 | #requires -version 2.0
## ISE-Comments module v 1.1
##############################################################################################################
## Provides Comment cmdlets for working with ISE
## ConvertTo-BlockComment - Comments out selected text with <# before and #> after
## ConvertTo-BlockUn... |
combined_dataset/train/non-malicious/sample_54_44.ps1 | sample_54_44.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/3800.ps1 | 3800.ps1 |
function Test-AddVhd
{
$rgname = Get-ComputeTestResourceName
try
{
$loc = Get-ComputeVMLocation;
New-AzResourceGroup -Name $rgname -Location $loc -Force;
$stoname = 'sto' + $rgname;
$stotype = 'Standard_GRS';
New-AzStorageAccoun... |
combined_dataset/train/non-malicious/sample_14_67.ps1 | sample_14_67.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/2675.ps1 | 2675.ps1 | param(
[switch]$syncPermissions
)
. $PSScriptRoot/shared.ps1
Write-Output -InputObject @"
___ ___ _____
| \/ | | __ \
| . . |_ __ | | \/ _____ _____ _ __ _ __ __ _ _ __ ___ ___
| |\/| | ... |
combined_dataset/train/non-malicious/Invoke-ComplexDebuggerSc.ps1 | Invoke-ComplexDebuggerSc.ps1 | #############################################################################\n##\n## Invoke-ComplexDebuggerScript\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS... |
combined_dataset/train/non-malicious/sample_60_83.ps1 | sample_60_83.ps1 | #
# Module manifest for module 'OCI.PSModules.Certificatesmanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Certificatesmanagement.dll'
# Version number of this module.
ModuleVersion = '89.0.0'
... |
combined_dataset/train/non-malicious/sample_47_92.ps1 | sample_47_92.ps1 | # ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apach... |
combined_dataset/train/non-malicious/Set-RemoteRegistryKeyPro.ps1 | Set-RemoteRegistryKeyPro.ps1 | ##############################################################################\n##\n## Set-RemoteRegistryKeyProperty\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPS... |
combined_dataset/train/non-malicious/ConvertTo-PseudoType_2.ps1 | ConvertTo-PseudoType_2.ps1 | #function ConvertTo-PseudoType {
<#
.Synopsis
Convert an object to a custom PSObject wiith robust type information
.Parameter TypeName
The name(s) of the PseudoType(s) to be inserted into the objects for the sake of formatting
.Parameter Mapping
A Hashtable of property names to types (or conversion ... |
combined_dataset/train/non-malicious/sample_6_16.ps1 | sample_6_16.ps1 | #
# Module manifest for module 'OCI.PSModules.Certificates'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Certificates.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_57_49.ps1 | sample_57_49.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/sample_32_12.ps1 | sample_32_12.ps1 | #
# Module manifest for module 'OCI.PSModules.Managementagent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Managementagent.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_19_85.ps1 | sample_19_85.ps1 |
account-finish-account-setup = 完成账户设置
account-disconnected2 = 账户已断开连接
account-send-to-all-devices = 发送到所有设备
account-manage-devices = 管理设备…
account-reconnect = 重新绑定 { $email }
account-verify = 确认 { $email }
account-send-to-all-devices-titlecase = 发送到所有设备
account-manage-devices-titlecase = 管理设备…
account-send-tab-t... |
combined_dataset/train/non-malicious/Convert-PowerPack2Ps_1.ps1 | Convert-PowerPack2Ps_1.ps1 | #######################################################################
# Convert-PowerPack2Ps1
#
# Converts PowerGUI .PowerPack files to ps1 PowerShell script library
# v1 - raw conversion, no name changes, only script elements converted
######################################################################
# E... |
combined_dataset/train/non-malicious/sample_49_34.ps1 | sample_49_34.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 = 'PowerShellEditorServices.Commands.psm1'
# Version number of this module.
ModuleVersion = '0.2.0'
# I... |
combined_dataset/train/non-malicious/Custom Object Factory Te.ps1 | Custom Object Factory Te.ps1 | <#
.SYNOPSIS
A template for a function that creates a PSObject
.DESCRIPTION
If you find yourself creating a lot of custom PSObjects with lots of Properties, this template
may help save you some typing. It discovers the function paramters, and uses them to create a hash
that is splatted against a (new-object ps... |
combined_dataset/train/non-malicious/New-Exch2010NlbCluster_1.ps1 | New-Exch2010NlbCluster_1.ps1 | ###########################################################################
#
# NAME: New-Exch2010NlbCluster.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jer@powershell.no
#
# COMMENT: Script to create a NLB-cluster for the CAS/HUB-roles in Exchange Server 2010.
# For more details, see the following blog-pos... |
combined_dataset/train/non-malicious/sample_18_44.ps1 | sample_18_44.ps1 | <#
.SYNOPSIS
Install Device Admin Agent.
.DESCRIPTION
This script job is install admin agent.
Script will be called by logon.ps1. It check device has admin agent installed or not.
#>
# run script in strict mode
Set-StrictMode -Version Latest
# script variables
$basePa... |
combined_dataset/train/non-malicious/sample_22_62.ps1 | sample_22_62.ps1 | #
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ... |
combined_dataset/train/non-malicious/3180.ps1 | 3180.ps1 | function Test-ForAdmin {
[cmdletbinding()]
param(
[Parameter(
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
ValueFromRemainingArguments=$false,
Position=0
)][string[]]$username =$env:username
)
Process{
... |
combined_dataset/train/non-malicious/sample_35_66.ps1 | sample_35_66.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias'... |
combined_dataset/train/non-malicious/3857.ps1 | 3857.ps1 |
function NewExchangeConnectionV4V6($facilityId, $v4, $v6)
{
Write-Debug "Creating Connection at $facilityId"
$md5 = getHash
$md5 = $md5.ToString()
Write-Debug "Created Hash $md5"
$offset = Get-Random -Maximum 20 -Minimum 3
$sessionv4 = changeIp "$v4/32" $false $offset $false
$sessionv6 = changeIp... |
combined_dataset/train/non-malicious/sample_27_23.ps1 | sample_27_23.ps1 | ##########################################################################################
# <copyright file="Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Startup.ps1" company="Microsoft">
# Copyright (c) Microsoft Corporation. All rights reserved.
# </copyright>
# <summary>Microsoft.Enterprise... |
combined_dataset/train/non-malicious/default.config.ps1 | default.config.ps1 | <!-- An example log4net config (Save as default.config) -->
<log4net>
<appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
<mapping>
<level value="ERROR" />
<foreColor value="Red, HighIntensity" />
<backColor value="White, HighIntensity... |
combined_dataset/train/non-malicious/sample_24_88.ps1 | sample_24_88.ps1 | Signature-Version: 1.0
SHA-256-Digest-Manifest-Main-Attributes: g/TqwshCROFJVmhV1QEn61Fg1W2Oo
tyaowJxbJy6WMI=
SHA-256-Digest-Manifest: bJiZfTAP2OxfUN8sPU7S/F6I50JY2amBwiemYT8lIYg=
Created-By: 1.8.0_112 (Oracle Corporation)
Name: com/microsoft/azure/toolkit/lib/appservice/webapp/WebAppServiceS
ubscription.clas... |
combined_dataset/train/non-malicious/Join-String.ps1 | Join-String.ps1 | #.Synopsis
# Joins array elements together using a specific string separator
#.Example
# $Env:Path = ls | ? {$_.PSIsContainer} | Select -expand FullName | Join ";" -Append $Env:Path
#.Example
# get-process | select -expand name | join ","
#
function Join-String {
param ( [string]$separator, [string... |
combined_dataset/train/non-malicious/sample_18_6.ps1 | sample_18_6.ps1 | ConvertFrom-StringData @'
id_rsop=Resultant Set of Policy (RSoP)
id_rsopobtaining=Obtaining Resultant Set of Policy (RSoP) via gpresult.exe utility
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JN... |
combined_dataset/train/non-malicious/sample_12_51.ps1 | sample_12_51.ps1 | ConvertFrom-StringData @'
id_kb2475761title=Checking Event Logs
id_kb2475761description=Checking event logs for known issues.
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIB... |
combined_dataset/train/non-malicious/862.ps1 | 862.ps1 | function New-ClusterWithConfig {
$ErrorActionPreference = "Stop"
$context = Get-AzContext
if ($context -eq $null)
{
Connect-AzAccount
}
$context
$resourceGroupName = Read-Host -Prompt "Enter the resource group name"
$location = Read-Host -Prompt ... |
combined_dataset/train/non-malicious/1804.ps1 | 1804.ps1 |
Describe "Get-HotFix Tests" -Tag CI {
BeforeAll {
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
$skip = $false
if (!$IsWindows) {
$skip = $true
}
else {
$qfe = Get-CimInstance Win32_QuickFixEngineering
... |
combined_dataset/train/non-malicious/sample_57_22.ps1 | sample_57_22.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_6_90.ps1 | sample_6_90.ps1 | // Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved.
// ==================================================================
// DCIM_EnabledLogicalElementCapabilities
// ==================================================================
[ dynamic, provider("dcismprovider"),
Descriptio... |
combined_dataset/train/non-malicious/540.ps1 | 540.ps1 |
function Add-SPODateTimeFieldtoList
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string] $listTitle,
[Parameter(Mandatory=$true, Position=2)]
[string] $fieldName
)
$newField = "<Field Type='DateTime' DisplayName='$fieldName' Name='$fieldName' required='FALSE'/>"
Add-... |
combined_dataset/train/non-malicious/sample_35_60.ps1 | sample_35_60.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_2_23.ps1 | sample_2_23.ps1 | # You may use this code and information and create derivative works of it,
# provided that the following conditions are met:
# 1. This code and information and any derivative works may only be used for
# troubleshooting a) Windows and b) products for Windows, in either case using
# the Windows Troubleshooting Platf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.