full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_51_11.ps1 | sample_51_11.ps1 | #
# Module manifest for module 'OCI.PSModules.Computecloudatcustomer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computecloudatcustomer.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
... |
combined_dataset/train/non-malicious/LibrarySqlBackup.ps1 | LibrarySqlBackup.ps1 | # ---------------------------------------------------------------------------
### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### Excerpt from SQL Server Powershell Extensions (sqlpsx)
### http://sqlpsx.codeplex.com
### Defines backup and restore functions
### </Description>
### <Us... |
combined_dataset/train/non-malicious/sample_5_42.ps1 | sample_5_42.ps1 | #************************************************
# DC_BitsServer-Component.ps1
# Version 1.0
# Date: 2009
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about the BITS Server Component.
#*******************************************************
Trap [Exception]
{
# Handle... |
combined_dataset/train/non-malicious/sample_19_60.ps1 | sample_19_60.ps1 | # Copyright (c) 2023 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
name: CI
on:
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request.
pull_request:
... |
combined_dataset/train/non-malicious/sample_4_16.ps1 | sample_4_16.ps1 | ConvertFrom-StringData @'
id_check_zenographicsuititle=Checking for the presence of Zenographics Device Manager User Interface
id_check_zenographicsuidesc=Checking if Zenographics Device Manager User Interface is loaded and current version.
id_check_zenographicsuisd=The OEM HP driver SDDMUI.DLL was detected. This d... |
combined_dataset/train/non-malicious/1280.ps1 | 1280.ps1 |
function Get-CComSecurityDescriptor
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,ParameterSetName='DefaultAccessPermission')]
[Parameter(Mandatory=$true,ParameterSetName='MachineAccessRestriction')]
[Switch]
$Access,
[Parameter(Mandatory=$... |
combined_dataset/train/non-malicious/sample_25_71.ps1 | sample_25_71.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/sample_33_24.ps1 | sample_33_24.ps1 | #
# This script launches the VC redist executable and handles certain error scenarios.
#
param(
[Parameter(Mandatory=$true)][String][ValidateNotNullOrEmpty()]$PayloadDirectory,
[Parameter(Mandatory=$true)][String][ValidateSet("arm64","x64","x86")]$Architecture,
[Parameter(Mandatory=$true)][String][Val... |
combined_dataset/train/non-malicious/sample_60_71.ps1 | sample_60_71.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/sample_49_79.ps1 | sample_49_79.ps1 | $resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent
# Import localization helper functions.
$helperName = 'PowerShellGet.LocalizationHelper'
$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1"
Import-Module -Name $... |
combined_dataset/train/non-malicious/1609.ps1 | 1609.ps1 | function Save-CSVasExcel {
param (
[string]$CSVFile = $(Throw 'No file provided.')
)
BEGIN {
function Resolve-FullPath ([string]$Path) {
if ( -not ([System.IO.Path]::IsPathRooted($Path)) ) {
$Path = "$PWD\$Path"
}
... |
combined_dataset/train/non-malicious/Vim25-less Crazy Magic.ps1 | Vim25-less Crazy Magic.ps1 | cls
$ws = New-WebServiceProxy -Uri "http://192.168.1.1/sdk/vimService?wsdl" ;
$ws.Url = "http://192.168.1.1/sdk/vimService";
$ws.UserAgent = "VMware VI Client/4.0.0";
$ws.CookieContainer = New-Object system.net.CookieContainer;
# set up some default MoRefs (see SDK docs)
# if anyone knows how to work arou... |
combined_dataset/train/non-malicious/Invoke-Sql_1.ps1 | Invoke-Sql_1.ps1 | <#
.SYNOPSIS
Runs a T-SQL Query and optional outputs results to a delimited file.
.DESCRIPTION
Invoke-Sql script will run a T-SQL query or stored procedure and optionally outputs a delimited file.
.EXAMPLE
PowerShell.exe -File "C:\\Scripts\\Invoke-Sql.ps1" -ServerInstance "Z003\\sqlprod2" -Database orders -Query ... |
combined_dataset/train/non-malicious/Get-GroupMembership.ps1 | Get-GroupMembership.ps1 | ## Get-DistinguishedName -- look up a DN from a user's (login) name
function Get-DistinguishedName {
Param($UserName)
$ads = New-Object System.DirectoryServices.DirectorySearcher(([ADSI]''))
$ads.filter = "(&(objectClass=Person)(samAccountName=us321339))"
$s = $ads.FindOne()
return $s.GetDirectoryEn... |
combined_dataset/train/non-malicious/sample_54_34.ps1 | sample_54_34.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_15_28.ps1 | sample_15_28.ps1 | #------------------------------------------------------------------------------
# Rules :-
#
# o Lines starting with # are ignored
# o Blank lines are ignored
# o Whitespace between commas is removed
#------------------------------------------------------------------------------
# Supported data types
#
... |
combined_dataset/train/non-malicious/sample_64_95.ps1 | sample_64_95.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/2375.ps1 | 2375.ps1 | describe 'Get-FileViaSftp.ps1' {
$commandName = "$PSScriptRoot\Get-FileViaSftp.ps1"
mock 'Test-Path' {
$true
} -ParameterFilter { $Path -notlike 'Variable:\'}
mock 'Test-Path' {
$false
} -ParameterFilter { $Path -like 'Variable:\'}
mock 'Install-module'
mock 'New-SFTPSession' {
@{
SessionId = 0
}... |
combined_dataset/train/non-malicious/2605.ps1 | 2605.ps1 | $json = (Get-Content .\dss_test1.js) -join "`n" | ConvertFrom-Json
for($i=2;$i -le 10;$i++){
$jsonout = $json
$jsonout.entries.patient.dssID = "T$i"
$jsonout.entries.patient.firstName = "DSS $i"
$jsonout.entries.patient.lastName = 'Test'
$jsonout.entries.patient.email = "dsstest$i@gmail.com"
$j... |
combined_dataset/train/non-malicious/sample_52_68.ps1 | sample_52_68.ps1 | #
# Module manifest for module 'OCI.PSModules.Aivision'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aivision.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_30_18.ps1 | sample_30_18.ps1 | #
# This script just calls the Add-AppDevPackage.ps1 script that lives next to it.
#
param(
[switch]$Force = $false,
[switch]$SkipLoggingTelemetry = $false
)
$scriptArgs = ""
if ($Force)
{
$scriptArgs = '-Force'
}
if ($SkipLoggingTelemetry)
{
if ($Force)
{
$scriptArgs +... |
combined_dataset/train/non-malicious/4091.ps1 | 4091.ps1 |
[CmdletBinding()]
param
(
[switch]
$Build,
[ValidateNotNullOrEmpty()][string]
$ClientInstallationDirectory = '',
[ValidateNotNullOrEmpty()][string]
$ClientInstallationFile = 'ccmsetup.exe',
[switch]
$Install,
[string]
$ManagementPoint = '',
[string]
$SMSSiteCode = '',
[switch]
$Uninstall,
[switch]
$Use... |
combined_dataset/train/non-malicious/sample_9_52.ps1 | sample_9_52.ps1 | PARAM (
$ProcessToTerminate = $null,
$ScriptBlockToExecute = $null,
[string] $SessionName = "Session0",
[switch] $EndMonitoring,
[switch] $AllSessions
)
# 2023-02-20 WalterE mod Trap #we#
trap [Exception]{
WriteTo-ErrorDebugReport -ErrorRecord $_
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.I... |
combined_dataset/train/non-malicious/1150.ps1 | 1150.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$rootKey = 'hklm:\Software\Carbon\Test\Test-SetRegistryKeyValue'
function Remove-RootKey
{
if( (Test-Path -Path $rootKey) )
{
Remove-Item -Path $rootKey -Recurse
}
}
Describe 'Set-RegistryKeyV... |
combined_dataset/train/non-malicious/sample_2_27.ps1 | sample_2_27.ps1 | # Localized 10/16/2024 05:34 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Ja
PromptNoString=&Nein
BundleFound=Bundle gefunden: {0}
PackageFound=Paket gefunden: {0}
EncryptedBundleFound=Verschlüsseltes Bundle gefunden: {0}
EncryptedPackag... |
combined_dataset/train/non-malicious/3315.ps1 | 3315.ps1 |
function Update-RoleDescription {
[PoshBot.BotCommand(
Permissions = 'manage-roles'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string]$Name,
[parameter(Mandatory, Position = 1)]
[string]$D... |
combined_dataset/train/non-malicious/df.ps1 | df.ps1 | function df ( $Path ) {
if ( !$Path ) { $Path = (Get-Location -PSProvider FileSystem).ProviderPath }
$Drive = (Get-Item $Path).Root -replace "\\\\"
$Output = Get-WmiObject -Query "select freespace from win32_logicaldisk where deviceid = `'$drive`'"
Write-Output "$($Output.FreeSpace / 1mb) MB"
}
|
combined_dataset/train/non-malicious/sample_51_50.ps1 | sample_51_50.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubbillingschedule'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubbillingschedule.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Sup... |
combined_dataset/train/non-malicious/sample_49_4.ps1 | sample_49_4.ps1 | function Get-ClusterNodes {
<#
.SYNOPSIS
Retrieves the inventory data for cluster nodes in a particular cluster.
.DESCRIPTION
Retrieves the inventory data for cluster nodes in a particular cluster.
.ROLE
Readers
#>
import-module CimCmdlets
# JEA code requires to pre-import the module (this is slow... |
combined_dataset/train/non-malicious/chkhash_26.ps1 | chkhash_26.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_21_82.ps1 | sample_21_82.ps1 | #
# Module manifest for module 'OCI.PSModules.Apigateway'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apigateway.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/1326.ps1 | 1326.ps1 |
function Set-CIisHttpRedirect
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$SiteName,
[Alias('Path')]
[string]
$VirtualPath = '',
[Parameter(Mandatory=$true)]
... |
combined_dataset/train/non-malicious/sample_37_8.ps1 | sample_37_8.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
PowerShell Diagnostics Module
This module contains a set of wrapper scripts that
enable a user to use ETW tracing in Windows
PowerShell.
#>
$script:Logman="$env:windir\system32\logman.exe"
$script:wsmanlogfile = "$env:wind... |
combined_dataset/train/non-malicious/1524.ps1 | 1524.ps1 |
function Assert-False
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[object]
$InputObject,
[Parameter(Position=1)]
[string]
$Message
)
Set-StrictMode -Version 'Latest'
if( $InputObject )
{
... |
combined_dataset/train/non-malicious/sample_42_63.ps1 | sample_42_63.ps1 | #
# Module manifest for module 'OCI.PSModules.Desktops'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Desktops.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/Exchange AutoReply Admin_1.ps1 | Exchange AutoReply Admin_1.ps1 | <#
.NOTES
Name : Exchange Automatic Replies Administrator.ps1
Author : Bryan Jaudon <bryan.jaudon@gmail.com>
Version : 1.0
Date : 11/23/2012
.SYNOPSIS
Provides a graphical front-end to the Get-MailboxAutoReplyConfiguration and
Set-MailboxAutoReplyConfiguration Exch... |
combined_dataset/train/non-malicious/Stop-ProcessRemote.ps1 | Stop-ProcessRemote.ps1 | Function Stop-ProcessRemote()
{
<#
.SYNOPSIS
Stops a process on a remote computer
.DESCRIPTION
Uses WMI to connect to a remote computer and terminate a process.
Assumes the user has administrative priviledges on the remote
computer.
.NOTES
Author : Brian Wahoff
Requires : Powershell V2
.PARAM... |
combined_dataset/train/non-malicious/sample_12_72.ps1 | sample_12_72.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_55_23.ps1 | sample_55_23.ps1 | <##############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
##########################################################... |
combined_dataset/train/non-malicious/1861.ps1 | 1861.ps1 |
Describe "Remote module tests" -Tags 'Feature','RequireAdminOnWindows' {
BeforeAll {
if (!$IsWindows)
{
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
$PSDefaultParameterValues["it:skip"] = $true
return
}
$pssession = New-... |
combined_dataset/train/non-malicious/Write-ScriptVariables.ps1 | Write-ScriptVariables.ps1 | function Write-ScriptVariables {
$globalVars = get-variable -scope Global | % { $_.Name }
Get-Variable -scope Script | Where-Object { $globalVars -notcontains $_.Name } | Where-Object { $_.Name -ne 'globalVars' } | Out-String
}
|
combined_dataset/train/non-malicious/Log 4 SP easy restore .ps1 | Log 4 SP easy restore .ps1 | ####### Log deletions in all sites in a web application ######
############# http://iLoveSharePoint.com ##################
############## by Christian Glessner ######################
################ begin config #################
# Url of the web application to audit. Don't forget to activate the delete audi... |
combined_dataset/train/non-malicious/4468.ps1 | 4468.ps1 |
$script:DSCModuleName = 'DSC'
$script:DSCResourceName = 'MSFT_PSModule'
$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:moduleRoot -C... |
combined_dataset/train/non-malicious/sample_34_52.ps1 | sample_34_52.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\vite@5.0.12\node_modules\vite\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\vite@5.0.12\no... |
combined_dataset/train/non-malicious/Get-NTFSPermissions.ps1 | Get-NTFSPermissions.ps1 | <#
.SYNOPSIS
Author:..Vidrine
Date:....2013.01.14
.DESCRIPTION
Thanks to http://jfrmilner.wordpress.com/
Specify target host and root directory. The script will then recursively check for all folders and report on their NTFS permissions.
Output is stored in a custom object, that is then exported... |
combined_dataset/train/non-malicious/New-DynamicVariable.ps1 | New-DynamicVariable.ps1 | ##############################################################################\n##\n## New-DynamicVariable\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\nCrea... |
combined_dataset/train/non-malicious/sample_23_42.ps1 | sample_23_42.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/2306.ps1 | 2306.ps1 | param (
[string]$DirectoryName,
[int]$MaxFileCount
)
$API = New-Object -ComObject 'MOM.ScriptAPI'
$PropertyBag = $API.CreatePropertyBag()
try {
$FileCount = (Get-ChildItem -Path $DirectoryName | Where-Object { !$_.PsIsContainer }).Count
if ($FileCount -ge $MaxFileCount) {
$PropertyBag.AddValue('State', 'Critica... |
combined_dataset/train/non-malicious/4326.ps1 | 4326.ps1 | function Get-OrderedPSScriptInfoObject
{
[CmdletBinding(PositionalBinding=$false)]
Param
(
[Parameter(Mandatory=$true)]
[PSCustomObject]
$PSScriptInfo
)
$NewPSScriptInfo = Microsoft.PowerShell.Utility\New-Object PSCustomObject -Property ([ordered]@{
... |
combined_dataset/train/non-malicious/3544.ps1 | 3544.ps1 |
function Test-BmsGetContainer
{
$vault = Get-AzRecoveryServicesVault -ResourceGroupName "pstestrg" -Name "pstestrsvault";
$containers = Get-AzRecoveryServicesBackupManagementServer -VaultId $vault.ID;
$namedContainer = Get-AzRecoveryServicesBackupManagementServer `
-VaultId $vault.ID `
-Name "PRCH... |
combined_dataset/train/non-malicious/sample_36_92.ps1 | sample_36_92.ps1 | #
# Module manifest for module 'OCI.PSModules.Stackmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Stackmonitoring.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_1_49.ps1 | sample_1_49.ps1 | <#
.SYNOPSIS
DC_CM12BitlockerInfo.ps1 - Configuration Manager module for collecting bitlocker information
.DESCRIPTION
Leverages existing DND Module functionality to collect bitlocker information
.NOTES
Dev. Lead: sabieler
Authors : lamosley
Requires : PowerShell V4 (Supported from Windows 8.1... |
combined_dataset/train/non-malicious/netcast show downloader_1.ps1 | netcast show downloader_1.ps1 | cd M:\\Files\\Netcasts\\ShowName # switch to the diretory to store your content
Import-Module BitsTransfer # enable BITS on host machine as a file transfer method
$start=47 # start epidode number
$end=170 # end epidode number
$url="http://download.domain.com/episodes/" # URL of the download up to the ... |
combined_dataset/train/non-malicious/sample_38_64.ps1 | sample_38_64.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/sample_58_38.ps1 | sample_58_38.ps1 | # Import the helper functions
Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false
function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param
(
[parameter(Mandatory = $true)]
[System.String]
$Category
)
#Write-Verbose "Use this cmdlet t... |
combined_dataset/train/non-malicious/sample_66_82.ps1 | sample_66_82.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/2337.ps1 | 2337.ps1 | function findOldADComputers () {
$aOldComputers = @();
$aAllAdComputers = Get-ADComputer -Filter * -Properties LastLogonDate,PasswordLastSet | Where { $_.Enabled -eq $true };
foreach ($oAdComputer in $aAllAdComputers) {
if ($oAdComputer.lastLogonDate -ne $null) {
if ($oAdComputer.lastLogonDate -lt [DateTime]::... |
combined_dataset/train/non-malicious/sample_31_92.ps1 | sample_31_92.ps1 | <#
# .DESCRIPTION
# Uninstall Microsoft Monitoring Agent for Windows.
#
#>
$ErrorActionPreference = "Stop"
# install agent
$mmaExe = Join-Path -Path $env:temp -ChildPath 'MMASetup-AMD64.exe'
if (Test-Path $mmaExe) {
Remove-Item $mmaExe
}
Invoke-WebRequest -Uri https://go.microsoft.com/fwlink/?L... |
combined_dataset/train/non-malicious/sample_59_50.ps1 | sample_59_50.ps1 | #
# Module manifest for module 'OCI.PSModules.Opensearch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Opensearch.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/2224.ps1 | 2224.ps1 | [CmdletBinding()]
param(
[parameter(Mandatory=$true)]
$SiteServer,
[parameter(Mandatory=$true)]
$SiteCode,
[parameter(Mandatory=$true)]
[int]$CreationTimeDays,
[parameter(Mandatory=$true)]
[int]$DeadlineDays,
[parameter(Mandatory=$true)]
[ValidateScript({$_.Length -eq 4})]
$DeadlineHours
)
$CurrentDate = (Get-Date).Ad... |
combined_dataset/train/non-malicious/sample_66_63.ps1 | sample_66_63.ps1 | /*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-------------... |
combined_dataset/train/non-malicious/sample_2_91.ps1 | sample_2_91.ps1 | # Copyright ?008, Microsoft Corporation. All rights reserved.
if($debug -eq $true){[void]$shell.popup("Run TS_Virtualization.ps1")}
Import-LocalizedData -BindingVariable VirtualizationStrings
Write-DiagProgress -Activity $VirtualizationStrings.ID_Virtualization -Status $VirtualizationStrings.ID_Virtualizatio... |
combined_dataset/train/non-malicious/1896.ps1 | 1896.ps1 |
Describe "ConvertTo-Xml DRT Unit Tests" -Tags "CI" {
BeforeAll {
class fruit {
[string] $name;
}
$customPSObject = [PSCustomObject]@{ "prop1" = "val1"; "prop2" = "val2" }
$newLine = [System.Environment]::NewLine
}
It "Can convert to XML with parameter Depth" ... |
combined_dataset/train/non-malicious/2992.ps1 | 2992.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Write xml test results" {
Setup -Dir "Results"
Context 'nunit' {
It "should write a successful test result" {
$TestResults = New-PesterState -Path TestDrive:\
$testResults.E... |
combined_dataset/train/non-malicious/sample_65_1.ps1 | sample_65_1.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
# Loads all Service Fabric SD... |
combined_dataset/train/non-malicious/sample_36_84.ps1 | sample_36_84.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 = '80.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_25_0.ps1 | sample_25_0.ps1 | # ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apach... |
combined_dataset/train/non-malicious/sample_52_14.ps1 | sample_52_14.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module -Name "$PSScriptRoot\..\..\Physica... |
combined_dataset/train/non-malicious/sample_60_89.ps1 | sample_60_89.ps1 | #
# Module manifest for module 'OCI.PSModules.Monitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Monitoring.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_46_90.ps1 | sample_46_90.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 = '83.2.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/1248.ps1 | 1248.ps1 |
function ConvertTo-CBase64
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[AllowNull()]
[AllowEmptyString()]
[string[]]
$Value,
[Text.Encoding]
$Encoding = ([Text.Encoding]::Unicode)
)
... |
combined_dataset/train/non-malicious/Backup full.ps1 | Backup full.ps1 | # Ańadimos el modulo de exchange
If ((Get-PSSnapin | where {$_.Name -match "Exchange.Management"}) -eq $null)
{
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
}
$lista= ""
[int]$tam=30
$server = "MAILBOX"
$discos=get-wmiobject -class win32_volume -filter "DriveType=3" -computer $server
$databases... |
combined_dataset/train/non-malicious/2515.ps1 | 2515.ps1 |
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null
$credential = Get-Credential
$loginName = $credential.UserName
$password = $credential.Password
$Excel = New-Object -ComObject Excel.Application
$Excel.visible = $False
$Workbook = $Excel.Workbooks.Add()
$srvlist = @(get-co... |
combined_dataset/train/non-malicious/3312.ps1 | 3312.ps1 |
function Add-CommandPermission {
[PoshBot.BotCommand(Permissions = 'manage-permissions')]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[ValidatePattern('^.+:.+')]
[Alias('Name')]
[string]$Command,
[... |
combined_dataset/train/non-malicious/sample_37_34.ps1 | sample_37_34.ps1 | function PSConsoleHostReadLine
{
Microsoft.PowerShell.Core\Set-StrictMode -Off
[Microsoft.PowerShell.PSConsoleReadLine]::ReadLine($host.Runspace, $ExecutionContext)
}
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE... |
combined_dataset/train/non-malicious/1875.ps1 | 1875.ps1 |
Describe "Stream writer tests" -Tags "CI" {
$targetfile = Join-Path -Path $TestDrive -ChildPath "writeoutput.txt"
function Write-Messages
{
[CmdletBinding()]
param()
Write-Verbose "Verbose message"
Write-Debug "Debug message"
}
Context "Redirect Stre... |
combined_dataset/train/non-malicious/462.ps1 | 462.ps1 | Set-PSFConfig -Module 'PSFramework' -Name 'Path.Temp' -Value $env:TEMP -Initialize -Validation 'string' -Description "Path pointing at the temp path. Used with Get-PSFPath."
Set-PSFConfig -Module 'PSFramework' -Name 'Path.LocalAppData' -Value $script:path_LocalAppData -Initialize -Validation 'string' -Description "Path... |
combined_dataset/train/non-malicious/sample_50_0.ps1 | sample_50_0.ps1 | & $Env:SystemDrive\Rigel\x64\Scripts\Provisioning\ScriptLaunch.ps1 PinApp.ps1
& $Env:SystemDrive\Rigel\x64\Scripts\Provisioning\ScriptLaunch.ps1 AddTeamsFirewallRules.ps1
& $Env:SystemDrive\Rigel\x64\Scripts\Provisioning\ScriptLaunch.ps1 GenerateDeviceId.ps1
& $Env:SystemDrive\Rigel\x64\Scripts\Provisioning\ScriptLa... |
combined_dataset/train/non-malicious/2632.ps1 | 2632.ps1 |
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null
$ErrorActionPreference = 'Inquire'
function Expand-SqlLogFile{
param(
[string]$InstanceName = 'localhost',
[parameter(Mandatory=$true)][string] $DatabaseName,
[parameter(Mandatory=$true)][int] $LogSizeMB)
... |
combined_dataset/train/non-malicious/3656.ps1 | 3656.ps1 |
function Test-VulnerabilityAssessmentServerSettingsTest
{
$testSuffix = getAssetName
Create-VulnerabilityAssessmentTestEnvironment $testSuffix
$params = Get-SqlVulnerabilityAssessmentTestEnvironmentParameters $testSuffix
$serverLogin = "testusername"
$serverPassword = "t357ingP@s5w0rd!Sec"
$cr... |
combined_dataset/train/non-malicious/4432.ps1 | 4432.ps1 | function Find-Module {
[CmdletBinding(HelpUri = 'https://go.microsoft.com/fwlink/?LinkID=398574')]
[outputtype("PSCustomObject[]")]
Param
(
[Parameter(ValueFromPipelineByPropertyName = $true,
Position = 0)]
[ValidateNotNullOrEmpty()]
[string[]]
$Name,
... |
combined_dataset/train/non-malicious/2177.ps1 | 2177.ps1 |
Import-Module -Name ConfigurationManager
Set-Location -Path P01:
$ApplicationName = "ConfigMgr 2012 R2 SP1 CU1 Console"
$ApplicationDescription = "Created with PowerShell"
$ApplicationSoftwareVersion = "5.0.8239.1206"
$ApplicationPublisher = "Microsoft"
$ApplicationPath = "\\CM01\Source$\Apps\CM2012R2SP1Console\Ad... |
combined_dataset/train/non-malicious/79de7fa1-6c33-48aa-b0e4-a5f72def9bcc.ps1 | 79de7fa1-6c33-48aa-b0e4-a5f72def9bcc.ps1 | ################################################################
#
# PC Info v1.0 for SNOS(http://www.snos.ru/)
# (c)2009 by MakcoH(http://twitter.com/MakcoH)
# Script gathers information about remote PC using SCCM and WMI
#
################################################################
# Get... |
combined_dataset/train/non-malicious/sample_26_84.ps1 | sample_26_84.ps1 |
data LocalizedData {
# culture="en-US"
ConvertFrom-StringData @'
DestPath_F1=Destination path: {0}
ErrorFailedToLoadStoreFile_F1=Failed to load the default value store file: '{0}'.
ErrorProcessingDynamicParams_F1=Failed to create dynamic parameters from the template's manifest file. Template-based... |
combined_dataset/train/non-malicious/sample_63_7.ps1 | sample_63_7.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#####################################################################################################
#
# Registers the WinRM endpoint for this instance of PowerShell.
#
# If the parameters '-PowerShellHome' were specified, it means that t... |
combined_dataset/train/non-malicious/sample_39_80.ps1 | sample_39_80.ps1 | #
# Module manifest for module 'OCI.PSModules.Onesubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_28_89.ps1 | sample_28_89.ps1 | <#
.Synopsis
The operation to add a network interface to a virtual machine.
.Description
The operation to add a network interface to a virtual machine.
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.StackHCIVM.Models.Api20230901Preview.IVirtualMachineInstance
.Link
https://learn.microsoft.com/powershell/mo... |
combined_dataset/train/non-malicious/sample_12_2.ps1 | sample_12_2.ps1 | $FileToCollect = Join-Path $Env:windir "system32\catroot2\dberr.txt"
$SectionDescription = "Catalog registration files"
$FileDescription = "SP Catalog Logging file"
Import-LocalizedData -BindingVariable DCStrings
Write-DiagProgress -activity $DCStrings.ID_DBErrCollecting -status $DCStrings.ID_DBErrCollectingDes... |
combined_dataset/train/non-malicious/sample_35_12.ps1 | sample_35_12.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 = '80.0.0'
# Sup... |
combined_dataset/train/non-malicious/sample_48_43.ps1 | sample_48_43.ps1 | function New-OidcProvider
{
<#
.SYNOPSIS
Checks if an OIDC provider already exists, gets a list of the approved client IDs, and adds a new client ID if it's not already there.
if the OIDC provider doesn't exists creates an IAM entity to describe an identity provider (IdP) that supports Open... |
combined_dataset/train/non-malicious/sample_20_96.ps1 | sample_20_96.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 = '75.1.0'
# S... |
combined_dataset/train/non-malicious/Shift Operators(Correct).ps1 | Shift Operators(Correct).ps1 | #requires -version 2.0
Add-Type @"
public class Shift {
public static int Right(int x, int count) { return x >> count; }
public static uint Right(uint x, int count) { return x >> count; }
public static long Right(long x, int count) { return x >> count; }
public static ulong Right(ulong x, int ... |
combined_dataset/train/non-malicious/sample_42_5.ps1 | sample_42_5.ps1 | #
# Module manifest for module 'OCI.PSModules.Ons'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ons.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/ConvertTo-MultiArray_2.ps1 | ConvertTo-MultiArray_2.ps1 | function ConvertTo-MultiArray {
<#
.Notes
NAME: ConvertTo-MultiArray
AUTHOR: Tome Tanasovski
Website: http://powertoe.wordpress.com
Twitter: http://twitter.com/toenuff
Version: 1.0
CREATED: 11/5/2010
LASTEDIT:
11/5/2010 1.0
Initial Release
11/5/2010 1.1
Removed array parameter and passes a ... |
combined_dataset/train/non-malicious/2088.ps1 | 2088.ps1 |
Describe "DotNetAPI" -Tags "CI" {
It "Should be able to use static .NET classes and get a constant" {
[System.Math]::E | Should -Be 2.718281828459045
[System.Math]::PI | Should -Be 3.141592653589793
}
It "Should be able to invoke a method" {
[System.Environment]::GetEnvironment... |
combined_dataset/train/non-malicious/PowerShell Talk Chickens_1.ps1 | PowerShell Talk Chickens_1.ps1 | #The PowerShell Talk
#Virtualization Congress 2009
#
#The Chicken Counter Script
#Get our cretendials
#More on credential stores: http://professionalvmware.com/2009/04/09/posh-article-of-the-week-secure-credential-storage/
$credentials = Get-VICredentialStoreItem -File "c:\\scripts\\really_secure_file.xml"
... |
combined_dataset/train/non-malicious/sample_54_24.ps1 | sample_54_24.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
function Remove-ServiceFabric... |
combined_dataset/train/non-malicious/sample_47_3.ps1 | sample_47_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Optimizer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Optimizer.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/2127.ps1 | 2127.ps1 |
Describe "Common parameters support for script cmdlets" -Tags "CI" {
BeforeEach {
$rs = [system.management.automation.runspaces.runspacefactory]::CreateRunspace()
$rs.open()
$ps = [System.Management.Automation.PowerShell]::Create()
$ps.Runspace = $rs
}
AfterEach {
... |
combined_dataset/train/non-malicious/Send-HTMLFormattedEmail_1.ps1 | Send-HTMLFormattedEmail_1.ps1 | #-------------------------------------------------
# Send-HTMLFormattedEmail
#-------------------------------------------------
# Usage: Used to send an HTML Formatted Email that is based on an XSLT template.
#-------------------------------------------------
function Send-HTMLFormattedEmail{
param ( [string]... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.