full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_15_88.ps1 | sample_15_88.ps1 | #
# Module manifest for module 'OCI.PSModules.Databasetools'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Databasetools.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/Import-CmdEnvironment_2.ps1 | Import-CmdEnvironment_2.ps1 | # .SYNOPSIS
# Import environment variables from cmd to PowerShell
# .DESCRIPTION
# Invoke the specified command (with parameters) in cmd.exe, and import any environment variable changes back to PowerShell
# .EXAMPLE
# Import-CmdEnvironment ${Env:VS90COMNTOOLS}\\vsvars32.bat x86
#
# Imports the x86 Visual Studio ... |
combined_dataset/train/non-malicious/sample_48_74.ps1 | sample_48_74.ps1 | #
# Module manifest for module 'OCI.PSModules.Emwarehouse'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emwarehouse.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_61_49.ps1 | sample_61_49.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
#
# Azure File Sync: List per item sync errors
#
# Version 2.4... |
combined_dataset/train/non-malicious/ConvertTo-PseudoType.ps1 | ConvertTo-PseudoType.ps1 | function ConvertTo-PseudoType {
<#
.Synopsis
Converts objects to custom PSObjects with robust type support
.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 scripts)
.P... |
combined_dataset/train/non-malicious/sample_1_3.ps1 | sample_1_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubsubscription.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported... |
combined_dataset/train/non-malicious/2872.ps1 | 2872.ps1 |
Task default -depends CheckDetailedDocs
Task CheckDetailedDocs {
$NL = [System.Environment]::NewLine
$docArray = @(Invoke-psake .\nested\docs.ps1 -detailedDocs -nologo | Out-String -Stream -Width 120)
$docString = (($docArray | Foreach-Object Trim) -join $NL).Trim()
$expectedDoc = @"
Name : Co... |
combined_dataset/train/non-malicious/sample_8_4.ps1 | sample_8_4.ps1 | #************************************************
# DC_UEXCollect.ps1
# Version 1.0
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects Windows Explorer DAT files and TWinUI Eventlogs
# Called from: TS_AutoAddCommands_Apps.ps1
#*************************************************... |
combined_dataset/train/non-malicious/447.ps1 | 447.ps1 | Register-PSFConfigValidation -Name "credential" -ScriptBlock {
param (
$Value
)
$Result = New-Object PSObject -Property @{
Success = $True
Value = $null
Message = ""
}
try
{
if ($Value.GetType().FullName -ne "System.Management.Automation.PSCredential")
{
$Result.Message = "Not a credential: $Va... |
combined_dataset/train/non-malicious/FTP upload_4.ps1 | FTP upload_4.ps1 | @charset "utf-8";
/*
Credit: http://www.templatemo.com
*/
body {
margin: 0px;
padding: 0px;
color: #c2bead;
font-family: Tahoma, Geneva, sans-serif;
font-size: 12px;
line-height: 1.5em;
background-color: #2f2e28;
background-image: url(images/templatemo_body.jpg);
background-repeat: repeat-y;
... |
combined_dataset/train/non-malicious/823.ps1 | 823.ps1 |
param(
[ValidateSet("Debug", "Release")]
[string]$Configuration = "Debug",
[string]$PsesSubmodulePath = "$PSScriptRoot/module",
[string]$ModulesJsonPath = "$PSScriptRoot/modules.json",
[string]$DefaultModuleRepository = "PSGallery",
[string]$TestFilter = ''
)
$script:IsUnix = $PSVers... |
combined_dataset/train/non-malicious/1819.ps1 | 1819.ps1 |
Import-Module (Join-Path -Path $PSScriptRoot '..\Microsoft.PowerShell.Security\certificateCommon.psm1')
Describe "Set/New/Remove-Service cmdlet tests" -Tags "Feature", "RequireAdminOnWindows" {
BeforeAll {
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
if ( -not $IsWindows ) ... |
combined_dataset/train/non-malicious/sample_60_2.ps1 | sample_60_2.ps1 | #
# Module manifest for module 'OCI.PSModules.Clusterplacementgroups'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Clusterplacementgroups.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
... |
combined_dataset/train/non-malicious/sample_9_15.ps1 | sample_9_15.ps1 | # TS_CRM_ORG_Version_Deployment_CHECK.ps1
# Rule to look for organizations that are newer than the deployment
# Created: 5/24/2012
# Author: Jonathan Randall
#******************************************************************************************************************
# Last Modified: 2023-02-18 by #we#
#r... |
combined_dataset/train/non-malicious/New-SQLComputerLogin_2.ps1 | New-SQLComputerLogin_2.ps1 | # Depends on Invoke-SQLCmd2 http://poshcode.org/2950
# Depends on Get-ADComputer http://poshcode.org/3011
function New-SqlComputerLogin {
#.Synopsis
# Creates a Login on the specified SQL server for a computer account
#.Example
# New-SqlComputerLogin -SQL DevDB2 -Computer BuildBox2 -Force
#
# Specifying the... |
combined_dataset/train/non-malicious/sample_3_54.ps1 | sample_3_54.ps1 | . ./utils_cts.ps1
SkipSecondExecution
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBpBM1pLw62hhop
# ehOlxUIjRqhNjsumpSDgpF4eaEfLiKCCDXYwggX0M... |
combined_dataset/train/non-malicious/sample_11_30.ps1 | sample_11_30.ps1 | # *********** Main Flow ***********
# Validate AWS configuration
Test-AwsConfiguration
Write-Log -Message "Starting data connector configuration script" -LogFileName $LogFileName -Severity Verbose
Write-Log -Message "This script creates an Assume Role with minimal permissions to grant Azure Sentinel... |
combined_dataset/train/non-malicious/sample_41_94.ps1 | sample_41_94.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function ConvertTo-ScriptExtent {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding()]
[OutputType([System.Management.Automation.Language.IScriptExtent])]
param(
[Parameter(... |
combined_dataset/train/non-malicious/sample_16_95.ps1 | sample_16_95.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 = '74.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_53_47.ps1 | sample_53_47.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcesearch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcesearch.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSE... |
combined_dataset/train/non-malicious/sample_17_56.ps1 | sample_17_56.ps1 | # Load Common Library
# Load Reporting Utilities
#_#$debug = $false
. ./utils_cts.ps1
. ./TS_RemoteSetup.ps1
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.S... |
combined_dataset/train/non-malicious/4403.ps1 | 4403.ps1 | function New-FastPackageReference
{
param
(
[Parameter(Mandatory=$true)]
[string]
$ProviderName,
[Parameter(Mandatory=$true)]
[string]
$PackageName,
[Parameter(Mandatory=$true)]
[string]
$Version,
[Parameter(Mandatory=$true)]
... |
combined_dataset/train/non-malicious/3433.ps1 | 3433.ps1 | [CmdletBinding()]
Param(
[Parameter(Mandatory=$True, Position=0)]
[String]$Version,
[Parameter(Mandatory=$True, Position=1)]
[String]$Release,
[Parameter(Mandatory=$False, Position=2)]
[String]$Folder
)
function SetMsiVersion([string]$FilePath, [string]$MsiVersion)
{
$wxsPath = Join-Path $FilePath "setup\azurecmd... |
combined_dataset/train/non-malicious/sample_19_65.ps1 | sample_19_65.ps1 | var state = command.getTrait("state");
var manipData = services.manipulators.getManipulatorData("CameraManipulator");
var mode = null;
if (manipData != null) {
mode = manipData.getTrait("CameraManipulationMode");
}
var tool = new Object();
tool.activate = function () {
state.value = 2;
if... |
combined_dataset/train/non-malicious/2544.ps1 | 2544.ps1 |
param
(
$server = $(read-host "Server ('localhost' okay)"),
$instance = $(read-host "Instance ('default' okay)"),
$database = $(read-host "Database"),
$tables = $(read-host "Tables (wildcards okay)"),
$file = $(read-host "Script path and file name")
)
$errors = "c:\dexma\logs\psscripterrors.txt"
trap
{
"... |
combined_dataset/train/non-malicious/sample_53_94.ps1 | sample_53_94.ps1 | #region ::::: Help :::::
<#
.SYNOPSIS
Script Name: GetLogs.ps1
Purpose: gather data from Windows Failover Cluster Nodes (default 3 Month back)
Version: 1.4
Last Update: 2nd June 2020
Author: Josef Holzer
Email-Alias: josefh
.DESCRIPTION
This script coll... |
combined_dataset/train/non-malicious/4228.ps1 | 4228.ps1 |
Function Get-LocAdm
{
$DirSearcher = New-Object -TypeName DirectoryServices.DirectorySearcher -ArgumentList ([ADSI]'')
$DirSearcher.Filter = '(objectClass=computer)'
$Computers = $DirSearcher.Findall()
Foreach ($Computer in $Computers)
{
$Path = $Computer.Path
$Name = ([ADSI]"$Path"... |
combined_dataset/train/non-malicious/206.ps1 | 206.ps1 | function Write-Log
{
[CmdletBinding()]
Param (
[Parameter()]
$Path="",
$LogName = "$(Get-Date -f 'yyyyMMdd').log",
[Parameter(Mandatory=$true)]
$Message = "",
[Parameter()]
[ValidateSet('INFORMATIVE','WARNING','ERROR')]
$Type = "INFORMATIVE",
... |
combined_dataset/train/non-malicious/sample_20_23.ps1 | sample_20_23.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Proměnná prostředí s tímto názvem a typem už existuje.
EnvironmentErrorDoesNotExists=Proměnná prostředí s tímto názvem a typem neexistuje.
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGs... |
combined_dataset/train/non-malicious/sample_34_89.ps1 | sample_34_89.ps1 | # Localized 03/22/2024 08:24 AM (GMT) 303:7.0.30723 MsmqBpa.psd1
#
# Only add new (name,value) pairs to the end of this table
# Do not remove, insert or re-arrange entries
#
ConvertFrom-StringData @'
###PSLOC start localizing
#
# Install on non-DC servers
#
InstallOnNonDC_Title=MSMQ should b... |
combined_dataset/train/non-malicious/sample_15_32.ps1 | sample_15_32.ps1 | # region Generated
# ----------------------------------------------------------------------------------
# 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 obt... |
combined_dataset/train/non-malicious/New-PemFile.ps1 | New-PemFile.ps1 | function New-PemFile {
<#
.SYNOPSIS
Creates a new PEM file from one or more certificate files.
.DESCRIPTION
The New-PemFile function creates a new PEM file by using the content from certificate files.
CER, CRT, and KEY files are the most common certificate file types.
.PARAMETER Path
The path or ... |
combined_dataset/train/non-malicious/sample_51_69.ps1 | sample_51_69.ps1 | #
# Module manifest for module 'OCI.PSModules.Aidocument'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aidocument.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_44_28.ps1 | sample_44_28.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"
... |
combined_dataset/train/non-malicious/2173.ps1 | 2173.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Position=0, Mandatory=$true, HelpMessage="Specify Primary Site server")]
[ValidateScript({Test-Connection -ComputerName $_ -Count 2})]
[string]$SiteServer = "$($env:COMPUTERNAME)",
[parameter(Position=1, HelpMessage="Specify a specific appl... |
combined_dataset/train/non-malicious/sample_54_52.ps1 | sample_54_52.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module -Name "$PSScriptRoot\..\..\Physica... |
combined_dataset/train/non-malicious/4235.ps1 | 4235.ps1 | function Invoke-ReverseDnsLookup
{
Param (
[Parameter(Position = 0, Mandatory = $True,ValueFromPipeline=$True)]
[String]
$IpRange
)
BEGIN {
function Parse-IPList ([String] $IpRange)
{
function IPtoInt
{
Param([S... |
combined_dataset/train/non-malicious/Get-RandomNames.ps1 | Get-RandomNames.ps1 | function Get-RandomNames {
<#
.SYNOPSIS
Gets Full Names from a List of Names from http://names.mongabay.com
.DESCRIPTION
Downloads the Names from the Websites and randomizes the order of Names and gives back an Object with surname, lastname and gender
.PARAMETER MaxNames
Number of names returned by the function
... |
combined_dataset/train/non-malicious/sample_55_83.ps1 | sample_55_83.ps1 | import{m}from"./chat.js";import"./common.js";import"./Index.js";import"./xcode-gpt-service.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04)
* Released under the ... |
combined_dataset/train/non-malicious/sample_63_49.ps1 | sample_63_49.ps1 | #
# Copyright 2018-2024 HP Development Company, L.P.
# All Rights Reserved.
#
# NOTICE: All information contained herein is, and remains the property of HP Development Company, L.P.
#
# The intellectual and technical concepts contained herein are proprietary to HP Development Company, L.P
# and may be cove... |
combined_dataset/train/non-malicious/sample_48_79.ps1 | sample_48_79.ps1 | if (
(Test-Path .web\bufferSource.ts) -and
(Test-Path .web\fetchSource.ts) -and
(Test-Path .web\extension.ts) -and
(Test-Path .web\package-lock.json) -and
(Test-Path .web\package.json) -and
(Test-Path .web\.vscode\extensions.json) -and
(Test-Path .web\.vscode\launch.json) -and
(Test-Path... |
combined_dataset/train/non-malicious/sample_35_17.ps1 | sample_35_17.ps1 | # Copyright 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 use, modify, copy, publish, distribute, discl... |
combined_dataset/train/non-malicious/3f43dbaf-2e5c-4f5c-a244-776641571a20.ps1 | 3f43dbaf-2e5c-4f5c-a244-776641571a20.ps1 | function Get-RandomNames {
<#
.SYNOPSIS
Gets Full Names from a List of Names from http://names.mongabay.com
.DESCRIPTION
Downloads the Names from the Websites and randomizes the order of Names and gives back an Object with surname, lastname and gender
.PARAMETER MaxNames
Number of names returned by the function
... |
combined_dataset/train/non-malicious/sample_53_52.ps1 | sample_53_52.ps1 | BeforeAll {
$ModuleManifestName = 'SampleModule.psd1'
Import-Module $PSScriptRoot\..\$ModuleManifestName
}
Describe 'Module Manifest Tests' {
It 'Passes Test-ModuleManifest' {
Test-ModuleManifest -Path $PSScriptRoot\..\$ModuleManifestName
$? | Should -Be $true
}
}
# SIG # Beg... |
combined_dataset/train/non-malicious/sample_6_22.ps1 | sample_6_22.ps1 | #************************************************
# DC_COMCollect.ps1
# Version 1.0
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects .Net Framework nGen files
# Called from: TS_AutoAddCommands_Apps.ps1
#*******************************************************
Trap [Except... |
combined_dataset/train/non-malicious/2429.ps1 | 2429.ps1 | function Add-ItemToTfs
{
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[ValidateScript({ Test-Path -Path $_ })]
[string]$ItemPath,
[Parameter()]
[ValidateNotNullOrEmpty()]
[ValidateScript({ Test-Path -Path $_ -PathType Leaf })]
[string]$tfFilePath = 'C:\Program Files... |
combined_dataset/train/non-malicious/6b9bb97b-5f9c-4504-af73-6d26a0372e0c.ps1 | 6b9bb97b-5f9c-4504-af73-6d26a0372e0c.ps1 | Function Get-Printers
{
<#
.SYNOPSIS
Get a list of printers from the specified print server
.DESCRIPTION
This function returns the Name of each printer installed
on the specified print server.
.PARAMETER ComputerName
Name of the print server
.EXAMPLE
... |
combined_dataset/train/non-malicious/sample_33_79.ps1 | sample_33_79.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 = '82.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_19_87.ps1 | sample_19_87.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplace'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplace.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_57_41.ps1 | sample_57_41.ps1 | <#
.SYNOPSIS
MSRD-Collect graphical user interface (Lite version)
.DESCRIPTION
Module for the MSRD-Collect graphical user interface (Lite version)
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedback : https://aka.ms/MSRD-C... |
combined_dataset/train/non-malicious/Enable_Configure SNMP_2.ps1 | Enable_Configure SNMP_2.ps1 | #Powershell Script To Install SNMP Services (SNMP Service, SNMP WMI Provider)
#Variables :)
$pmanagers = "ADD YOUR MANAGER(s)"
$commstring = "ADD YOUR COMM STRING"
#Import ServerManger Module
Import-Module ServerManager
#Check If SNMP Services Are Already Installed
$check = Get-WindowsFeature | Where-Objec... |
combined_dataset/train/non-malicious/sample_17_8.ps1 | sample_17_8.ps1 | #
# Module manifest for module 'OCI.PSModules.Networkloadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Networkloadbalancer.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Sup... |
combined_dataset/train/non-malicious/sample_56_79.ps1 | sample_56_79.ps1 | #
# Module manifest for module 'OCI.PSModules.Loggingingestion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported... |
combined_dataset/train/non-malicious/2314.ps1 | 2314.ps1 | if ([Environment]::Is64BitProcess)
{
throw 'This module is not supported in a x64 PowerShell session. Please load this module into a x86 PowerShell session.'
} |
combined_dataset/train/non-malicious/1986.ps1 | 1986.ps1 |
Describe "FormatHex" -tags "CI" {
BeforeAll {
$newline = [Environment]::Newline
Setup -d FormatHexDataDir
$inputFile1 = New-Item -Path "$TestDrive/SourceFile-1.txt"
$inputText1 = 'Hello World'
Set-Content -LiteralPath $inputFile1.FullName -Value $inputText1 -NoNewli... |
combined_dataset/train/non-malicious/Get-LogicalDiskInfo_1.ps1 | Get-LogicalDiskInfo_1.ps1 | # ========================================================================
#
# NAME: Get-LogicalDiskInfo.ps1
#
# AUTHOR: Alex Ocampo , Daptiv Solutions LLC
# DATE : 7/19/2011
#
# COMMENT: Using WMI, script check logical disk information of a single
# server or a group of servers. Script send email notificat... |
combined_dataset/train/non-malicious/More PSDrives.ps1 | More PSDrives.ps1 | function Mount-UserDrives {
<#
.Synopsis
Create additional user drives.
.Description
To remove drives created with this function use Remove-UserDrives.
.Link
New-PSDrive
Remove-UserDrives
#>
[Enum]::GetNames([Environment+SpecialFolder]) | % {
New-PSDrive ... |
combined_dataset/train/non-malicious/AD-PromiscDetect.ps1 | AD-PromiscDetect.ps1 | <#================================================================================================
NAME: AD-PromiscDetect.ps1
AUTHOR: Marty J. Piccinich
DATE CREATED: 9/15/2009
VERSION: 1.1
HISTORY: 1.0 9/15/2009 - Created
1.1 10/23/2009 - Added comment head... |
combined_dataset/train/non-malicious/sample_37_98.ps1 | sample_37_98.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.MarketplaceOrdering.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.MarketplaceOrdering.internal.psm1'
if(Test-Path $interna... |
combined_dataset/train/non-malicious/sample_23_22.ps1 | sample_23_22.ps1 | param([string] $AgentInstallDir)
#Get the agent updater module path using intallation directory details
$AgentInstallDir=$AgentInstallDir.Trim()
$AgentUpdaterModulePath=Join-Path -Path $AgentInstallDir -ChildPath "Kailani.Afs.Updater.Cmdlets.dll"
Write-Host "Running the agent updater action from $AgentUpdaterModu... |
combined_dataset/train/non-malicious/sample_13_26.ps1 | sample_13_26.ps1 | ConvertFrom-StringData @'
id_clusterdependencyreport=Cluster resource dependency report
id_clusterdependencyreportdesc1=Obtaining cluster resource dependency report
id_clusterdependencyreportdesc=Obtaining cluster resource dependency report from group %GroupName%
'@
# SIG # Begin signature block
# MIIoUgYJKoZIh... |
combined_dataset/train/non-malicious/sample_28_86.ps1 | sample_28_86.ps1 | #
# Module manifest for module 'Az.ContainerRegistry'
#
# Generated by: Microsoft Corporation
#
# Generated on: 23/04/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.ContainerRegistry.psm1'
# Version number of this module.
ModuleVersion = '4.2.1'
# Sup... |
combined_dataset/train/non-malicious/Get-Parameter 2.7.ps1 | Get-Parameter 2.7.ps1 | #Requires -version 2.0
#.Synopsis
# Enumerates the parameters of one or more commands
#.Notes
# With many thanks to Hal Rottenberg, Oisin Grehan and Shay Levy
# Version 0.80 - April 2008 - By Hal Rottenberg http://poshcode.org/186
# Version 0.81 - May 2008 - By Hal Rottenberg http://poshcode.org/255
# Ver... |
combined_dataset/train/non-malicious/Test-Port_1.ps1 | Test-Port_1.ps1 | param ($ComputerName,$Port)
$sock = new-object System.Net.Sockets.Socket -ArgumentList $([System.Net.Sockets.AddressFamily]::InterNetwork),$([System.Net.Sockets.SocketType]::Stream),$([System.Net.Sockets.ProtocolType]::Tcp)
try {
$sock.Connect($ComputerName,$Port)
$sock.Connected
$sock.Close()
}... |
combined_dataset/train/non-malicious/2539.ps1 | 2539.ps1 |
$sessions = gc "E:\dexma\logs\computers.txt" | New-PSSession
$block = {
gwmi -query "select * from Win32_Volume where DriveType='3' AND DriveLetter='C:'" | Select `
@{Name="Server";Expression={$ENV:COMPUTERNAME}},`
@{Name="Device";Expression={$_.DriveLetter}},`
@{Name="MountPoint";Expression={$DI... |
combined_dataset/train/non-malicious/sample_60_44.ps1 | sample_60_44.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Suppor... |
combined_dataset/train/non-malicious/sample_59_60.ps1 | sample_59_60.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 = 'https://aka... |
combined_dataset/train/non-malicious/sample_11_62.ps1 | sample_11_62.ps1 | #
#
# Rule to look for organizations that are newer than the deployment
#
# Created: 5/24/2012
# Author: Jonathan Randall
#******************************************************************************************************************
#region Functions
function GetOrganizationData([string] $conn_string)
... |
combined_dataset/train/non-malicious/sample_15_68.ps1 | sample_15_68.ps1 | #************************************************
# TS_InfoCacheLevelCheck.ps1
# Version 1.0
# Date: 1-2-2012
# Author: v-anecho
# Description: If you are experiencing slow logons or slow enumeration of shares, the InfoCacheLevel registry value may resolve the issue.
#*********************************************... |
combined_dataset/train/non-malicious/sample_1_60.ps1 | sample_1_60.ps1 | #************************************************
# DC_BitsClient-Component.ps1
# Version 1.0: Created
# Version 1.1.08.13.14: Added collection for "HKLM\Software\Microsoft\Windows\CurrentVersion\BITS", and updated comment section.
# Version 1.2.10.20.14: Added -ErrorAction to correct an exception on some systems.
... |
combined_dataset/train/non-malicious/sample_15_8.ps1 | sample_15_8.ps1 | <#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
function Stop-Process2 {
[CmdletBinding(SupportsShouldProcess = $true)]
[Alias()]
[OutputType([int])]
param(
# Param1 help description
... |
combined_dataset/train/non-malicious/Set-Prompt_2.ps1 | Set-Prompt_2.ps1 | #.Synopsis
# Sets my favorite prompt function
#.Notes
# I put the id in my prompt because it's very, very useful.
#
# Invoke-History and my Expand-Alias and Get-PerformanceHistory all take command history IDs
# Also, you can tab-complete with "#<id>[Tab]" so .
# For example, the following commands:
# r 4
... |
combined_dataset/train/non-malicious/Get-FileEncoding_3.ps1 | Get-FileEncoding_3.ps1 | <#
.SYNOPSIS
Gets file encoding.
.DESCRIPTION
The Get-FileEncoding function determines encoding by looking at Byte Order Mark (BOM).
Based on port of C# code from http://www.west-wind.com/Weblog/posts/197245.aspx
.EXAMPLE
Get-ChildItem *.ps1 | select FullName, @{n='Encoding';e={Get-FileEncoding $_.FullName}} | ... |
combined_dataset/train/non-malicious/ADFS troubleshooting.ps1 | ADFS troubleshooting.ps1 | <#
This Script will check the MSOnline Office 365 setup. It will prompt the user running it to specify the
credentials. It will then check compare the onsite information with the online information and inform the
user if it is out of sync.
#>
$PSAdmin = Read-host "This script needs to be run as Administrator,... |
combined_dataset/train/non-malicious/Get-EasterWestern.ps1 | Get-EasterWestern.ps1 | function Get-EasterWestern {
Param(
[Parameter(Mandatory=$true)]
[int] $Year
)
$a = $Year % 19
$b = [Math]::Floor($Year / 100)
$c = $Year % 100
$d = [Math]::Floor($b / 4)
$e = $b % 4
$f = [Math]::Floor(($b + 8) / 25)
$g = [Math]::Floor((($b - $f + 1) / 3))
$h = ((19 ... |
combined_dataset/train/non-malicious/sample_39_89.ps1 | sample_39_89.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydataplane.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Support... |
combined_dataset/train/non-malicious/sample_31_75.ps1 | sample_31_75.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 = '80.0.0'
# S... |
combined_dataset/train/non-malicious/sample_20_33.ps1 | sample_20_33.ps1 | # Localized 04/01/2024 04:51 AM (GMT) 303:7.2.30118 CL_LocalizationData.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Troubleshooting
Troubleshoot_DetectNetworkCache=Checking Windows Media Player network cache ...
Resolution_Title=Resolution
Resolution_ResetConfiguration=Resetting all configuration ... |
combined_dataset/train/non-malicious/2355.ps1 | 2355.ps1 |
function Get-EmptyGroup
{
[OutputType([pscustomobject])]
[CmdletBinding()]
param ()
begin
{
$ErrorActionPreference = 'Stop'
}
process
{
try
{
@(Get-ADGroup -Filter * -Properties isCriticalSystemObject,Members).where({ (-not $_.isCriticalSystemObject) -and ($_.Members.Count -eq 0) })
}
catch
{... |
combined_dataset/train/non-malicious/sample_59_58.ps1 | sample_59_58.ps1 | using module ..\Common\MountedImage.psm1
Import-Module -Name "$PSScriptRoot\..\..\Common\Helpers.psm1"
Import-Module -Name "$PSScriptRoot\..\..\Common\NetworkHelpers.psm1"
Import-Module -Name "$PSScriptRoot\..\..\Common\StorageHelpers.psm1"
Import-Module -Name "$PSScriptRoot\RoleHelpers.psm1"
$azureStackNugetPath ... |
combined_dataset/train/non-malicious/3346.ps1 | 3346.ps1 |
function Remove-RolePermission {
[PoshBot.BotCommand(
Permissions = 'manage-roles'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string]$Role,
[parameter(Mandatory, Position = 1)]
[string]$Pe... |
combined_dataset/train/non-malicious/Test-Prompt.ps1 | Test-Prompt.ps1 | $choices = [System.Management.Automation.Host.ChoiceDescription[]](\n(new System.Management.Automation.Host.ChoiceDescription "&Yes","Choose me!"),\n(new System.Management.Automation.Host.ChoiceDescription "&No","Pick me!"))\n\n$Answer = $host.ui.PromptForChoice('Caption',"Message",$choices,(1))\n\nWrite-Output $Answer... |
combined_dataset/train/non-malicious/1dee8949-c4c9-4c6b-8530-45a36de22fdd.ps1 | 1dee8949-c4c9-4c6b-8530-45a36de22fdd.ps1 | # For TabExpansion.ps1
# this requires latest TabExpansion.ps1
function Get-PipeLineObject {
$i = -2
$property = $null
do {
$str = $line.Split("|")
# extract the command name from the string
# first split the string into statements and pipeline elements
# This do... |
combined_dataset/train/non-malicious/1978.ps1 | 1978.ps1 |
Describe "New-Variable DRT Unit Tests" -Tags "CI" {
It "New-Variable variable with description should works"{
New-Variable foo bar -description "my description"
$var1=Get-Variable -Name foo
$var1.Name|Should -BeExactly "foo"
$var1.Value|Should -BeExactly "bar"
$var1.Options|Should -BeExactly "None"
$var... |
combined_dataset/train/non-malicious/sample_24_82.ps1 | sample_24_82.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplace'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplace.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/1801.ps1 | 1801.ps1 |
Describe "Unimplemented Management Cmdlet Tests" -Tags "CI" {
$Commands = @(
"Get-Service",
"Stop-Service",
"Start-Service",
"Suspend-Service",
"Resume-Service",
"Restart-Service",
"Set-Service",
"New-Service",
"Restart-Computer",
"... |
combined_dataset/train/non-malicious/sample_9_78.ps1 | sample_9_78.ps1 | #************************************************
# TS_EventLogServiceRegistryCheck.ps1
# Version 1.0.1
# Date: 12/11/2012
# Author: v-kaw
# Description: [Idea ID 5603] [Windows] Unable to start a service due to corruption in the Event Log key
# Rule number: 5603
# Rule URL: http://sharepoint/sites/rules/Rule... |
combined_dataset/train/non-malicious/LibraryInvocation.ps1 | LibraryInvocation.ps1 | ## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n\nSet-StrictMode -Version Latest\n\n## Return the name of the currently executing script\n## By placing this in a function, we drastically simplify\n## the logic it takes to determine the currently running\n## script\n\nf... |
combined_dataset/train/non-malicious/Beginner event 10 _1.ps1 | Beginner event 10 _1.ps1 | #
# Summer 2009 Scripting games
# Beginner Event 10 - The 1,500-Meter race
# http://blogs.technet.com/heyscriptingguy/archive/2009/06/18/hey-scripting-guy-2009-scripting-games-event-10-details-beginner-and-advanced-1-500-meter-race.aspx
#
# ToDo: In this event, you must write a script that will count down from th... |
combined_dataset/train/non-malicious/3590.ps1 | 3590.ps1 |
$clusterName = Get-ClusterName
$resourceGroupName = Get-ResourceGroupName
$appTypeName = Get-AppTypeName
$v1 = Get-AppTypeV1Name
$v2 = Get-AppTypeV2Name
$packageV1 = Get-AppPackageV1
$packageV2 = Get-AppPackageV2
$serviceTypeName = Get-ServiceTypeName
function Test-AppType
{
$appType = Get-AzServiceFabr... |
combined_dataset/train/non-malicious/sample_45_71.ps1 | sample_45_71.ps1 | <#
.SYNOPSIS
Collect all the logs for an SRSv2 device, and place them in a zip file.
.DESCRIPTION
Create a zip file in the Rigel folder on the system drive. The zip
will contain all of the relevant application and system log files the
dev team requires for debugging. The ... |
combined_dataset/train/non-malicious/Get-Hostname.ps1 | Get-Hostname.ps1 | # .SYNOPSIS
# Print the hostname of the system.
# .DESCRIPTION
# This function prints the hostname of the system. You can additionally output the DNS
# domain or the FQDN by using the parameters as described below.
# .PARAMETER Short
# (Default) Print only the computername, i.e. the same value as returned by $env... |
combined_dataset/train/non-malicious/sample_9_72.ps1 | sample_9_72.ps1 | param(
[string]$DataPath,
[switch]$AcceptEula,
[switch]$SkipLogs,
[switch]$Trace,
[switch]$Network,
[switch]$RPC,
[switch]$ProcMon,
[switch]$PSR
)
<#
COM-COLLECT
ALIAS : bpostaci, maporcol
Date : 15/11/2023
Updates:
v1.0 | Initial release
v1.1 | 2023... |
combined_dataset/train/non-malicious/Export-WLANSettings_1.ps1 | Export-WLANSettings_1.ps1 | # ==============================================================================================
#
#
# NAME: Export-WLANSettings.ps1
#
# AUTHOR: Jan Egil Ring
#
# DATE : 14.03.2010
#
# COMMENT: Using netsh.exe to loop through each WLAN on the system and export the settings to the user-provided ... |
combined_dataset/train/non-malicious/sample_52_19.ps1 | sample_52_19.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubusage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubusage.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/POC $psnull.ps1 | POC $psnull.ps1 | $a = @"
using System;
namespace ClassLibrary1
{
#proof of concept
public static class Class1
{
public static string Foo(string value)
{
if (value == null)
return "Special processing of null.";
else
return "'" + value + "' has been processed.";
}
}
}
"@
$b = @"
using System;
namespace test... |
combined_dataset/train/non-malicious/sample_15_23.ps1 | sample_15_23.ps1 | # ---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------------------------... |
combined_dataset/train/non-malicious/New-Zip_5.ps1 | New-Zip_5.ps1 | Function New-Zip
{
<#
.SYNOPSIS
Create a Zip File from any files piped in.
.DESCRIPTION
Requires that you have the SharpZipLib installed, which is available from
http://www.icsharpcode.net/OpenSource/SharpZipLib/
.NOTES
File Name : PowerZip.psm1
Author : Christophe CREMON (uxone) - http://powershel... |
combined_dataset/train/non-malicious/1184.ps1 | 1184.ps1 |
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'Get-ProgramInstallInfo.when getting all programs' {
$programs = Get-ProgramInstallInfo
It 'should get all installed programs' {
$programs | Should -Not -BeNullOrEmp... |
combined_dataset/train/non-malicious/sample_4_90.ps1 | sample_4_90.ps1 | Param(
[Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)]
[ValidateSet('Release', 'RTP', 'Preview')]
$NugetConfiguration,
[Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)]
[ValidateSet('bc20', 'bc23', 'bc25')]
$BCVersion,
$configDirectory = "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.