full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/923.ps1 | 923.ps1 |
$subscriptionId = 'yourSubscriptionId'
$resourceGroupName ='yourResourceGroupName'
$snapshotName = 'yourSnapshotName'
$osDiskName = 'yourOSDiskName'
$virtualNetworkName = 'yourVNETName'
$virtualMachineName = 'yourVMName'
$virtualMachineSize = 'Standard_DS3'
Select-AzSubscription -SubscriptionId $Subsc... |
combined_dataset/train/non-malicious/1193.ps1 | 1193.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
function Test-ShouldGetMsi
{
$msi = Get-Msi -Path (Join-Path -Path $PSScriptRoot -ChildPath 'CarbonTestInstaller.msi' -Resolve)
}
function Test-ShouldAcceptPipelineInput
{
$msi = Get-ChildItem -Path $PSScriptRoot ... |
combined_dataset/train/non-malicious/Seach-LocalGroupMember.ps1 | Seach-LocalGroupMember.ps1 | function Seach-LocalGroupMemberDomenNetwork() {
param(
$Domen,
$User
)
function Ping ($Name){
$ping = new-object System.Net.NetworkInformation.Ping
if ($ping.send($Name).Status -eq "Success") {$True}
else {$False}
trap {Write-Verbose "Error Ping"; $False; continue}
}
[string[]]$Info
[stri... |
combined_dataset/train/non-malicious/ISE-Lines_2.ps1 | ISE-Lines_2.ps1 | #requires -version 2.0
## ISE-Lines module v 1.2
##############################################################################################################
## Provides Line cmdlets for working with ISE
## Duplicate-Line - Duplicates current line
## Conflate-Line - Conflates current and next line
## MoveUp-Lin... |
combined_dataset/train/non-malicious/cc9bae29-4515-4111-9dff-aeedeab6249a.ps1 | cc9bae29-4515-4111-9dff-aeedeab6249a.ps1 | ## New-Struct
## Creates a Struct class and emits it into memory
## The Struct includes a constructor which takes the parameters in order...
##
## Usage:
## # Assuming you have a csv file with no header and columns: artist,name,length
## New-Struct Song @{
## Artist=[string];
## Name=[string];
... |
combined_dataset/train/non-malicious/sample_35_55.ps1 | sample_35_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Waf'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waf.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_4_40.ps1 | sample_4_40.ps1 | #
# Module manifest for module 'OCI.PSModules.Datalabelingservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datalabelingservice.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Sup... |
combined_dataset/train/non-malicious/sample_26_31.ps1 | sample_26_31.ps1 |
import 'processes'
type backlogItem = Epic| AtomicUserStory| TaskBacklog;
Backlog:
'backlog' id=ID '{'
( Name
|Label
|Description
|userstories += (Epic| AtomicUserStory| TaskBacklog))*
'}'
;
Epic :
'epic' id=ID '{'
(Name
... |
combined_dataset/train/non-malicious/sample_61_45.ps1 | sample_61_45.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 = '86.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_66_12.ps1 | sample_66_12.ps1 | function Restart-AzFunctionApp {
[OutputType([System.Boolean])]
[CmdletBinding(DefaultParameterSetName='RestartByName', SupportsShouldProcess=$true, ConfirmImpact='Medium')]
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Description('Restarts a function app.')]
param(
[Parameter(ParameterSet... |
combined_dataset/train/non-malicious/sample_1_99.ps1 | sample_1_99.ps1 | // ==================================================================
// DCIM_SPConsolesConcreteCollection
// ==================================================================
[dynamic, provider("dcismprovider"),
Description(
"DCIM_SPConsolesConcreteCollection is a"
"trivial derivatio... |
combined_dataset/train/non-malicious/Invoke-WindowsApi.ps1 | Invoke-WindowsApi.ps1 | ##############################################################################\n##\n## Invoke-WindowsApi\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\nInvoke... |
combined_dataset/train/non-malicious/1710.ps1 | 1710.ps1 | Function Get-ServiceNowAttachmentDetail {
[System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidUsingConvertToSecureStringWithPlainText','')]
[System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidGlobalVars','')]
[OutputType([System.Management.Automation.PSCustomObject[]])]
[CmdletBinding(D... |
combined_dataset/train/non-malicious/Get-WordOutline_1.ps1 | Get-WordOutline_1.ps1 | function Get-WordOutline ( $Path, [int]$MaxDepth = 9 ) {
if ( $Path -is [System.IO.FileInfo] ) { $Path = $_.FullName }
$word = New-Object -comObject word.application
$document = $word.documents.open( $path )
$outline = $document.paragraphs | Where-Object {
$_.outlineLevel -le $MaxDepth
} | ForEach-Object {... |
combined_dataset/train/non-malicious/3637.ps1 | 3637.ps1 |
function Test-ThreatDetectionUpdatePolicyWithClassicStorage
{
$testSuffix = getAssetName
Create-ThreatDetectionClassicTestEnvironment $testSuffix
$params = Get-SqlThreatDetectionTestEnvironmentParameters $testSuffix
try
{
Set-AzSqlDatabaseThreatDetectionSetting -ResourceGroupName $params.rg... |
combined_dataset/train/non-malicious/2741.ps1 | 2741.ps1 |
function add-zip
{
param([string]$zipfilename)
if (-not (Test-Path($zipfilename))) {
Set-Content $zipfilename ("PK" + [char]5 + [char]6 + ("$([char]0)" * 18))
(dir $zipfilename).IsReadOnly = $false
}
$shellApplication = New-Object -com shell.application
$zipPackage = $shellApp... |
combined_dataset/train/non-malicious/sample_1_64.ps1 | sample_1_64.ps1 | [ dynamic, provider("dcismprovider"),
Description (
"DCIM_MetricService is a derivation of CIM_MetricService "
"and provides the ability to manage metrics. The capabilities "
"of the DCIM_MetricService instance are advertised through an "
"instance of DCIM_MetricServiceCapabilities." ... |
combined_dataset/train/non-malicious/Get-Field_1.ps1 | Get-Field_1.ps1 | function Get-Field{
[CmdletBinding()]
param (
[Parameter(Position=0,Mandatory=$true)]
$InputObject
)
$publicNonPublic = [Reflection.BindingFlags]::Public -bor [Reflection.BindingFlags]::NonPublic
$instance = $publicNonPublic -bor [Reflection.BindingFlags]::Instance
$getField = $instance -bor [Re... |
combined_dataset/train/non-malicious/2720.ps1 | 2720.ps1 |
$ErrorActionPreference = "Continue"
Try {
Push-Location
Set-Location Cert:
ls -r * | Select-Object PSParentPath,FriendlyName,NotAfter,NotBefore,SerialNumber,Thumbprint,Issuer,Subject
} Catch {
("Caught exception: {0}." -f $_)
} Finally {
Pop-Location
} |
combined_dataset/train/non-malicious/sample_25_43.ps1 | sample_25_43.ps1 | 主题
about_IntelEthernetCmdlets
简短说明
介绍如何使用 IntelEthernetCmdlets 模块在支持的
英特尔(R) 以太网设备上获取信息、配置设置或调试问题。
详细说明
IntelEthernetCmdlets 模块包含让您可以在系统中的英特尔®
以太网设备上获取信息或配置设置的 cmdlet。在支持固件日志
记录的设备上,您可以配置并生成日志,以帮助调试问题。
并非所有硬件和操作系统均支持所有 cmdlet。
英特尔(R) 以太网 700 系列设备不支持固件日志记录。
注:不支持... |
combined_dataset/train/non-malicious/sample_24_86.ps1 | sample_24_86.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmconfig'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmconfig.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/1663.ps1 | 1663.ps1 |
function Get-InstalledApps {
param (
[Parameter(ValueFromPipeline=$true)]
[string[]]$ComputerName = $env:COMPUTERNAME,
[string]$NameRegex = ''
)
foreach ($comp in $ComputerName) {
$keys = '','\Wow6432Node'
foreach ($key in $keys) {
try {
... |
combined_dataset/train/non-malicious/sample_58_42.ps1 | sample_58_42.ps1 | #
# Module manifest for module 'DscInstall'
#
# Generated by: Zia Jalali
#
# Generated on: 07/31/2017
#
@{
# Script module or binary module file associated with this manifest.
ModuleToProcess = 'Heartbeat.psm1'
# Version number of this module.
ModuleVersion = '1.1'
# ID used to uniquely identify thi... |
combined_dataset/train/non-malicious/ScheduleGPOBackups_3.ps1 | ScheduleGPOBackups_3.ps1 | Import-Module grouppolicy
#region ConfigBlock
# What domain are we going to backup GPOs for?
$domain = "mydomain.com"
# Where are we going to store the backups?
$gpoBackupRootDir = "c:\\gpoBackups"
# As I plan to do a new backup set each month I'll setup the directory names to reflect
# the year and month in a n... |
combined_dataset/train/non-malicious/sample_5_82.ps1 | sample_5_82.ps1 | ConvertFrom-StringData @'
id_hypervregcheck=Checking SCSI Subkeys for Hyper-V
id_hypervregcheckdesc=Checking for Hyper-V SCSI Registry Subkeys
'@
# SIG # Begin signature block
# MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
#... |
combined_dataset/train/non-malicious/Save-Credentials.ps1 | Save-Credentials.ps1 | <#
.SYNOPSIS
The script saves a username and password, encrypted with a custom key to to a file.
.DESCRIPTION
The script saves a username and password, encrypted with a custom key to to a file.
The key is coded into the script but should be changed before use.
The key allows the password to be decryp... |
combined_dataset/train/non-malicious/2126.ps1 | 2126.ps1 |
using namespace system.collections.generic
using namespace System.Management.Automation
Describe "Generics support" -Tags "CI" {
It 'Type list[Int] works properly' {
$x = [list[int]]::New()
$x.Add(42)
$x.Add(40)
$x.count | Should -Be 2
}
It 'Type stack[Int] work... |
combined_dataset/train/non-malicious/sample_51_20.ps1 | sample_51_20.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\tailwindcss@3.4.1\node_modules\tailwindcss\lib\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\t... |
combined_dataset/train/non-malicious/Get-ComputerUpdateRport.ps1 | Get-ComputerUpdateRport.ps1 | <#
.SYNOPSIS
Get-ComputerUpdateRport
.DESCRIPTION
This script uses two functions to get a list of computers from ActiveDirectory and then query
each computer for a list of pending updates. It then returns selected fields from that function
to create the report.
.PARAME... |
combined_dataset/train/non-malicious/4470.ps1 | 4470.ps1 |
$script:DSCModuleName = 'DSC'
$script:DSCResourceName = 'MSFT_PSRepository'
$script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or `
(-not (Test-Path -Path (Join-Path -Path $script:moduleRoo... |
combined_dataset/train/non-malicious/sample_10_82.ps1 | sample_10_82.ps1 | #
# Module manifest for module 'OCI.PSModules.Secrets'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Secrets.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_6_63.ps1 | sample_6_63.ps1 | ConvertFrom-StringData @'
id_sccm_activity_genericinfo=Gathering OS Information
id_sccm_genericinfo_osinfo=Obtaining OS Details
id_sccm_genericinfo_sysinfo=Obtaining SystemInfo, Running Tasks and Services
id_sccm_genericinfo_msinfo=Obtaining MSInfo Output
id_sccm_genericinfo_rsop=Obtaining GPResult Output
id_sccm... |
combined_dataset/train/non-malicious/sample_24_0.ps1 | sample_24_0.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.LoadTesting.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.LoadTesting.internal.psm1'
if(Test-Path $internalModulePath) {
... |
combined_dataset/train/non-malicious/sample_48_78.ps1 | sample_48_78.ps1 | #
# Module manifest for module 'OCI.PSModules.Dts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dts.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_55_55.ps1 | sample_55_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Tenantmanagercontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Tenantmanagercontrolplane.dll'
# Version number of this module.
ModuleVersion = '87... |
combined_dataset/train/non-malicious/sample_56_4.ps1 | sample_56_4.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param
(
[Parameter(Mand... |
combined_dataset/train/non-malicious/SharpSsh Functions_2.ps1 | SharpSsh Functions_2.ps1 | ## USING the binaries from:
## http://downloads.sourceforge.net/sharpssh/SharpSSH-1.1.1.13.bin.zip
[void][reflection.assembly]::LoadFrom( (Resolve-Path "~\\Documents\\WindowsPowerShell\\Libraries\\Tamir.SharpSSH.dll") )
## NOTE: These are bare minimum functions, and only cover ssh, not scp or sftp
## also, ... |
combined_dataset/train/non-malicious/sample_34_2.ps1 | sample_34_2.ps1 | # <copyright>
# INTEL CONFIDENTIAL
#
# Copyright 2021 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/Get-SophosScanTime.ps1 | Get-SophosScanTime.ps1 | #######################
<#
.SYNOPSIS
Gets the Scan time information for Sophos
.DESCRIPTION
The Get-SophosScanTime function gets the Sophos weekly scan time information.
.EXAMPLE
Get-SophosScanTime "Z002"
This command gets information for computername Z002.
.EXAMPLE
Get-Content ./servers.txt | Get-SophosScanT... |
combined_dataset/train/non-malicious/sample_30_7.ps1 | sample_30_7.ps1 | #
# Module manifest for module 'OCI.PSModules.Datacatalog'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datacatalog.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_14_31.ps1 | sample_14_31.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 = '74.1.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_26_97.ps1 | sample_26_97.ps1 | # Copyright (C) Intel Corporation, 2021 All Rights Reserved.
function Invoke-GenerateCSR {
<#
.Synopsis
Generates a certificate signing request based on a key from the key store.
.Description
This cmdlet generates a certificate signing request based on a key from the key store.
.Notes
AMT P... |
combined_dataset/train/non-malicious/sample_13_45.ps1 | sample_13_45.ps1 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apa... |
combined_dataset/train/non-malicious/sample_49_93.ps1 | sample_49_93.ps1 | BrugerhåndbogfKomponentnavne og -FunktionerfNyttige FunktionerfKonfigurationsmenufFejlfindingfVedligeholdelsefOvervågning og kontrolfInstallation og forbindelserBetjeningsvejledning Brug af softwaren på medfølgende cd-rom med Epson Projector SoftwaresBetjeningsvejledning for EasyMP Network ProjectionsBetjeningsvejledni... |
combined_dataset/train/non-malicious/sample_18_32.ps1 | sample_18_32.ps1 | # DO NOT COPY THIS MANIFEST VERBATIM. THIS IS JUST A SAMPLE.
# GENERATE YOUR MANIFEST USING THE New-ModuleManifest COMMAND TO
# GUARANTEE YOU GET A UNIQUE GUID FOR YOUR MODULE.
@{
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additio... |
combined_dataset/train/non-malicious/sample_58_55.ps1 | sample_58_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Ocicontrolcenter'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ocicontrolcenter.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported... |
combined_dataset/train/non-malicious/Copy__Paste__Clear.ps1 | Copy__Paste__Clear.ps1 | using System;
using System.Text;
using System.Threading;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("2.0.0.0")]
namespace Clip {
internal static class WinAPI {
[DllImport("kernel32.dll")]
internal static extern IntPtr GetConsoleWindow();
[DllI... |
combined_dataset/train/non-malicious/sample_53_76.ps1 | sample_53_76.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/sample_56_53.ps1 | sample_56_53.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 = '83.1.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/Get-TheVillageChurchPod.ps1 | Get-TheVillageChurchPod.ps1 | function Get-TheVillageChurchPodCast {
<#
.SYNOPSIS
Gets The Village Church sermon podcasts.
.DESCRIPTION
The Get-TheVillageChurchPodcast function returns objects of all the available sermon podcasts from The Village Church.
The objects can be filtered by speaker, series, title, or date and optionally d... |
combined_dataset/train/non-malicious/2986.ps1 | 2986.ps1 | function BeforeEach {
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true,
Position = 1)]
[Scriptblock]
$Scriptblock
)
Assert-DescribeInProgress -CommandName BeforeEach
}
function AfterEach {
[CmdletBinding()]
param
(
... |
combined_dataset/train/non-malicious/sample_11_64.ps1 | sample_11_64.ps1 | #
# Module manifest for module 'OCI.PSModules.Applicationmigration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Applicationmigration.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# S... |
combined_dataset/train/non-malicious/sample_53_25.ps1 | sample_53_25.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 = '83.1.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/1353.ps1 | 1353.ps1 |
function Remove-CHostsEntry
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true,Position=0)]
[string[]]
$HostName,
[string]
$Path = (Get-CPathToHostsFile)
)
begin
{
Set-Stri... |
combined_dataset/train/non-malicious/1529.ps1 | 1529.ps1 |
[CmdletBinding()]
param(
)
Set-StrictMode -Version 'Latest'
$ErrorActionPreference = 'Stop'
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon\Import-Carbon.ps1' -Resolve)
$installPath = Get-PowerShellModuleInstallPath
$installPath = Join-Path -Path $installPath -ChildPath 'Carbon'
$source = Join-P... |
combined_dataset/train/non-malicious/3733.ps1 | 3733.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Get-ResourceName
{
return getAssetName
}
function Get-ProviderLocation($provider)
{
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
{
$namespace... |
combined_dataset/train/non-malicious/2857.ps1 | 2857.ps1 | function Assert {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
$conditionToCheck,
[Parameter(Mandatory = $true)]
[string]$failureMessage
)
if (-not $conditionToCheck) {
throw ('Assert: {0}' -f $failureMessage)
}
}
|
combined_dataset/train/non-malicious/Disconnect-VMHost.ps1 | Disconnect-VMHost.ps1 | #requires -version 2 -pssnapin VMware.VimAutomation.Core
Function Disconnect-VMHost {
<#
.Summary
Used to Disconnect a Connected host from vCenter.
.Parameter VMHost
VMHost to Disconnect to virtual center
.Example
Get-VMHost | Where-Object {$_.state -eq "Connected"} | Di... |
combined_dataset/train/non-malicious/sample_45_48.ps1 | sample_45_48.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/3740.ps1 | 3740.ps1 | $data=123
$securedata=$data | ConvertTo-SecureString -AsPlainText -Force
$newdata=456
$newsecuredata=$newdata | ConvertTo-SecureString -AsPlainText -Force
$expires= (Get-Date).AddYears(2).ToUniversalTime()
$nbf=(Get-Date).ToUniversalTime()
$newexpires= (Get-Date).AddYears(5).ToUniversalTime()
$newnbf=(Get-Date).AddY... |
combined_dataset/train/non-malicious/sample_16_85.ps1 | sample_16_85.ps1 | ConvertFrom-StringData @'
IPAddressDisplayNameFormat=Endereço IP: {0}
NetworkNameDisplayNameFormat=Nome: {0}
NetworkNameOfflineDisplayNameFormat=Endereço IP: Endereço em "{0}"
CreateClusterProgressValidationStart=Validando a adequação dos servidores para um cluster de failover.
CreateClusterProgressValidationEnd=C... |
combined_dataset/train/non-malicious/Get-MWSOrder_1.ps1 | Get-MWSOrder_1.ps1 | // --------------------------------------------------------------------------------------------------------------------
// <copyright file="GetOrderCmdlet.cs" company="Huddled Masses">
// Copyright (c) 2011 Joel Bennett
// </copyright>
// <summary>
// Defines the Get-Order Cmdlet for Amazon Marketplace Orders ... |
combined_dataset/train/non-malicious/Set-Keydelay.ps1 | Set-Keydelay.ps1 | Begin {
$key = "keyboard.typematicMinDelay"
$value = "2000000"
}
Process {
#Make Sure it's a VM
if ( $_ -isnot [VMware.VimAutomation.Client20.VirtualMachineImpl] ) { continue }
#Setup our Object
$vm = Get-View $_.Id
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec... |
combined_dataset/train/non-malicious/1858.ps1 | 1858.ps1 |
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
function Wait-JobPid {
param (
$Job
)
$startTime = [DateTime]::Now
$TimeoutInMilliseconds = 10000
do {
Start-Sleep -Seconds 1
$pwshId = Receive-Job $Job
if (([DateTime]::Now - $startTime).TotalMi... |
combined_dataset/train/non-malicious/LibraryChart_3.ps1 | LibraryChart_3.ps1 | # ---------------------------------------------------------------------------
### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### Defines functions for wokring with Microsoft Chart Control for .NET 3.5 Framework
### Pipe output of Powershell command to Out-Chart function and specify c... |
combined_dataset/train/non-malicious/sample_26_56.ps1 | sample_26_56.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/sample_53_34.ps1 | sample_53_34.ps1 | # Copyright (c) 2019 Ansible Project
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
Function Get-AnsibleWebRequest {
<#
.SYNOPSIS
Creates a System.Net.WebRequest object based on common URL module options in Ansible.
.DESCRIPTION
Will crea... |
combined_dataset/train/non-malicious/sample_4_20.ps1 | sample_4_20.ps1 | ConvertFrom-StringData @'
id_rdsserverprogress=Gathering RDS Information:
id_rdswmiget=Getting Win32_TerminalServiceSetting from WMI.
id_rdswmigeterror=ERROR: WMI not working. unable to get Win32_TerminalServiceSetting.
id_rdswmigetsolution=Please verify that WMI service running using wbemtest.
id_rdsiis=Getting I... |
combined_dataset/train/non-malicious/sample_6_17.ps1 | sample_6_17.ps1 | #************************************************
# DC_ServerManagerLogs.ps1
# Version 1.0.1
# Date: 01-04-2011
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script can be used to obtain server manager related logs
#************************************************
PARAM($MachineName=$Comp... |
combined_dataset/train/non-malicious/sample_25_38.ps1 | sample_25_38.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicemesh'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicemesh.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_39_77.ps1 | sample_39_77.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 = '82.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_54_67.ps1 | sample_54_67.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 = '82.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/677.ps1 | 677.ps1 |
$reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl }
Function New-InMemoryEmailSubscription
{
[xml]$matchData = '<?xml version="1.0" encoding="utf-16" standalone="yes"?><ScheduleDefinition xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs... |
combined_dataset/train/non-malicious/99425dd4-2c85-40f1-9cc8-39300a810b7a.ps1 | 99425dd4-2c85-40f1-9cc8-39300a810b7a.ps1 | [reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server.Search") | out-null
#NOTE: I've set strict crawl freshness/crawl duration/success ratio ... |
combined_dataset/train/non-malicious/1049.ps1 | 1049.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
if( Test-AdminPrivilege )
{
$originalTrustedHosts = $null
function Start-Test
{
$originalTrustedHosts = @( Get-TrustedHost )
Clear-TrustedHost
}
function Stop-Test
{
if( $... |
combined_dataset/train/non-malicious/749.ps1 | 749.ps1 | $vstsVariables = @{
PSES_BRANCH = 'master'
}
foreach ($var in $vstsVariables.Keys)
{
if (Get-Item "env:$var" -ErrorAction Ignore)
{
continue
}
$val = $vstsVariables[$var]
Write-Host "Setting var '$var' to value '$val'"
Write-Host "
}
|
combined_dataset/train/non-malicious/sample_39_31.ps1 | sample_39_31.ps1 | function Get-CloudTrailKmsPolicy
{
<#
.SYNOPSIS
Returns a customized Kms policy for CloudTrail using the supplied Role Arn principal
#>
$kmsPolicy = "{
'Statement': [
{
'Sid': 'Allow CloudTrail to encrypt logs',
'Effect': 'Allow',
'Principal': {
'Service': 'cloudtrail.amazonaw... |
combined_dataset/train/non-malicious/sample_33_31.ps1 | sample_33_31.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 = '79.0.0'
... |
combined_dataset/train/non-malicious/sample_46_73.ps1 | sample_46_73.ps1 | Import-LocalizedData -BindingVariable lnTxt -FileName AzStackHci.Network.Strings.psd1
function Test-MgmtIpRange
{
[CmdletBinding()]
param (
[Parameter(Mandatory = $false, HelpMessage = "Specify starting Management IP Range")]
[System.Net.IPAddress]
$StartingAddress,
[... |
combined_dataset/train/non-malicious/sample_55_94.ps1 | sample_55_94.ps1 | # <copyright>
# INTEL CONFIDENTIAL
#
# Copyright 2023 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/Findup_23.ps1 | Findup_23.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_60_21.ps1 | sample_60_21.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/sample_50_66.ps1 | sample_50_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmsynthetics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmsynthetics.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_60_0.ps1 | sample_60_0.ps1 | #
# Module manifest for module 'OCI.PSModules.Adm'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Adm.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/Invoke-Generic.ps1 | Invoke-Generic.ps1 | function Invoke-Generic {
#.Synopsis
# Invoke Generic method definitions via reflection:
[CmdletBinding()]
param(
[Parameter(Position=0,Mandatory=$true,ValueFromPipelineByPropertyName=$true)]
[Alias('On','Type')]
$InputObject
,
[Parameter(Position=1,ValueFromPipelineByPropertyName=$true)]
[Al... |
combined_dataset/train/non-malicious/style acording video res.ps1 | style acording video res.ps1 | @@---------------------------------------------------------------------------------------------------------------------------
@@ this code is copied from http://www.ti4fun.com/myouikar/JavaScript/rotina.aspx?r=JJiKNeLQlIA[[ti&l=STN[ti]5tehuTA[[ti
@@---------------------------------------------------------------------... |
combined_dataset/train/non-malicious/4184.ps1 | 4184.ps1 |
cls
$OS = Get-WmiObject -Class Win32_OperatingSystem -ComputerName .
Switch ($OS.Version) {
5.0.2195 {New-Item -Name "Windows 2000" -Path $env:windir -ItemType File}
5.1.2600 {New-Item -Name "Windows XP" -Path $env:windir -ItemType File}
5.2.3790 {New-Item -Name "Windows XP 64-Bit"... |
combined_dataset/train/non-malicious/sample_1_67.ps1 | sample_1_67.ps1 | #************************************************
# TS_DCDiag.ps1
# Version 1.1.1
# Date: 04-11-2011
# Authors : Andre Teixeira/ David Fisher (CSS)/ Craig Landis
# Description: Run DCDiag utility to obtain log files
#************************************************
if($debug -eq $true){[void]$shell.popup("R... |
combined_dataset/train/non-malicious/Get-CrawlHealth (MOSS).ps1 | Get-CrawlHealth (MOSS).ps1 | [reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server.Search") | out-null
@@#NOTE: I've set strict crawl freshness/crawl duration/success rati... |
combined_dataset/train/non-malicious/sample_33_46.ps1 | sample_33_46.ps1 | /*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.46.0(21007360cad28648bdf46282a2592cb47c3a7a6f)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-------------... |
combined_dataset/train/non-malicious/sample_26_9.ps1 | sample_26_9.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function set-AMTMPS {
<#
.Synopsis
Set proxy information for the Intel Fast Call for Help Management Presence Server (MPS) interface
.Description
Set proxy information for the Intel Fast Call for Help Management Presence Server (M... |
combined_dataset/train/non-malicious/sample_39_43.ps1 | sample_39_43.ps1 |
trap
{
# If we except, lets report it visually. Can help with debugging if there IS a problem
# in here.
Write-Host "EXCEPTION: $($PSItem.ToString())" -ForegroundColor Red
Write-Host "$($PSItem.ScriptStackTrace)"
Start-Sleep 10
}
# Get an environment variable with default value if not present
fu... |
combined_dataset/train/non-malicious/2412.ps1 | 2412.ps1 |
[CmdletBinding(DefaultParameterSetName = 'EmailNotification')]
param (
[Parameter(Mandatory)]
[string]$DeploymentId,
[Parameter()]
[ValidateRange(1, 100)]
[int]$FailurePercentThreshold = 10,
[Parameter(ParameterSetName = 'EmailNotification')]
[string]$ToEmailAddress = 'replacethis@defaultemail.com',
[Parame... |
combined_dataset/train/non-malicious/sample_32_81.ps1 | sample_32_81.ps1 | @{
GUID="766204A6-330E-4263-A7AB-46C87AFC366C"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManC... |
combined_dataset/train/non-malicious/1088.ps1 | 1088.ps1 |
& (Join-Path -Path $PSScriptRoot 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'New-Junction' {
$JunctionPath = $null
$tempDir = Get-Item -Path 'TestDrive:'
BeforeEach {
$Global:Error.Clear()
$JunctionPath = Join-Path $tempDir ([IO.Path]::GetRandomFileName())
}
... |
combined_dataset/train/non-malicious/3367.ps1 | 3367.ps1 |
param(
[string] $RootPath = "$PSScriptRoot\..\src",
[string] $OutputFile = "$PSScriptRoot\groupMapping.json",
[string] $WarningFile = "$PSScriptRoot\groupMappingWarnings.json",
[string] $RulesFile = "$PSScriptRoot\CreateMappings_rules.json"
);
$rules = Get-Content -Raw -Path $RulesFile | ConvertFro... |
combined_dataset/train/non-malicious/sample_53_1.ps1 | sample_53_1.ps1 | if ((Test-Path "HKLM:\SOFTWARE\Microsoft\Windows Embedded\KeyboardFilter") -And ((Get-Item "HKLM:\SOFTWARE\Microsoft\Windows Embedded\KeyboardFilter").GetValue("Windows") -eq "Blocked")) {
& reg.exe add "HKLM\SOFTWARE\Microsoft\Windows Embedded\KeyboardFilter" /v Windows /t REG_SZ /d Allowed /f
}
if ((Test-Pat... |
combined_dataset/train/non-malicious/Get_Set Signature (CTP2)_3.ps1 | Get_Set Signature (CTP2)_3.ps1 | #Requires -version 2.0
## Authenticode.psm1
####################################################################################################
## Wrappers for the Get-AuthenticodeSignature and Set-AuthenticodeSignature cmdlets
## These properly parse paths, so they don't kill your pipeline and script if you incl... |
combined_dataset/train/non-malicious/3954.ps1 | 3954.ps1 |
function Test-ExpressRoutePortsLocationRead
{
$vExpressRoutePortsLocationList = Get-AzExpressRoutePortsLocation
Assert-NotNull $vExpressRoutePortsLocationList
Assert-True { $vExpressRoutePortsLocationList.Count -gt 0 }
Assert-NotNull $vExpressRoutePortsLocationList[0].Address
Assert-NotNull $v... |
combined_dataset/train/non-malicious/sample_29_75.ps1 | sample_29_75.ps1 | @(echo off) > $null
if #ftw NEQ '' goto :init
($true){ $Error.clear(); }
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# wrapper script for vcpkg
# this is intended to be dot-sourced and then you can use the vcpkg() function
# Workaround for $IsWindows not existing in Windows PowerShell
if... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.