full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_30_22.ps1 | sample_30_22.ps1 | #
# Module manifest for module 'OCI.PSModules.Autoscaling'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Autoscaling.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_9_65.ps1 | sample_9_65.ps1 | #************************************************
# TS_SBSL_DHCPRelayKB2459530.ps1
# Version 1.0.1
# Date: 5/14/2012
# Author: v-maam
# Description: [Idea ID 2749] [Windows] SBSL Windows firewall delays acquisition of DHCP address from DHCP relay on domain-joined W7 client
# Rule number: 2749
# Rule URL: //sh... |
combined_dataset/train/non-malicious/sample_47_47.ps1 | sample_47_47.ps1 | #
# Script module for module 'Az.LoadTesting' that is executed when 'Az.LoadTesting' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:41
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
... |
combined_dataset/train/non-malicious/3243.ps1 | 3243.ps1 |
class Group : BaseLogger {
[string]$Name
[string]$Description
[hashtable]$Users = @{}
[hashtable]$Roles = @{}
Group([string]$Name, [Logger]$Logger) {
$this.Name = $Name
$this.Logger = $Logger
}
Group([string]$Name, [string]$Description, [Logger]$Logger) {
$this.N... |
combined_dataset/train/non-malicious/Reverse filename sequenc_4.ps1 | Reverse filename sequenc_4.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_30_19.ps1 | sample_30_19.ps1 | #
# Module manifest for module 'OCI.PSModules.Globallydistributeddatabase'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Globallydistributeddatabase.dll'
# Version number of this module.
ModuleVersion =... |
combined_dataset/train/non-malicious/sample_43_64.ps1 | sample_43_64.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/4140.ps1 | 4140.ps1 |
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][string]$Application,
[ValidateNotNullOrEmpty()][string]$LogFileName,
[string]$LogFileLocation,
[switch]$ExactFileName
)
function New-LogFile {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][string]$Log
)
$LogFile = Get-ChildItem -Path $LogFi... |
combined_dataset/train/non-malicious/sample_11_69.ps1 | sample_11_69.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 = '73.1.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_65_54.ps1 | sample_65_54.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 = '86.2.0'
# S... |
combined_dataset/train/non-malicious/LDAPLogging.ps1 | LDAPLogging.ps1 | \nfunction Private:Configure-Logging {\n Use one of the following aliases:\n Get-LDAPLogging\n View current LDAP logging settings\n Enable-LDAPLogging\n Enables LDAP logging. Logging is set to log every single LDAP query and stores it in directory services log.\n Disabl... |
combined_dataset/train/non-malicious/sample_26_53.ps1 | sample_26_53.ps1 | Get-Module | ForEach-Object { Remove-Module -Name $_.Name -Force }
$PSModuleAutoloadingPreference = 'none'
Import-Module Microsoft.PowerShell.Utility
#Enforcing default PSModulePath to avoid getting unexpected modules to run instead of built-in modules
$env:PSModulePath = "C:\Program Files\WindowsPowerShell\Modules... |
combined_dataset/train/non-malicious/sample_62_0.ps1 | sample_62_0.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcemanager.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_47_89.ps1 | sample_47_89.ps1 | #
# Module manifest for module 'OCI.PSModules.Aianomalydetection'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aianomalydetection.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Suppo... |
combined_dataset/train/non-malicious/1999.ps1 | 1999.ps1 |
Describe "PSVersionTable" -Tags "CI" {
BeforeAll {
$sma = Get-Item (Join-Path $PSHome "System.Management.Automation.dll")
$formattedVersion = $sma.VersionInfo.ProductVersion
$mainVersionPattern = "(\d+\.\d+\.\d+)(-.+)?"
$fullVersionPattern = "^(\d+\.\d+\.\d+)(-.+)?-(\d+)-g(.+)$"
... |
combined_dataset/train/non-malicious/sample_46_56.ps1 | sample_46_56.ps1 | # Copyright (C) Intel Corporation,2021 All Rights Reserved.
function Invoke-ConfigureTLSServerAuthentication
{
<#
.Synopsis
Configures AMT connection to TLS with server authentication.
.Description
This cmdlet configures the AMT connection to TLS with server authentication.
The cmdlet adds the AM... |
combined_dataset/train/non-malicious/sample_11_37.ps1 | sample_11_37.ps1 | Add-AppxPackage
exit
cd C:\Users\sampler-win_10_x64\Desktop\
Get-AppxPackage >apps.tx
cd C:\Users\sampler-win_10_x64\Desktop\
Get-AppxPackage -allusers | Select Name, PackageFullName > apps_v2.txt
Get-AppxPackage | Select Name, PackageFullName > apps_v2.txt
Get-AppxPackage
Get-AppxPackage -Online
Get-AppxPacka... |
combined_dataset/train/non-malicious/sample_8_36.ps1 | sample_8_36.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 = '93.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_57_59.ps1 | sample_57_59.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
##
## TODO: Refactor the cer... |
combined_dataset/train/non-malicious/num.ps1 | num.ps1 | ## SVN STAT colorizer - http://www.overset.com/2008/11/18/colorized-subversion-svn-stat-powershell-function/
function ss () {
$c = @{ "A"="Magenta"; "D"="Red"; "C"="Yellow"; "G"="Blue"; "M"="Cyan"; "U"="Green"; "?"="DarkGray"; "!"="DarkRed" }
foreach ( $svno in svn stat ) {
if ( $c.ContainsKey($svno.ToString(... |
combined_dataset/train/non-malicious/sample_29_74.ps1 | sample_29_74.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmcontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmcontrolplane.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_43_2.ps1 | sample_43_2.ps1 | <#
Small portable lightweight/standalone functions that are required to be called as signed local modules
for the purpose of satisfying the Constraint Language Mode.
#>
function Get-SslCertificateChain
{
<#
.SYNOPSIS
Retrieve remote ssl certificate & chain from https endpoint for Deskt... |
combined_dataset/train/non-malicious/e0d5c1ac-138e-4921-8f14-f59a45084096.ps1 | e0d5c1ac-138e-4921-8f14-f59a45084096.ps1 | [string]$entry = $args[0]
if ($entry -eq $null) { [string]$entry = Read-Host -Prompt "Enter Computer Name" }
$Computers = Get-QADComputer $entry
$Computers | ForEach-Object {Get-WmiObject Win32_Registry -ComputerName $_.Name | Select-Object @{Name="Name";Expression={$_.__SERVER}},CurrentSize,MaximumSize,Caption}... |
combined_dataset/train/non-malicious/WSUS Admin Module_1.ps1 | WSUS Admin Module_1.ps1 | Write-Host "`n"
Write-Host "`t`tWSUS Administrator Module 1.0"
Write-Host "`n"
Write-Host -nonewline "Make initial connection to WSUS Server:`t"
Write-Host -fore Yellow "Connect-WSUSServer"
Write-Host -nonewline "Disconnect from WSUS Server:`t`t"
Write-Host -fore Yellow "Disconnect-WSUSServer"
Write-Host ... |
combined_dataset/train/non-malicious/292.ps1 | 292.ps1 | function Test-PSFTaskEngineTask
{
[OutputType([System.Boolean])]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Test-PSFTaskEngineTask')]
Param (
[Parameter(Mandatory = $true)]
[string]
$Name
)
if (-not ([PSFramework.TaskEngine.TaskHost]::Tasks.ContainsKey($Name.ToLo... |
combined_dataset/train/non-malicious/sample_61_17.ps1 | sample_61_17.ps1 | <# Script name: tss_WorkFoldersDiag.ps1
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# THIS SAMPLE CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
# WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FO... |
combined_dataset/train/non-malicious/sample_56_99.ps1 | sample_56_99.ps1 | "use strict";
/*
Copyright 2023 The Sigstore Authors.
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to ... |
combined_dataset/train/non-malicious/sample_46_48.ps1 | sample_46_48.ps1 | # Copyright (c) Microsoft Corporation.
#
# This script will
# 1. Examine Azcmagent configuration
# 2. Check if automatic upgrade is enabled
# 3. Check if desired version is greater than existing agent version
# 4. Check if automatic upgrade has already been attempted before
# 5. Get the download l... |
combined_dataset/train/non-malicious/sample_38_90.ps1 | sample_38_90.ps1 | # Copyright (C) Intel Corporation, 2021 All Rights Reserved.
function Invoke-DisableTLSAuthentication
{
<#
.Synopsis
Disables the TLS connection in AMT.
.Description
This cmdlet disables the TLS connection in AMT. (server or mutual)
.Notes
AMT Provisioning:
The vPro client AMT ... |
combined_dataset/train/non-malicious/sample_61_50.ps1 | sample_61_50.ps1 | function Invoke-TestRunnerService {
param (
[Parameter(Mandatory = $false)]
[string]$FileName = '',
[Parameter(Mandatory = $false)]
[int]$SelectionStart = 0,
[Parameter(Mandatory = $false)]
[switch]$Init
)
$Credential = Get-ALTestRunnerCredential
if ... |
combined_dataset/train/non-malicious/sample_36_52.ps1 | sample_36_52.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.Synopsis
Registers or unregisters the PowerShell ETW manifest
.Parameter Path
The fully qualified path to the PowerShell.Core.Instrumentation.man manifest file.
The default value is the location of this script.
.Paramet... |
combined_dataset/train/non-malicious/sample_61_96.ps1 | sample_61_96.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeai'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeai.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_8_74.ps1 | sample_8_74.ps1 | #************************************************
# DC_P2P-Component.ps1
# Version 1.0
# Date: 2009-2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about P2P.
# Called from: Main Networking Diag
#*******************************************************
Trap [Exception]
... |
combined_dataset/train/non-malicious/4441.ps1 | 4441.ps1 | function Uninstall-Package
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$fastPackageReference
)
Write-Debug -Message ($LocalizedData.ProviderApiDebugMessage -f ('Uninstall-Package'))
Write-Debug -Message ($Localize... |
combined_dataset/train/non-malicious/668.ps1 | 668.ps1 |
$reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl }
Describe "Get-RsItemDataSource" {
$rsFolderPath = ''
$datasourcesReportPath = ''
$noDatasourcesReportPath = ''
BeforeEach {
$folderName = 'SUT_OutRsRestCatalogI... |
combined_dataset/train/non-malicious/3086.ps1 | 3086.ps1 | $VerbosePreference = 'Continue'
$ErrorActionPreference = 'Stop'
try {
$baseDir = $PSScriptRoot
$buildDir = "$baseDir\build\nuget"
$nugetExe = "$baseDir\vendor\tools\nuget.exe"
$targetBase = "tools"
Write-Verbose "Running in $baseDir"
Write-Verbose "Building to $buildDir"
$version = git.ex... |
combined_dataset/train/non-malicious/sample_10_16.ps1 | sample_10_16.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\esbuild@0.19.12\node_modules\esbuild\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\esbuild... |
combined_dataset/train/non-malicious/sample_33_57.ps1 | sample_33_57.ps1 | Import-Module $PSScriptRoot\AzStackHci.Ports.Helpers.psm1 -Force -DisableNameChecking -Global
Import-Module $PSScriptRoot\..\AzStackHci.EnvironmentChecker.Utilities.psm1 -Force -DisableNameChecking -Global
Import-Module $PSScriptRoot\..\AzStackHci.EnvironmentChecker.Reporting.psm1 -Force -DisableNameChecking -Global
... |
combined_dataset/train/non-malicious/Get-ChildItemColor_1.ps1 | Get-ChildItemColor_1.ps1 | function Get-ChildItemColor {
<#
.Synopsis
Returns childitems with colors by type.
.Description
This function wraps Get-ChildItem and tries to output the results
color-coded by type:
Compressed - Yellow
Directories - Dark Cyan
Executables - Green
Text Files - Cyan
Others - Default
.ReturnVal... |
combined_dataset/train/non-malicious/Asp_1.net-Using httpConext.ps1 | Asp_1.net-Using httpConext.ps1 | Default.aspx
----------------
Partial Class _Default
Inherits System.Web.UI.Page
Dim var1 As String
Dim var2 As String
Protected Sub lnk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnk.Click
Context.Items("Nome") = var1
Context.Items("Email") = var2
Server.Transfer("pagina3.as... |
combined_dataset/train/non-malicious/sample_63_79.ps1 | sample_63_79.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(Manda... |
combined_dataset/train/non-malicious/sample_33_48.ps1 | sample_33_48.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'ht... |
combined_dataset/train/non-malicious/sample_5_85.ps1 | sample_5_85.ps1 | <#
.SYNOPSIS
This module is part of TSS FW and implements support for tracing Container scenarios
.DESCRIPTION
This module is part of TSS FW and implements support for tracing Container scenarios
.NOTES
Dev. Lead: wiaftrin, milanmil
Authors : wiaftrin, milanmil
Requires : PowerShell V4(Supported f... |
combined_dataset/train/non-malicious/sample_55_19.ps1 | sample_55_19.ps1 | #
# Module manifest for module 'OCI.PSModules.Core'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Core.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_60_57.ps1 | sample_60_57.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.3.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_7_30.ps1 | sample_7_30.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', 'New-Al... |
combined_dataset/train/non-malicious/1918.ps1 | 1918.ps1 |
Function GetFileMock () {
$objs = @( [pscustomobject]@{ Size=4533816; Mode="-a---l"; LastWriteTime="9/1/2015 11:15 PM"; Name="explorer.exe" },
[pscustomobject]@{ Size=994816; Mode="-a---l"; LastWriteTime="9/1/2015 11:13 PM"; Name="HelpPane.exe" },
[pscustomobject]@{ Size=316640; Mode="-a---l";... |
combined_dataset/train/non-malicious/1245.ps1 | 1245.ps1 |
if( $exportIisFunctions )
{
Write-Timing ('Dot-sourcing IIS functions.')
Get-ChildItem -Path $functionRoot -Filter '*Iis*.ps1' |
ForEach-Object { . $_.FullName }
if( -not (Test-CTypeDataMember -TypeName 'Microsoft.Web.Administration.Site' -MemberName 'PhysicalPath') )
{
Write-T... |
combined_dataset/train/non-malicious/sample_4_45.ps1 | sample_4_45.ps1 | ConvertFrom-StringData @'
id_ctsdnsserver=DNS Server
id_ctsdnsserverdescription=Collects information about DNS Server.
'@
# SIG # Begin signature block
# MIIoOAYJKoZIhvcNAQcCoIIoKTCCKCUCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAI... |
combined_dataset/train/non-malicious/sample_27_72.ps1 | sample_27_72.ps1 | #
# Script module for module 'Az.Dns' that is executed when 'Az.Dns' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:41
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
if ((Ge... |
combined_dataset/train/non-malicious/Get-InstalledProgram_v4.ps1 | Get-InstalledProgram_v4.ps1 | param (
[String[]]$Computer,
$User
)
#############################################################################################
if ($User) {$Connection = Get-Credential -Credential $User}
#############################################################################################
if (!$Connection){
foreach... |
combined_dataset/train/non-malicious/sample_5_43.ps1 | sample_5_43.ps1 | #************************************************
# DC_DFSClient-Component.ps1
# Version 1.0
# Date: 2009-2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about DFS Client.
# Called from: Main Networking Diag, WebClient Interactive Diag, and others.
#************************... |
combined_dataset/train/non-malicious/sample_57_77.ps1 | sample_57_77.ps1 | [cmdletbinding()]
param([string]$targetBinary, [string]$installedDir, [string]$tlogFile, [string]$copiedFilesLog)
$g_searched = @{}
# Note: installedDir is actually the bin\ directory.
$g_install_root = Split-Path $installedDir -parent
$g_is_debug = (Split-Path $g_install_root -leaf) -eq 'debug'
# Ensure we create th... |
combined_dataset/train/non-malicious/sample_10_72.ps1 | sample_10_72.ps1 | #************************************************
# TS_2K3ProcessorAffinityMaskCheck.ps1
# Version 1.0.1
# Date: 5/16/2012
# Author: v-kaw
# Description: [Idea ID 2346] [Windows] high cpu only on one processor
# Rule number: 2346
# Rule URL: //sharepoint/sites/rules/Rule%20Submissions/Forms/DispForm.aspx?ID=2... |
combined_dataset/train/non-malicious/hex2dec.ps1 | hex2dec.ps1 | @echo off
::unequal symbols
for %%i in ("!", "x") do if "%1" equ "%%~i" goto:error
::display help information args
for %%i in ("-h", "/h", "-help", "/help") do (
if "%1" equ "%%~i" goto:help
)
if "%1" equ "-?" goto:help
if "%1" equ "/?" goto:help
::interactive mode
if "%1" equ "" (
if not defi... |
combined_dataset/train/non-malicious/3939.ps1 | 3939.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.","") ... |
combined_dataset/train/non-malicious/PowerBot _1.0.ps1 | PowerBot _1.0.ps1 | ## This script requires ...\\WindowsPowerShell\\Libraries\\Meebey.SmartIrc4net.dll
## You can get Meebey.SmartIrc4net.dll from
## http://voxel.dl.sourceforge.net/sourceforge/smartirc4net/SmartIrc4net-0.4.0.bin.tar.bz2
## And the docs are at http://smartirc4net.meebey.net/docs/0.4.0/html/
##########################... |
combined_dataset/train/non-malicious/sample_62_75.ps1 | sample_62_75.ps1 | #
# Module manifest for module 'OCI.PSModules.Common'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Common.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/Format-String.ps1 | Format-String.ps1 | ##############################################################################\n##\n## Format-String\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\nReplaces t... |
combined_dataset/train/non-malicious/Test-TCPPort_1.ps1 | Test-TCPPort_1.ps1 | function Test-TCPPort {
param (
[parameter(Mandatory=$true)]
[string] $ComputerName,
[parameter(Mandatory=$true)]
[string] $Port
)
try {
$TimeOut = 5000
$IsConnected = $false
$Addresses = [System.Net.Dns]::GetHostAddresses($ComputerName) | ? {$_.AddressFamily -eq 'InterNetwork'}
$Ad... |
combined_dataset/train/non-malicious/1343.ps1 | 1343.ps1 |
function Get-CServicePermission
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[string]
$Identity
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionConte... |
combined_dataset/train/non-malicious/sample_6_7.ps1 | sample_6_7.ps1 | #************************************************
# DC_ProxyConfiguration.ps1
# Version 1.0: Proxy Configuration for IE User, WinHTTP, Firewall Client, PAC Files, Network Isolation
# Version 1.1: Added Proxy Configuration for IE System
# Version 1.2 (4/28/14): Edited table of contents.
# Create date: 12/5/2012
#... |
combined_dataset/train/non-malicious/4120.ps1 | 4120.ps1 |
Set-Variable -Name Body -Force
Set-Variable -Name EmailAddress -Force
Set-Variable -Name EmailAddresses -Force
Set-Variable -Name Exclusions -Force
Set-Variable -Name LocalAdmin -Force
Set-Variable -Name LocalAdmins -Force
Set-Variable -Name LogFile -Value $env:windir"\Logs\LocalAdministrators.log" -Force
Set-Variab... |
combined_dataset/train/non-malicious/sample_6_85.ps1 | sample_6_85.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 = '92.1.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/Create SP2010 Farm V_2.ps1 | Create SP2010 Farm V_2.ps1 | ############################################################################
## Create-SPFarm
## V 0.3
## Jos.Verlinde
############################################################################
Param ( [String] $Farm = "SP2010",
[String] $SQLServer = $env:COMPUTERNAME,
[String] $Passphrase = "pass@word1"... |
combined_dataset/train/non-malicious/Pause-Script & Out-More.ps1 | Pause-Script & Out-More.ps1 | # Pause-Script
#
# Pauses execution until a key is pressed.
function Pause-Script {
param([string]$message = 'Press any key to continue...')
Write-Host -NoNewLine $message
$null = $Host.UI.RawUI.ReadKey("NoEcho, IncludeKeyDown")
Write-Host ""
}
# Out-More
#
# Displays one window's worth of data... |
combined_dataset/train/non-malicious/1650.ps1 | 1650.ps1 |
function Set-Wallpaper {
param (
[string]$Path,
[ValidateSet('Tile', 'Center', 'Stretch', 'Fill', 'Fit', 'Span')]
[string]$Style = 'Fill'
)
begin {
Add-Type @"
using System;
using System.Runtime.InteropServices;
using Microsoft.Win32;
... |
combined_dataset/train/non-malicious/Logger.psm1 0.5.ps1 | Logger.psm1 0.5.ps1 | <#
Name : Universal NLog Logging Module (NLog.psm1)
Version : 0.5
Author : Joel Bennett (MVP)
Site : http://www.HuddledMasses.org/
Version History:
0.5 - Port to NLog from Log4Net ( http://nlog-project.org )
Include support for Growl plugin for NLog, but left out the rotat... |
combined_dataset/train/non-malicious/3722.ps1 | 3722.ps1 |
function Test-DataLakeStoreTrustedIdProvider
{
param
(
$location
)
if ([string]::IsNullOrEmpty($location))
{
$location = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
}
try
{
$resourceGroupName = Ge... |
combined_dataset/train/non-malicious/5f5f41e1-5b7f-46e6-a165-083c18a8ea02.ps1 | 5f5f41e1-5b7f-46e6-a165-083c18a8ea02.ps1 | function Run-Query($siteUrl, $queryText)
{
[reflection.assembly]::loadwithpartialname("microsoft.sharePOint") | out-null
[reflection.assembly]::loadwithpartialname("microsoft.office.server") | out-null
[reflection.assembly]::loadwithpartialname("microsoft.office.server.search") | out-null
$s = [microsoft.share... |
combined_dataset/train/non-malicious/3970.ps1 | 3970.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/sample_55_35.ps1 | sample_55_35.ps1 | #
# Module manifest for module 'OCI.PSModules.Common'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Common.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_1_8.ps1 | sample_1_8.ps1 | 2160
[[["Fer","0","100ms"],[10800025,6]],[["Fer","0","1s"],[10800025,6]],[["Fer","0","Inst"],[10800025,6]],[["Fer","1-9","100ms"],[0,6]],[["Fer","1-9","1s"],[0,6]],[["Fer","1-9","Inst"],[0,6]],[["Fer","10-19","100ms"],[0,6]],[["Fer","10-19","1s"],[0,6]],[["Fer","10-19","Inst"],[0,6]],[["Fer","100","100ms"],[0,6]],[["Fe... |
combined_dataset/train/non-malicious/ConvertFrom-CliXml_1.ps1 | ConvertFrom-CliXml_1.ps1 |
function ConvertFrom-CliXml {
param(
[Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]
[ValidateNotNullOrEmpty()]
[String[]]$InputObject
)
begin
{
$OFS = "`n"
[String]$xmlString = ""
}
process
{
$xmlString += $InputObje... |
combined_dataset/train/non-malicious/Create SP2010 Farm V_1.ps1 | Create SP2010 Farm V_1.ps1 | ############################################################################
## Create-SPFarm
## V 0.3
## Jos.Verlinde
############################################################################
Param ( [String] $Farm = "SP2010",
[String] $SQLServer = $env:COMPUTERNAME,
[String] $Passphrase = "pass@word1"... |
combined_dataset/train/non-malicious/1030.ps1 | 1030.ps1 |
$clusterloc="SouthCentralUS"
$groupname="mysfclustergroup"
$clustername = "mysfcluster"
$vaultname = "mykeyvault"
$subname="$clustername.$clusterloc.cloudapp.azure.com"
$subscriptionID = 'subscription ID'
Connect-AzAccount
Get-AzSubscription -SubscriptionId $subscriptionID | Select-AzSubscription
$appcertpwd = Co... |
combined_dataset/train/non-malicious/4366.ps1 | 4366.ps1 | function Set-PSGetSettingsVariable
{
[CmdletBinding()]
param([switch]$Force)
if(-not $script:PSGetSettings -or $Force)
{
if(Microsoft.PowerShell.Management\Test-Path -Path $script:PSGetSettingsFilePath)
{
$script:PSGetSettings = DeSerialize-PSObject -Path $script:PSGetSettin... |
combined_dataset/train/non-malicious/Get-WootDeal.ps1 | Get-WootDeal.ps1 | <#
.Synopsis
Gets the daily woot deal from woot.com.
.Description
Gets product description and price of the daily woot deal from the woot.com website.
.Outputs
Custom object containing two (2) NoteProperties: Product and Price.
.Parameter URL
... |
combined_dataset/train/non-malicious/FTP Upload Dir Tree.ps1 | FTP Upload Dir Tree.ps1 | function upload-directory {
param( [string] $server = $( Throw "You must specify an FTP server to logon to."),
[string] $dir = $( Throw "You must specify a local directory to upload (ie, C:\\Testing\\FTPTest\\)"),
[switch] $overwrite = $false,
[System.Management.Automation.PSCredential] $cred = $( Throw "Yo... |
combined_dataset/train/non-malicious/sample_57_21.ps1 | sample_57_21.ps1 | $ServerCertificateName = "CN=ServiceFabricServerCert"
$ClientCertificateName = "CN=ServiceFabricClientCert"
function IsSecurityX509([string]$ClusterConfigFilePath)
{
$jsonConfig = Get-Content $ClusterConfigFilePath -Raw | ConvertFrom-Json
$properties = $jsonConfig.properties
if ($properties -ne $Nul... |
combined_dataset/train/non-malicious/2679.ps1 | 2679.ps1 |
if (-not (Get-Module -ListAvailable -Name SharePointPnPPowerShellOnline))
{
Install-Module SharePointPnPPowerShellOnline
}
Import-Module SharePointPnPPowerShellOnline
$csvConfig = $null
$credentials = $null
$winCredentialsManagerLabel = "SPFX"
try
{
$csvConfig = Import-Csv -Path "./CreateSit... |
combined_dataset/train/non-malicious/1770.ps1 | 1770.ps1 |
try {
$defaultParamValues = $PSdefaultParameterValues.Clone()
$PSDefaultParameterValues["it:skip"] = !$IsWindows
$script:catalogPath = ""
Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
function CompareHashTables
{
param
(
$hashT... |
combined_dataset/train/non-malicious/Shift Operators.ps1 | Shift Operators.ps1 | #requires -version 2.0 ## for v1 you need to change Add-Type to "New-Type":http://poshcode.org/720
Add-Type @"
public class Shift {
public static int Left(int x, int count) { return x >> count; }
public static uint Left(uint x, int count) { return x >> count; }
public static long Left(long x, ... |
combined_dataset/train/non-malicious/sample_62_93.ps1 | sample_62_93.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="$basedir\..\..\..\..\..\acorn@8.11.3\node_modules"
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
... |
combined_dataset/train/non-malicious/sample_4_51.ps1 | sample_4_51.ps1 | #************************************************
#Last Updated Date: 05-24-2012
#Updated By: Alec Yao v-alyao@microsoft.com
#Description: Add two arguments for the script, called $Prefix and $Suffix. It will allow to custermize the filename
#************************************************
PARAM ($NFO = $true... |
combined_dataset/train/non-malicious/sample_21_4.ps1 | sample_21_4.ps1 | #Collect files for VSSBackup package
Import-LocalizedData -BindingVariable VSSBackupFilesStrings
Write-DiagProgress -Activity $VSSBackupFilesStrings.ID_VSSBackupPkgFiles -Status $VSSBackupFilesStrings.ID_VSSBackupPkgFilesObtaining
$filesToCollect = "$Env:windir\Logs\WindowsServerBackup\*.*"
$filesDescription... |
combined_dataset/train/non-malicious/4205.ps1 | 4205.ps1 |
[CmdletBinding()]
param
(
[String]$ComputerName,
[switch]$Rawdata,
[ValidateNotNullOrEmpty()][string]$Username
)
function Get-FilteredData {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()]$LogonType,
[ValidateNotNullOrEmpty()][string]$Message,
[ValidateNotNullOrEmpty()]$Logons
)
$Errors = $fal... |
combined_dataset/train/non-malicious/2084.ps1 | 2084.ps1 |
Describe 'Classes inheritance syntax' -Tags "CI" {
It 'Base types' {
class C1 {}
class C2a : C1 {}
class C2b:C1 {}
[C2a]::new().GetType().BaseType.Name | Should -Be "C1"
[C2b].BaseType.Name | Should -Be "C1"
}
It 'inheritance from abstract base class with no abs... |
combined_dataset/train/non-malicious/2706.ps1 | 2706.ps1 | function Get-LibSymbols
{
[CmdletBinding()] Param (
[Parameter(Position = 0, Mandatory = $True, ValueFromPipelineByPropertyName = $True)]
[ValidateScript({ Test-Path $_ })]
[Alias('FullName')]
[String[]]
$Path
)
BEGIN
{
$Code = @'
using System;
... |
combined_dataset/train/non-malicious/sample_67_39.ps1 | sample_67_39.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_38_75.ps1 | sample_38_75.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/Get-Constructor.ps1 | Get-Constructor.ps1 | # Eg: Get-Constructor System.IO.StreamReader
function Get-Constructor {
Param([Type]$type)
$OFS = ", "
$Type.GetConstructors("Public,Instance,Static") |
ForEach-Object { "{0}( {1} )" -f $_.DeclaringType, "$($_.GetParameters() | %{ $_.ParameterType })" }
}
|
combined_dataset/train/non-malicious/2442.ps1 | 2442.ps1 | function Remove-OnlineVM
{
[CmdletBinding(SupportsShouldProcess)]
param
(
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[Microsoft.HyperV.PowerShell.VirtualMachine[]]$VM,
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
[Alias('ComputerName'... |
combined_dataset/train/non-malicious/chkhash_22.ps1 | chkhash_22.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... |
combined_dataset/train/non-malicious/sample_60_69.ps1 | sample_60_69.ps1 | #
# Module manifest for module 'OCI.PSModules.Autoscaling'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Autoscaling.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/ConvertTo-Icon.ps1 | ConvertTo-Icon.ps1 | [Reflection.Assembly]::LoadWithPartialName("System.Drawing") | Out-Null
#Version History
#v1.0 - Chad Miller - Initial release
#Converts Image Files to icon files
#Adapted from WinForm C# code by Haresh Ambaliya
#http://code.msdn.microsoft.com/Convert-Image-file-to-Icon-c927d9f7
function ConvertTo-Icon
{... |
combined_dataset/train/non-malicious/sample_65_15.ps1 | sample_65_15.ps1 | <#'/* DELL PROPRIETARY INFORMATION
'*
'* This software contains the intellectual property of Dell Inc. Use of this software and the intellectual property
'* contained therein is expressly limited to the terms and conditions of the License Agreement under which it is
'* provided by or on behalf of Dell Inc. or its s... |
combined_dataset/train/non-malicious/sample_43_25.ps1 | sample_43_25.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_63_57.ps1 | sample_63_57.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(Manda... |
combined_dataset/train/non-malicious/sample_50_79.ps1 | sample_50_79.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicemanagerproxy'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicemanagerproxy.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Sup... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.