full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/Get-WebSite_1.ps1 | Get-WebSite_1.ps1 | function Get-WebSite {
<#
.SYNOPSIS
Retrieves information about a website.
.DESCRIPTION
Retrieves information about a website.
.PARAMETER Url
URL of the website to test access to.
.PARAMETER UseDefaultCredentials
Use the currently authenticated user's credentials
.PARAMETER Proxy
Us... |
combined_dataset/train/non-malicious/sample_59_5.ps1 | sample_59_5.ps1 | #
# Module manifest for module 'OCI.PSModules.Sch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Sch.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_55_68.ps1 | sample_55_68.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/1316.ps1 | 1316.ps1 |
function Install-CJunction
{
[CmdletBinding(SupportsShouldProcess=$true)]
[OutputType([IO.DirectoryInfo])]
param(
[Parameter(Mandatory=$true)]
[Alias("Junction")]
[string]
$Link,
[Parameter(Mandatory=$true)]
[string]
$T... |
combined_dataset/train/non-malicious/Get-HostsFile.ps1 | Get-HostsFile.ps1 | Function Get-HostsFile {
<#
.SYNOPSIS
Retrieves the contents of a hosts file on a specified system
.DESCRIPTION
Retrieves the contents of a hosts file on a specified system
.PARAMETER Computer
Computer name to view host file from
.NOTES
Name: Get-HostsFile
Author: Boe Prox
DateCre... |
combined_dataset/train/non-malicious/895.ps1 | 895.ps1 | $resourceGroupName = "myResourceGroup"
$webappname = "<replace-with-your-app-name>"
Get-AzWebAppBackupList -ResourceGroupName $resourceGroupName -Name $webappname
Remove-AzWebAppBackup -ResourceGroupName $resourceGroupName -Name $webappname `
-BackupId <replace-with-BackupID>
|
combined_dataset/train/non-malicious/Get-GrowthRate.ps1 | Get-GrowthRate.ps1 | function Get-GrowthRate {
param( $Start, $End, $Period )
$rate = [math]::Abs( [math]::Pow( ( $End / $Start ),( 1 / $per - 1 ) ) - 1 )
"{0:P}" -f $rate
}
|
combined_dataset/train/non-malicious/294.ps1 | 294.ps1 | function Get-PSFCallback
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseOutputTypeCorrectly", "")]
[OutputType([PSFramework.FlowControl.Callback])]
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[string[]]
$Name = '*',
[switch]
$Al... |
combined_dataset/train/non-malicious/4102.ps1 | 4102.ps1 |
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][string]$SiteCode,
[ValidateNotNullOrEmpty()][string]$SCCMModule
)
function Get-RelativePath {
[CmdletBinding()][OutputType([string])]
param ()
$Path = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent) + "\"
Return $Path
}
Clear-Host
Import-Module ... |
combined_dataset/train/non-malicious/Get-DellWarranty by API.ps1 | Get-DellWarranty by API.ps1 | ## Dane Kantner 4/19/2013
##
$computers="localhost","Chiv5908-2009","anyothercomputers","NYSPC-JJAJ68YG6"
foreach ($computer in $computers) {
$obj=get-wmiobject win32_systemenclosure -computername $computer -ErrorAction SilentlyContinue
if ($obj -eq $null) { # unable to retrieve, system may be offline... |
combined_dataset/train/non-malicious/Test-Port_3.ps1 | Test-Port_3.ps1 | function Test-Port{
<#
.SYNOPSIS
Tests port on computer.
.DESCRIPTION
Tests port on computer.
.PARAMETER computer
Name of server to test the port connection on.
.PARAMETER port
Port to test
.PARAMETER tcp
Use tcp port
.PARAMETER udp
Use udp port
.PARAMETER UDP... |
combined_dataset/train/non-malicious/sample_5_63.ps1 | sample_5_63.ps1 | # Localized 10/16/2024 05:34 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Evet
PromptNoString=&Hayır
BundleFound=Demet bulundu: {0}
PackageFound=Paket bulundu: {0}
EncryptedBundleFound=Şifreli demet bulundu: {0}
EncryptedPackageFound=Şif... |
combined_dataset/train/non-malicious/413.ps1 | 413.ps1 | function Read-PsfConfigPersisted
{
[OutputType([System.Collections.Hashtable])]
[CmdletBinding()]
Param (
[PSFramework.Configuration.ConfigScope]
$Scope,
[string]
$Module,
[int]
$ModuleVersion = 1,
[System.Collections.Hashtable]
$Hashtable,
[switch]
$Default
)
begin
{
funct... |
combined_dataset/train/non-malicious/2216.ps1 | 2216.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMessag... |
combined_dataset/train/non-malicious/1648.ps1 | 1648.ps1 |
function diskfree {
Param (
[parameter(ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
[string[]]$ComputerName = $env:computername
)
foreach ($Computer in $ComputerName) {
Write-Host "Working on $Computer"
if (Test-Connection -ComputerName $Computer -Coun... |
combined_dataset/train/non-malicious/sample_63_0.ps1 | sample_63_0.ps1 | #
# Module manifest for module 'OCI.PSModules.Genericartifactscontent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Genericartifactscontent.dll'
# Version number of this module.
ModuleVersion = '85.1.0... |
combined_dataset/train/non-malicious/sample_45_6.ps1 | sample_45_6.ps1 | #
# Module manifest for module 'OCI.PSModules.Governancerulescontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Governancerulescontrolplane.dll'
# Version number of this module.
ModuleVersion =... |
combined_dataset/train/non-malicious/3032.ps1 | 3032.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Should -FileContentMatchMultiline" {
Context "when testing file contents" {
Setup -File "test.txt" "this is line 1$([System.Environment]::NewLine)this is line 2$([System.Environment]::NewLine)Pester is awesome"
It "retu... |
combined_dataset/train/non-malicious/3574.ps1 | 3574.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Get-ResourceName
{
return getAssetName
}
function Get-Location
{
return "West US"
}
function Get-OfferThroughput
{
return 1000
}
function Get-Kind
{
return "fhir-R4"
}
function Clean-ResourceGroup($rgname)
{
Re... |
combined_dataset/train/non-malicious/720.ps1 | 720.ps1 |
function Get-RsItemDataSource
{
[cmdletbinding()]
param
(
[Alias('ItemPath', 'DataSourcePath', 'Path')]
[Parameter(Mandatory = $True, ValueFromPipeline = $true)]
[string]
$RsItem,
[string]
$ReportServerUri,
[Alias('ReportServ... |
combined_dataset/train/non-malicious/2321.ps1 | 2321.ps1 | function Confirm-Choice {
[OutputType('boolean')]
[CmdletBinding()]
param
(
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]$Title,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$PromptMessage
)
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes"
$no = New-Ob... |
combined_dataset/train/non-malicious/2391.ps1 | 2391.ps1 | function New-SelfSignedCertificateEx
{
[CmdletBinding(DefaultParameterSetName = 'Store')]
param
(
[Parameter(Mandatory, Position = 0)]
[string]$Subject,
[Parameter(Position = 1)]
[DateTime]$NotBefore = [DateTime]::Now.AddDays(-1),
[Parameter(Position = 2)]
[DateTime]$NotAfter = $NotBefore.AddDays(3... |
combined_dataset/train/non-malicious/Logger.psm1 0.4.ps1 | Logger.psm1 0.4.ps1 | <#
Name : Universal Log4Net Logging Module (Logger.psm1)
Version : 0.3
Author : Joel Bennett (MVP)
Site : http://www.HuddledMasses.org/
Version History:
0.4 - Bugfix, Viewer and Documentation release.
Fixed a few typo-bugs
Added documentation (man page) comments ... |
combined_dataset/train/non-malicious/sample_36_80.ps1 | sample_36_80.ps1 | #
# Module manifest for module 'OCI.PSModules.Adm'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Adm.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_21_54.ps1 | sample_21_54.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Register-EditorCommand `
-Name 'PowerShellEditorServices.OpenEditorProfile' `
-DisplayName 'Open Editor Profile' `
-SuppressOutput `
-ScriptBlock {
param([Microsoft.PowerShell.EditorServices.Extensions.EditorContex... |
combined_dataset/train/non-malicious/sample_20_83.ps1 | sample_20_83.ps1 | ---
- name: Get Storage information.
ansible.builtin.uri:
url: "https://{{ hostname }}:{{ https_port }}{{ api_system }}/Storage"
register: disk_result
delegate_to: "{{ idrac_gather_facts_delegate }}"
- name: Get all storage controller ids.
ansible.builtin.set_fact:
storage_ids_list: "{{ disk_result.jso... |
combined_dataset/train/non-malicious/sample_41_97.ps1 | sample_41_97.ps1 | ## Copyright (c) Microsoft Corporation. All rights reserved.
<#
.SYNOPSIS
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans.
.DESCRIPTION
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans. These performance recordings contain Microsoft-Antimal... |
combined_dataset/train/non-malicious/sample_45_56.ps1 | sample_45_56.ps1 | #
# Module manifest for module 'OCI.PSModules.Dts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dts.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_34_54.ps1 | sample_34_54.ps1 | <#
.SYNOPSIS
Checks a set of repositories involved in "normal" flow for .NET 6 previews and servicing for their mirror states. Each repo is checked for having an up-to-date internal fork, as well as an internal/ merge branch, if applicable.
.PARAMETER RepoRoot
Directory containing repos.
.PARAMETER RuntimeBranch
Bran... |
combined_dataset/train/non-malicious/NetSnmp.psm1.ps1 | NetSnmp.psm1.ps1 | #requires -version 2
$NetSnmp = Join-Path $env:programfiles "Net-SNMP\\bin"
if ( -not ( Test-Path "$NetSnmp\\snmpwalk.exe" ) ) {
Throw "Net-SNMP binaries not found in $NetSnmp. Please install to this folder `
or edit the NetSnmp variable as appropriate."
}
# Modeled after SNMPWALK http://www.net-snmp.org... |
combined_dataset/train/non-malicious/sample_54_87.ps1 | sample_54_87.ps1 | . "$PSScriptRoot/../project/api.ps1"
. "$PSScriptRoot/helpers.ps1"
function Get-Php-From-Ini-File {
param (
$IniFilePath
)
$configIni = Get-IniContent($IniFilePath)
if ($configIni.phpCLI -and $configIni.phpCLI.phpRuntime) {
return $configIni.phpCLI.phpRuntime
}
return $null
}
... |
combined_dataset/train/non-malicious/sample_5_62.ps1 | sample_5_62.ps1 | ConvertFrom-StringData @'
id_compressingfilename=Compressing selected file
id_compressingfilenamedesc=Compressing %filename%. Please wait...
id_filelarger2gb=Destination/ compressed file %filename% is larger than 2GB. This diagnostic can only upload files that are smaller than 2GB. Please click Next and select a fil... |
combined_dataset/train/non-malicious/sample_23_35.ps1 | sample_23_35.ps1 | ConvertFrom-StringData @'
IPAddressDisplayNameFormat=Adresse IP : {0}
NetworkNameDisplayNameFormat=Nom : {0}
NetworkNameOfflineDisplayNameFormat=Adresse IP : adresse sur « {0} »
CreateClusterProgressValidationStart=Validation de l'adéquation des serveurs pour un cluster de basculement.
CreateClusterProgressValidat... |
combined_dataset/train/non-malicious/sample_16_51.ps1 | sample_16_51.ps1 | #
# Module manifest for module 'Microsoft.SME.ProcessViewer'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.ProcessViewer.psm1'
# Version number of this module.
ModuleVersion = '4.13.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID us... |
combined_dataset/train/non-malicious/3129.ps1 | 3129.ps1 |
function Convert-Subnetmask
{
[CmdLetBinding(DefaultParameterSetName='CIDR')]
param(
[Parameter(
ParameterSetName='CIDR',
Position=0,
Mandatory=$true,
HelpMessage='CIDR like /24 without "/"')]
[ValidateRange(0,32)]
[Int32... |
combined_dataset/train/non-malicious/_3.168.1.1.ps1 | _3.168.1.1.ps1 | function Set-IPAddress {
param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"),
[string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"),
[string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"),
[string]$gateway = $(read-host "Enter... |
combined_dataset/train/non-malicious/Grant-RegistryAccessFull.ps1 | Grant-RegistryAccessFull.ps1 | ##############################################################################\n##\n## Grant-RegistryAccessFullControl\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNO... |
combined_dataset/train/non-malicious/sample_21_39.ps1 | sample_21_39.ps1 | # Array of file names to pass to checksym
[array]$arrFileNames = @("Pwrshplugin.dll",
"Microsoft.backgroundintelligenttransfer.Management.Interop.dll",
"Wsmpty.xsl",
"Wsmtxt.xsl",
"Wwsmpty.xsl",
"Wwsmtxt.xsl",
"Wevtfwd.dll",
"Winrm.cmd",
"Winrm.vbs",
"Win... |
combined_dataset/train/non-malicious/sample_65_46.ps1 | sample_65_46.ps1 | #
# Module manifest for module 'OCI.PSModules.Waas'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waas.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_11_60.ps1 | sample_11_60.ps1 | #************************************************
# TS_VeritasVXIOBadConfigFlags.ps1
# Version 1.0.1
# Date: 5/16/2012
# Author: v-kaw
# Description: [Idea ID 3919] [Windows] Create Shadow Copy fail only on VERTIAS storage foundation volume
# Rule number: 3919
# Rule URL: //sharepoint/sites/rules/Rule%20Submi... |
combined_dataset/train/non-malicious/sample_0_54.ps1 | sample_0_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Licensemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
# Supported PSE... |
combined_dataset/train/non-malicious/2438.ps1 | 2438.ps1 |
[CmdletBinding(DefaultParameterSetName = 'name')]
[OutputType('System.Management.Automation.PSCustomObject')]
param (
[Parameter(ParameterSetName = 'name',
Mandatory,
ValueFromPipeline,
ValueFromPipelineByPropertyName)]
[ValidateSet("Tom","Dick","Jane")]
[ValidateRange(21,65)]
[ValidateScript({Test-Path $_ -... |
combined_dataset/train/non-malicious/UIAutomation.ps1 | UIAutomation.ps1 | # #
# Select-Window Notepad | Remove-Window -passthru #
# ## And later ... #
# Select-Wi... |
combined_dataset/train/non-malicious/sample_59_25.ps1 | sample_59_25.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerinstances'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerinstances.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Suppo... |
combined_dataset/train/non-malicious/sample_40_50.ps1 | sample_40_50.ps1 | #
# Module manifest for module 'OCI.PSModules.Dataflow'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dataflow.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_15_40.ps1 | sample_15_40.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/4065.ps1 | 4065.ps1 |
[CmdletBinding()]
param
(
[string]$Source = 't:\',
[string]$Destination = 'x:\DCU',
[string]$XMLFile
)
function Copy-Folder {
[CmdletBinding()]
param
(
[string]$SourceFolder,
[string]$DestinationFolder,
[ValidateSet($true, $false)][boolean]$Subfolders = $false,
[ValidateSet($true, $false)][boo... |
combined_dataset/train/non-malicious/sample_7_27.ps1 | sample_7_27.ps1 | @{
GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
FunctionsToExport = @()
CmdletsToExport = "Get-Credential", "Get-ExecutionP... |
combined_dataset/train/non-malicious/sample_50_60.ps1 | sample_50_60.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
<#
This file implements the copying of the Azur... |
combined_dataset/train/non-malicious/1781.ps1 | 1781.ps1 |
Describe "Start-Transcript, Stop-Transcript tests" -tags "CI" {
BeforeAll {
function ValidateTranscription {
param (
[string] $scriptToExecute,
[string] $outputFilePath,
[switch] $append,
[switch] $noClobber,
[st... |
combined_dataset/train/non-malicious/sample_41_10.ps1 | sample_41_10.ps1 | # Localized 06/28/2023 07:56 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Vianmääritys
Troubleshoot_DetectNetworkCache=Tarkistetaan Windows Media Playerin verkkovälimuistia...
Resolution_Title=Ratkaisu
Resolution_ResetConfiguration=Nollataan kaikkia määrit... |
combined_dataset/train/non-malicious/Get-OnlineHelp_1.ps1 | Get-OnlineHelp_1.ps1 | ## An update using New-WebServiceProxy to the MSDN ContentService instead of HttpRest
## See: http: //services.msdn.microsoft.com/ContentServices/ContentService.asmx
## This is a VERY EARLY prototype of a function that could retrieve cmdlet help from TechNet ...
## and hypothetically, other online help sites which... |
combined_dataset/train/non-malicious/HTML Parse Demo.ps1 | HTML Parse Demo.ps1 | $page = Invoke-WebRequest "http://www.apk.se"
$html = $page.parsedHTML
$products = $html.body.getElementsByTagName("TR")
$headers = @()
foreach($product in $products)
{
$colID = 0;
$hRow = $false
$returnObject = New-Object Object
foreach($child in $product.children)
{
if ($child.tagName -eq "TH")
... |
combined_dataset/train/non-malicious/sample_50_25.ps1 | sample_50_25.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 = '74.1.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/get-ESXiHostConfigBackup_2.ps1 | get-ESXiHostConfigBackup_2.ps1 | <#
.SYNOPSIS
Creates config bundle backup for ESXi hosts. Works where 80 is blocked to ESXi host
Originally script by Alan Renouf (http://www.virtu-al.net/2011/02/23/backing-up-the-esxi-system-image)
Heavily Modified by Jimmy Hester
.DESCRIPTION
Checks for connection to a vCenter or ESXi server
If not connected... |
combined_dataset/train/non-malicious/PowerWatin 0.5.ps1 | PowerWatin 0.5.ps1 | ## CHANGE this to point to your WatiN.Core.dll
$WatinPath = Convert-Path (Resolve-Path "$(Split-Path $Profile)\\Libraries\\Watin2\\WatiN.Core.dll")
## Load the assembly
$global:watin = [Reflection.Assembly]::LoadFrom( $WatinPath )
$WFind = [Watin.Core.Find]
## The rest of this is generated ... I've pasted the ... |
combined_dataset/train/non-malicious/2256.ps1 | 2256.ps1 | $TSEnvironment = New-Object -ComObject Microsoft.SMS.TSEnvironment
$Variables = $TSEnvironment.GetVariables()
$Variables | ForEach-Object {
Add-Content -Path "$($env:SystemDrive)\Windows\Temp\OSDVariables.log" -Value "
Add-Content -Path "$($env:SystemDrive)\Windows\Temp\OSDVariables.log" -Value $TSEnvironment.V... |
combined_dataset/train/non-malicious/sample_20_5.ps1 | sample_20_5.ps1 | ConvertFrom-StringData @'
id_network=Collecting network data
id_autotuning=Collecting autotuning data
id_firewall=Collecting Windows Firewall configuration
id_netstat=Running netstat
id_winsock=Collecting winsock data
id_pac=Collecting existing PAC and WPAD files
'@
# SIG # Begin signature block
# MIIoLQYJKo... |
combined_dataset/train/non-malicious/sample_17_84.ps1 | sample_17_84.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... |
combined_dataset/train/non-malicious/sample_37_28.ps1 | sample_37_28.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_30_77.ps1 | sample_30_77.ps1 | #
# Module manifest for module 'OCI.PSModules.Loganalytics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loganalytics.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_47_44.ps1 | sample_47_44.ps1 | #
# Module manifest for module 'OCI.PSModules.Filestorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Filestorage.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_38_58.ps1 | sample_38_58.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 = '73.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/TruncatePath_3.ps1 | TruncatePath_3.ps1 | ###
# TruncatePath
# Version 1.0.6 (05 Nov 2008)
# Description: Replaces long provider paths in the prompt with ellipses
# Notes: Place in your profile
#
# By Mike Hays, http://www.mike-hays.net
###
$maxPathLength = 40
$showFullPath = $false
Function Prompt
{
$currentPath = (Get-Location).Path
... |
combined_dataset/train/non-malicious/sample_54_41.ps1 | sample_54_41.ps1 | #requires -Version 5.0
enum BcArtifactSource {
OnPrem
Sandbox
Insider
}
#Import-Module (Join-Path $PSScriptRoot ClientContext\ClientContext.psd1)
#Import-Module (Join-Path $PSScriptRoot ClientContext\ClientContext.psm1)
#. "$PSScriptRoot\ClientContext\ClientContextLibLoader.ps1" -BcLibVersion (G... |
combined_dataset/train/non-malicious/sample_26_11.ps1 | sample_26_11.ps1 | #
# Module manifest for module 'OCI.PSModules.Bds'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bds.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_37_14.ps1 | sample_37_14.ps1 | <#
.SYNOPSIS
Sets a secret in one vault to be the same as another. Temporary workaround for issues in secret
layout. Assumes that the Keyvaults are in the same subscription and that the current context
is set to that subscription.
.PARAMETER SourceVaultName
Vault where the source secret is located
.PARAMETER SourceSe... |
combined_dataset/train/non-malicious/671.ps1 | 671.ps1 |
Describe "Out-RsFolderContent" {
Context "Out-RsFolderContent with min parameters"{
$folderName = 'SutOutRsFolderContentMinParameters' + [guid]::NewGuid()
New-RsFolder -Path / -FolderName $folderName
$rsFolderPath = '/' + $folderName
$localReso... |
combined_dataset/train/non-malicious/Get-SqlWmi_1.ps1 | Get-SqlWmi_1.ps1 | try {add-type -AssemblyName "Microsoft.SqlServer.SqlWmiManagement, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop}
catch {add-type -AssemblyName "Microsoft.SqlServer.SqlWmiManagement"}
#######################
<#
.SYNOPSIS
Gets SQL Server WMI information.
.DESCRIPTION
The Get-SqlWm... |
combined_dataset/train/non-malicious/sample_36_59.ps1 | sample_36_59.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/Get-GrowthRate_4.ps1 | Get-GrowthRate_4.ps1 | function Get-GrowthRate {
param( $Start, $End, $Period )
@@ $rate = [math]::Abs( [math]::Pow( ( $End / $Start ),( 1 / $Period - 1 ) ) - 1 )
"{0:P}" -f $rate
}
|
combined_dataset/train/non-malicious/Get-Field.ps1 | Get-Field.ps1 | function Get-Field{
[CmdletBinding()]
param (
[Parameter(Position=0,Mandatory=$true)]
$InputObject
)
$type = $InputObject.gettype()
$publicNonPublic = [Reflection.BindingFlags]::Public -bor [Reflection.BindingFlags]::NonPublic
$instance = $publicNonPublic -bor [Reflection.BindingFlags]::Instance... |
combined_dataset/train/non-malicious/sample_41_60.ps1 | sample_41_60.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Invoke-AMTForceBoot {
<#
.Synopsis
Invokes the Intel Active Management Technology force boot command
.Description
This CmdLet invokes an Intel Active Management Technology (AMT) force boot to a PXE server, the local hard ... |
combined_dataset/train/non-malicious/sample_15_39.ps1 | sample_15_39.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudguard'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudguard.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/ISE-FileName.ps1 | ISE-FileName.ps1 | #requires -version 2.0
## ISE-FileName module v 1.0
##############################################################################################################
## Provides File and Path cmdlets for working with ISE
## Copy-ISEFullPath - Copy the full path of the current file to the clipboard
## Copy-ISEPath - C... |
combined_dataset/train/non-malicious/sample_12_79.ps1 | sample_12_79.ps1 | # Copyright ?2008, Microsoft Corporation. All rights reserved.
# You may use this code and information and create derivative works of it,
# provided that the following conditions are met:
# 1. This code and information and any derivative works may only be used for
# troubleshooting a) Windows and b) products for ... |
combined_dataset/train/non-malicious/sample_61_46.ps1 | sample_61_46.ps1 | <#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2021 v5.8.194
Created on: 10/19/2021 3:50 PM
Created by: ksarens
Updated 10/26/2102
fixing error in help information
adding support for offline... |
combined_dataset/train/non-malicious/sample_64_15.ps1 | sample_64_15.ps1 | #
# Module manifest for module 'OCI.PSModules.Goldengate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Goldengate.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_60_66.ps1 | sample_60_66.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 Copy-ToTemp
{
... |
combined_dataset/train/non-malicious/sample_3_33.ps1 | sample_3_33.ps1 | ConvertFrom-StringData @'
id_citrixappsensecheck=Checking the presence of Citrix AppSense
id_citrixappsensecheckdesc=Checking if Citrix AppSense is installed on machine
id_citrixappsensecheckrs=Appsense application with EM 8.1 was detected in conjunction with Citrix Servers. This may cause logoff and disconnect issu... |
combined_dataset/train/non-malicious/684.ps1 | 684.ps1 |
function Set-RsUrlReservation
{
[cmdletbinding()]
param
(
[string]
$ReportServerVirtualDirectory = "ReportServer",
[string]
$PortalVirtualDirectory="Reports",
[Alias('SqlServerInstance')]
[string]
$ReportServerInstance,
... |
combined_dataset/train/non-malicious/Set-SendAs.ps1 | Set-SendAs.ps1 | # NAME
# Set-SendAs
#
# SYNOPSIS
# Use the Set-SendAs cmdlet to grant or Remove SendAs permissions on a mailbox
#
# SYNTAX
# Set-SendAs -Identity <MailboxIdParameter> -SendAs <MailboxIdParameter> -ou <OrganizationalUnit> [-Remove <SwitchParameter> [-Confirm [<SwitchParameter>]]] [-DomainController <Fqdn>]
... |
combined_dataset/train/non-malicious/sample_8_59.ps1 | sample_8_59.ps1 | ConvertFrom-StringData @'
progressbar_id_crm_org_version_deployment_check=Verifying Organization Databases Revision Not Greater Than Deployment Revision
progressbar_id_crm_org_version_deployment_checkdesc=Verifying Organization Databases Revision Not Greater Than Deployment Revision
'@
# SIG # Begin signature blo... |
combined_dataset/train/non-malicious/update-powerpackcolumns.ps1 | update-powerpackcolumns.ps1 | ###################################################################
# Update Columns in PowerPacks
###################################################################
# (c) Dmitry Sotnikov
# http://dmitrysotnikov.wordpress.com
###################################################################
# This script is de... |
combined_dataset/train/non-malicious/1745.ps1 | 1745.ps1 |
[CmdletBinding(DefaultParameterSetName = "Daily")]
param(
[Parameter(ParameterSetName = "Daily")]
[string] $Destination,
[Parameter(ParameterSetName = "Daily")]
[switch] $Daily,
[Parameter(ParameterSetName = "Daily")]
[switch] $DoNotOverwrite,
[Parameter(ParameterSetName = "Daily")]
... |
combined_dataset/train/non-malicious/1553.ps1 | 1553.ps1 |
function Out-MrReverseString {
[CmdletBinding()]
param (
[Parameter(Mandatory,
ValueFromPipeline)]
[string[]]$String
)
PROCESS {
foreach ($s in $String) {
$Array = $s -split ''
[System.Array]::Reverse($Array)
Write-Outpu... |
combined_dataset/train/non-malicious/586.ps1 | 586.ps1 |
function Connect-SCP{
param (
[parameter(Mandatory=$true)]
[string[]]
$Name,
[parameter(Mandatory=$false)]
[string]$User,
[parameter(Mandatory=$false)]
[int]$Port,
[parameter(Mandatory=$false)]
[string]$Privat... |
combined_dataset/train/non-malicious/sample_16_13.ps1 | sample_16_13.ps1 | #
# Script module for module 'PackageManagement'
#
Set-StrictMode -Version Latest
Microsoft.PowerShell.Utility\Import-LocalizedData LocalizedData -filename PackageManagement.Resources.psd1
# Summary: PackageManagement is supported on Windows PowerShell 3.0 or later, Nano Server and PowerShellCore
$isCore = ($P... |
combined_dataset/train/non-malicious/sample_27_5.ps1 | sample_27_5.ps1 | <#
.SYNOPSIS
Parent script that runs all other scripts required to build Salt
.DESCRIPTION
This script Cleans, Installs Dependencies, Builds Python, Installs Salt,
and builds the NullSoft Installer. It depends on the following Scripts
and are called in this order:
- clean_env.ps1
- install_nsis.ps1
- build_python.ps1... |
combined_dataset/train/non-malicious/Download DefragTools .ps1 | Download DefragTools .ps1 | #requires -version 2.0
<#
.Synopsis
Downloads Channel 9 Defrag Tool Episode Video
.DESCRIPTION
Downloads Channel 9 Defrag Tool Episode Video in the format selected and to a given path.
.EXAMPLE
Downloads all shows in WMV format to the default Downloads Folder for the user.
Get-DefragToolsShow -All... |
combined_dataset/train/non-malicious/chkhash_6.ps1 | chkhash_6.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/371.ps1 | 371.ps1 | function Complete
{
[CmdletBinding()]
param (
[string]
$Expression
)
process
{
[System.Management.Automation.CommandCompletion]::CompleteInput(
$Expression,
$Expression.Length,
$null
).CompletionMatches
}
}
Describe 'Completion tests: input' {
It 'can complete input from Get-ChildItem' {
Comp... |
combined_dataset/train/non-malicious/sample_3_78.ps1 | sample_3_78.ps1 | ConvertFrom-StringData @'
id_maxconcurrentapilite_st=MaxConcurrentApi Problems Detected
id_mcalite_status=MaxConcurrentApi Problem Detection
id_mcalite_wait=Performance counters are being examined for MaxConcurrentApi NTLM load issues.
'@
# SIG # Begin signature block
# MIIoVAYJKoZIhvcNAQcCoIIoRTCCKEECAQExDzANB... |
combined_dataset/train/non-malicious/chkhash_9.ps1 | chkhash_9.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_29_73.ps1 | sample_29_73.ps1 | #
# Module manifest for module 'OCI.PSModules.Emaildataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emaildataplane.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSE... |
combined_dataset/train/non-malicious/Audit Script_1.ps1 | Audit Script_1.ps1 | #####################################################
#
# Audit script by Alan Renouf - Virtu-Al #
#
# Blog: http://teckinfo.blogspot.com/ #
#
# #
#
# Usage: Audit.ps1 'path' #
#
# ... |
combined_dataset/train/non-malicious/2584.ps1 | 2584.ps1 | Clear-Host
[Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo")
[int]$numOfPerfmonCollections = 2
[int]$intervalOfCollections = 2
$physicalcounters = ("\Memory\Available MBytes") `
,("\PhysicalDisk(_Total)\Avg. Disk sec/Read")`
,("\PhysicalDisk(_Total)\Avg. Disk sec/Write") `
,("\Processor(_Tot... |
combined_dataset/train/non-malicious/sample_1_40.ps1 | sample_1_40.ps1 | ConvertFrom-StringData @'
id_ctsbitsserver=BITS Server Component
id_ctsbitsserverdescription=Collects information about the BITS server component.
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNL... |
combined_dataset/train/non-malicious/sample_38_79.ps1 | sample_38_79.ps1 | # These Pester tests are for the for parameter-* and ex-path* snippets.
# Take a look at the .vscode\tasks.json file to see how you can create
# and configure a test task runner that will run all the Pester tests
# in your workspace folder.
# To run these Pester tests, press Ctrl+Shift+T or press Ctrl+Shift+P,
#... |
combined_dataset/train/non-malicious/GPRS Online log_4.ps1 | GPRS Online log_4.ps1 | <#
.SYNOPSIS
Get-GprsTime (V3.0 Update for Windows 7) Check the total connect time of any
GPRS devices from a specified date.
Use Get-Help .\\Get-GprsTime -full to view Help for this file.
.DESCRIPTION
Display all the GPRS modem Event Log entries. While applications issued by the
mobile phone manufacturers wi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.