full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/71.ps1 | 71.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aa... |
combined_dataset/train/non-malicious/sample_24_37.ps1 | sample_24_37.ps1 | # Compiling Piglit
$ProgressPreference = "SilentlyContinue"
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
. "$MyPath\mesa_init_msvc.ps1"
$source_dir = Join-Path -Path "$PWD" -ChildPath "src"
$waffle_source = Join-Path -Path "$source_dir" -ChildPath "waffle"
$waffle_install = Join-Path -Path "$PWD" -Chil... |
combined_dataset/train/non-malicious/sample_18_43.ps1 | sample_18_43.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.a... |
combined_dataset/train/non-malicious/sample_30_97.ps1 | sample_30_97.ps1 | Add-AppxPackage
exit
cd C:\Users\sampler-win_10_x64\Desktop\
Get-AppxPackage >apps.tx
cd C:\Users\sampler-win_10_x64\Desktop\
Get-AppxPackage -allusers | Select Name, PackageFullName > apps_v2.txt
Get-AppxPackage | Select Name, PackageFullName > apps_v2.txt
Get-AppxPackage
Get-AppxPackage -Online
Get-AppxPacka... |
combined_dataset/train/non-malicious/2303.ps1 | 2303.ps1 |
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline,
ValueFromPipelineByPropertyName)]
[ValidateScript({ Test-Connection $_ -Quiet -Count 1 })]
[string[]]$Computername = 'localhost',
[Parameter()]
[ValidateRange(20, 120)]
[int]$PasswordLength = 50,
[Parameter(Mandatory)]
[string]$PasswordF... |
combined_dataset/train/non-malicious/sample_62_56.ps1 | sample_62_56.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param (
[Parameter(Manda... |
combined_dataset/train/non-malicious/sample_24_64.ps1 | sample_24_64.ps1 | #
# Module manifest for module 'OCI.PSModules.Datascience'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datascience.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/759.ps1 | 759.ps1 | param([int]$Count=50, [int]$DelayMilliseconds=200)
function Write-Item($itemCount) {
$i = 1
while ($i -le $itemCount) {
$str = "Output $i"
Write-Output $str
$i = $i + 1
Start-Sleep -Milliseconds $DelayMilliseconds
}
}
function Do-Work($workC... |
combined_dataset/train/non-malicious/sample_30_95.ps1 | sample_30_95.ps1 | #
# Module manifest for module 'OCI.PSModules.Events'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Events.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/2666.ps1 | 2666.ps1 |
Set-PSReadlineOption -Color @{
"Command" = [ConsoleColor]::Green
"Parameter" = [ConsoleColor]::Gray
"Operator" = [ConsoleColor]::Magenta
"Variable" = [ConsoleColor]::White
"String" = [ConsoleColor]::Yellow
"Number" = [ConsoleColor]::Blue
"Type" = [ConsoleColor]::Cyan
"Comment" = [Consol... |
combined_dataset/train/non-malicious/sample_29_37.ps1 | sample_29_37.ps1 | #
# Module manifest for module 'OCI.PSModules.Certificatesmanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Certificatesmanagement.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
... |
combined_dataset/train/non-malicious/1095.ps1 | 1095.ps1 |
if( (Get-WmiObject -Class 'Win32_ComputerSystem').Domain -eq 'WORKGROUP' )
{
Write-Warning -Message ('Get-ADDomainController tests can''t run because this computer is not part of a domain.')
}
else
{
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-... |
combined_dataset/train/non-malicious/GUI process explorer.ps1 | GUI process explorer.ps1 | function BuildProcessesList {
$arr = New-Object Collections.ArrayList
$script:col = ps | select Name, Id, BasePriority, Description, Company | sort Name
$arr.AddRange($col)
$dtgGrid.DataSource = $arr
$frmMain.Refresh()
}
function SelectedItemModules {
$ErrorActionPreference = "SilentlyContinue"
... |
combined_dataset/train/non-malicious/sample_6_31.ps1 | sample_6_31.ps1 | # 2023-02-24 WalterE mod Trap #we#
$startTime_AutoAdd = Get-Date
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_"
}
Write-Host -Background... |
combined_dataset/train/non-malicious/381.ps1 | 381.ps1 | Describe "Unregister-PSFConfig Unit Tests" -Tag "CI", "Pipeline", "Unit" {
BeforeAll {
Get-PSFConfig -Module Unregister-PSFConfig -Force | ForEach-Object {
$null = [PSFramework.Configuration.ConfigurationHost]::Configurations.Remove($_.FullName)
}
}
AfterAll {
Get-PSFConfig -Module Unregister-PSFConfig -For... |
combined_dataset/train/non-malicious/4369.ps1 | 4369.ps1 | function Get-First
{
param
(
[Parameter(Mandatory=$true)]
$IEnumerator
)
foreach($item in $IEnumerator)
{
return $item
}
return $null
} |
combined_dataset/train/non-malicious/4481.ps1 | 4481.ps1 |
configuration PSModule_InstallModuleConfig
{
param
(
[Parameter()]
[System.String[]]
$NodeName = 'localhost',
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String]
$ModuleName
)
Import-DscResource -ModuleName 'PowerShellG... |
combined_dataset/train/non-malicious/New-HyperVVM.ps1 | New-HyperVVM.ps1 | function New-HyperVVM {
param (
[string]$Hypervhost = "localhost",
[string]$Vm = "VM Courtesy of PowerShell",
[string]$location = "C:\\MyVirtualMachines\\$vm"
)
$wmiClassString = "\\\\" + $Hypervhost + "\\root\\virtualization:Msvm_VirtualSystemGlobalSettingData"
$wmiclass = [WMIClass]$wmiClassStri... |
combined_dataset/train/non-malicious/1235.ps1 | 1235.ps1 |
if( $IsWindows -and [Environment]::Is64BitOperatingSystem -and [Environment]::Is64BitProcess )
{
Write-Timing ('Dot-sourcing Initialize-Lcm.ps1')
. (Join-Path -Path $functionRoot -ChildPath 'Initialize-Lcm.ps1')
}
|
combined_dataset/train/non-malicious/sample_4_2.ps1 | sample_4_2.ps1 | ConvertFrom-StringData @'
id_dpm_information=DPM Information
id_dpm_errorlogs_files=DPM Errorlog Files
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAF... |
combined_dataset/train/non-malicious/sample_49_52.ps1 | sample_49_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/1767.ps1 | 1767.ps1 |
try
{
$defaultParamValues = $PSDefaultParameterValues.Clone()
$PSDefaultParameterValues["it:Skip"] = !$IsWindows
Describe "AMSI scan should detect suspicious content" -Tags 'Feature','RequireAdminOnWindows' {
BeforeAll {
[System.Management.Automation.Internal.InternalTestHooks]::Set... |
combined_dataset/train/non-malicious/4127.ps1 | 4127.ps1 | $LastInfection = get-winevent -filterhashtable @{ logname = 'system'; ID = 1116 } -maxevents 1 -ErrorAction SilentlyContinue
$LastFullScan = get-winevent -filterhashtable @{ logname = 'system'; ID = 1118 } -maxevents 1 -ErrorAction SilentlyContinue
If (($LastFullScan.TimeCreated -lt $LastInfection.TimeCreated) -or ($La... |
combined_dataset/train/non-malicious/sample_56_62.ps1 | sample_56_62.ps1 | $timestamp = get-date -uformat %Y%m%d-%k%M%S
$transcriptPath = "$($env:temp)\StorageSyncAgent-SetRegPIIAclSettings-$($timestamp).log"
Start-Transcript -Path $transcriptPath
# The following script removes read permissions from registry key locations which may contain PII information.
$regPaths = 'HKLM:\Software\Mi... |
combined_dataset/train/non-malicious/Get-FileEncoding_4.ps1 | Get-FileEncoding_4.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/sample_50_77.ps1 | sample_50_77.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Get-AMTUserConsent {
<#
.Synopsis
Gets the Intel Active Management Technology user consent state
.Description
This CmdLet gets the Intel Active Management Technology (AMT) user consent state from clients that have Intel AM... |
combined_dataset/train/non-malicious/2498.ps1 | 2498.ps1 |
function invoke-sql
{
param(
[Parameter(Mandatory = $True)]
[string]$Query,
[Parameter(Mandatory = $True)]
[string]$DBName,
[Parameter(Mandatory = $True)]
[string]$DBServerName
)
$QueryTimeout = 36000
$ConnectionTimeout = 36000
$conn = New-Object System.Data.SqlClient.SQLCo... |
combined_dataset/train/non-malicious/sample_63_38.ps1 | sample_63_38.ps1 | param(
[string]$rootDirectory
)
# Validate root directory parameter
if ([string]::IsNullOrWhiteSpace($rootDirectory)) {
Write-Host "Error: Root directory path is required."
exit 1
}
# Print the paths to confirm they are being set correctly
Write-Host "Root Directory Path: $rootDirectory"
# D... |
combined_dataset/train/non-malicious/Autoload Module_1.ps1 | Autoload Module_1.ps1 | #Requires -Version 2.0
## Automatically load functions from scripts on-demand, instead of having to dot-source them ahead of time, or reparse them from the script every time.
## Provides significant memory benefits over pre-loading all your functions, and significant performance benefits over using plain scripts. Ca... |
combined_dataset/train/non-malicious/3583.ps1 | 3583.ps1 |
function Test-CreateAndGetService
{
$rg = Create-ResourceGroupForTest
try
{
$service = Create-DataMigrationService($rg)
$all = Get-AzDataMigrationService -ResourceGroupName $rg.ResourceGroupName
Assert-AreEqual 1 $all.Count
$all = Get-AzDataMigrationService -ResourceGroupName $rg.Resou... |
combined_dataset/train/non-malicious/Get-RemoteRegistry_3.ps1 | Get-RemoteRegistry_3.ps1 | #.SYNOPSIS
# Query the registry on a remote machine
#.NOTE
# You have to have access, and the remote registry service has to be running
#
# Version History:
# 3.0
# + updated to PowerShell 2
# + support pipeline parameter for path
# 2.1
# + Fixed a pasting bug
# + I added the ... |
combined_dataset/train/non-malicious/sample_50_28.ps1 | sample_50_28.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 = '77.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_26_63.ps1 | sample_26_63.ps1 | #
# Module manifest for module 'OCI.PSModules'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
# ID u... |
combined_dataset/train/non-malicious/1324.ps1 | 1324.ps1 |
function Disable-CFirewallStatefulFtp
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
if( -not (Assert-CFirewallConfigurable) )
{
return
}
Inv... |
combined_dataset/train/non-malicious/2141.ps1 | 2141.ps1 |
set-strictmode -v 2
Describe 'for statement parsing' -Tags "CI" {
ShouldBeParseError 'for' MissingOpenParenthesisAfterKeyword 4 -CheckColumnNumber
ShouldBeParseError 'for(' MissingEndParenthesisAfterStatement 5 -CheckColumnNumber
ShouldBeParseError 'for(;' MissingEndParenthesisAfterStatement 6 -CheckColu... |
combined_dataset/train/non-malicious/sample_43_90.ps1 | sample_43_90.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=O módulo PowerShell (FailoverClusters) necessário não foi encontrado. Utilize a Ferramenta de Funções e Funcionalidades para instalar: Ferramentas de Administração Remota do Servidor | Ferramentas de Administração de Funcionalidades | Ferramentas de Clustering d... |
combined_dataset/train/non-malicious/sample_42_26.ps1 | sample_42_26.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmcontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmcontrolplane.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_27_79.ps1 | sample_27_79.ps1 | #
# Module manifest for module 'OCI.PSModules.Operatoraccesscontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Operatoraccesscontrol.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
#... |
combined_dataset/train/non-malicious/Get-LastReboot.ps1 | Get-LastReboot.ps1 | Param (
[Parameter(Position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$true)]
[alias("Name","ComputerName")]$Computer=@($env:ComputerName),
[switch] $Output
)
process{
if (Test-Connection -ComputerName $Computer -Count 1 -Quiet){
write-host "Getting Uptime for $Computer" -foregroundcolor green... |
combined_dataset/train/non-malicious/1774.ps1 | 1774.ps1 |
Import-Module HelpersSecurity
try
{
$defaultParamValues = $PSDefaultParameterValues.Clone()
$PSDefaultParameterValues["it:Skip"] = !$IsWindows
Describe "Help built-in function should not expose nested module private functions when run on locked down systems" -Tags 'Feature','RequireAdminOnWin... |
combined_dataset/train/non-malicious/Start-Encryption_2.ps1 | Start-Encryption_2.ps1 | ## Start-Encryption
##################################################################################################
## Rijndael symmetric key encryption ... with no passes on the key. Very lazy.
## USAGE:
## $encrypted = Encrypt-String "Oisin Grehan is a genius" "P@ssw0rd"
## Decrypt-String $encrypted "P@ssw0rd... |
combined_dataset/train/non-malicious/Search-StartMenu.ps1 | Search-StartMenu.ps1 | ##############################################################################\n##\n## Search-StartMenu\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/blog)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nSearch t... |
combined_dataset/train/non-malicious/Set-Computername_13.ps1 | Set-Computername_13.ps1 | function Set-ComputerName {
param( [switch]$help,
[string]$originalPCName=$(read-host "Please specify the current name of the computer"),
[string]$computerName=$(read-host "Please specify the new name of the computer"))
$usage = "set-ComputerName -originalPCname CurrentName -computername AnewName"
if (... |
combined_dataset/train/non-malicious/CLR4 module.ps1 | CLR4 module.ps1 | function Start-CLR4 {
[CmdletBinding()]
param ( [string] $cmd )
if ($PSVersionTable.CLRVersion.Major -eq 4)
{
write-debug 'already running clr 4'
invoke-expression $cmd;
return
}
$RunActivationConfigPath = resolve-path ~ | Join-Path -ChildPath .CLR4PowerShell;
... |
combined_dataset/train/non-malicious/399.ps1 | 399.ps1 | $scriptBlock = {
$script:___ScriptName = 'psframework.taskengine'
try
{
while ($true)
{
if ([PSFramework.Runspace.RunspaceHost]::Runspaces[$___ScriptName.ToLower()].State -notlike "Running")
{
break
}
$task = $null
$tasksDone = @()
while ($task = [PSFramework.TaskEngine.TaskHos... |
combined_dataset/train/non-malicious/sample_44_15.ps1 | sample_44_15.ps1 | # escape=`
# This Dockerfile will only build on Docker for Windows.
#
# If you change dependencies etc here, please also check and update
# the other Windows build resources:
#
# - DEVELOPER_GUIDE.md "Windows" section
# - appveyor.yml
# - .github/workflows/call-build-windows.yaml
# - dockerfiles/Dockerfile.windows
#
... |
combined_dataset/train/non-malicious/1321.ps1 | 1321.ps1 |
function Remove-CSslCertificateBinding
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[IPAddress]
$IPAddress = '0.0.0.0',
[UInt16]
$Port = 443
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session ... |
combined_dataset/train/non-malicious/Get-WebSite_2.ps1 | Get-WebSite_2.ps1 | function Get-WebPage {
<#
.SYNOPSIS
Downloads web page from site.
.DESCRIPTION
Downloads web page from site and displays source code or displays total bytes of webpage downloaded
.PARAMETER Url
URL of the website to test access to.
.PARAMETER UseDefaultCredentials
Use the currently authentica... |
combined_dataset/train/non-malicious/sample_24_34.ps1 | sample_24_34.ps1 | Manifest-Version: 1.0
Name: com/q1labs/sem/dsm/checkpoint/firewall/CheckPoint$SysEnum.class
SHA-256-Digest: Dim/Do7LRwT7Wvac11np/+Ykp7+A1taXnG153xK7eVo=
Name: com/q1labs/sem/dsm/checkpoint/firewall/CheckPointConfigParameter
s.class
SHA-256-Digest: aZ9YC9A2Va3saVusmXFad4rUuNsBySK8or8eDH4QEhw=
Name: com/q1la... |
combined_dataset/train/non-malicious/563.ps1 | 563.ps1 |
function Test-SPOField
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[Microsoft.SharePoint.Client.List] $list,
[Parameter(Mandatory=$true, Position=2)]
[Microsoft.SharePoint.Client.FieldCollection] $fields,
[Parameter(Mandatory=$true, Position=3)]
[string] $fieldName
)
... |
combined_dataset/train/non-malicious/1830.ps1 | 1830.ps1 |
Import-Module HelpersCommon
Describe "Test-Connection" -tags "CI" {
BeforeAll {
$oldInformationPreference = $InformationPreference
$oldProgressPreference = $ProgressPreference
$InformationPreference = "Ignore"
$ProgressPreference = "SilentlyContinue"
$hostName = [System.... |
combined_dataset/train/non-malicious/sample_24_59.ps1 | sample_24_59.ps1 | #
# Module manifest for module 'OCI.PSModules.Keymanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Keymanagement.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/410.ps1 | 410.ps1 | function Convert-PsfMessageException
{
[CmdletBinding()]
Param (
[Parameter(Mandatory = $true)]
$Exception,
[Parameter(Mandatory = $true)]
[string]
$FunctionName,
[Parameter(Mandatory = $true)]
[string]
$ModuleName
)
if ($null -eq $Exception) { return }
$typeName = $Exception.GetType().... |
combined_dataset/train/non-malicious/sample_15_54.ps1 | sample_15_54.ps1 | <#
.Synopsis
Activate a Python virtual environment for the current PowerShell session.
.Description
Pushes the python executable for a virtual environment to the front of the
$Env:PATH environment variable and sets the prompt to signify that you are
in a Python virtual environment. Makes use of the command line... |
combined_dataset/train/non-malicious/sample_28_15.ps1 | sample_28_15.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'ht... |
combined_dataset/train/non-malicious/sample_44_90.ps1 | sample_44_90.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_0.ps1 | sample_15_0.ps1 | #************************************************
# DC_ExchangeServerEventLogs.ps1
# Version 1.2.0
# Date: 2013-05-21
# Author: Brian Prince - brianpr@microsoft.com
# Description: This script calls TS_GetEvents.ps1 to export Exchange Server and backup -related event logs
#*****************************************... |
combined_dataset/train/non-malicious/2846.ps1 | 2846.ps1 | function LoadModules {
$currentConfig = $psake.context.peek().config
if ($currentConfig.modules) {
$scope = $currentConfig.moduleScope
$global = [string]::Equals($scope, "global", [StringComparison]::CurrentCultureIgnoreCase)
$currentConfig.modules | ForEach-Object {
resol... |
combined_dataset/train/non-malicious/Snippet Compiler_2.ps1 | Snippet Compiler_2.ps1 | #Required 2.0
$def = $(if ((gi .).FullName -eq (gi .).Root) {
([string](gi .).Root).TrimEnd("\\")
}
else { (gi .).FullName }
)
##################################################################################################
$mnuOpen_Click= {
(New-Object Windows.Forms.O... |
combined_dataset/train/non-malicious/239.ps1 | 239.ps1 | function Get-NetFrameworkTypeAccelerator
{
[Alias('Get-Acceletrator')]
PARAM ()
[System.Management.Automation.PSObject].Assembly.GetType("System.Management.Automation.TypeAccelerators")::get
} |
combined_dataset/train/non-malicious/New-Struct 3.ps1 | New-Struct 3.ps1 | function New-Struct {
#.Synopsis
# Creates Struct types from a list of types and properties
#.Description
# A wrapper for Add-Type to create struct types.
#.Example
# New-Struct Song {
# [string]$Artist
# [string]$Album
# [string]$Name
# [TimeSpan]$Length
# } -CreateConstructorFunction
#
#... |
combined_dataset/train/non-malicious/sample_41_18.ps1 | sample_41_18.ps1 | #
# Module manifest for module 'OCI.PSModules.Disasterrecovery'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Disasterrecovery.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported... |
combined_dataset/train/non-malicious/sample_21_24.ps1 | sample_21_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.
# ------------------------------------------------------------
##
## TODO: Refactor the cer... |
combined_dataset/train/non-malicious/sample_30_2.ps1 | sample_30_2.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydomains'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydomains.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported P... |
combined_dataset/train/non-malicious/Test-IsAdmin.ps1 | Test-IsAdmin.ps1 | Function Test-IsAdmin
{
<#
.SYNOPSIS
Function used to detect if current user is an Administrator.
.DESCRIPTION
Function used to detect if current user is an Administrator. Presents a menu if not an Administrator
.NOTES
Name: Test-IsAdmin
Author: Boe Pro... |
combined_dataset/train/non-malicious/sample_25_92.ps1 | sample_25_92.ps1 | version: '{build}'
skip_tags: true
clone_depth: 30
environment:
JAVA_HOME: C:\Program Files\Java\jdk11
install:
- ps: |
Add-Type -AssemblyName System.IO.Compression.FileSystem
if (!(Test-Path -Path "C:\maven\apache-maven-3.8.4" )) {
(new-object System.Net.WebClient).DownloadFile(
'ht... |
combined_dataset/train/non-malicious/1277.ps1 | 1277.ps1 |
function Unlock-CIisConfigurationSection
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string[]]
$SectionPath
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $Execu... |
combined_dataset/train/non-malicious/sample_4_84.ps1 | sample_4_84.ps1 | # Localized 10/16/2024 05:34 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Sì
PromptNoString=&No
BundleFound=Pacchetto trovato: {0}
PackageFound=Pacchetto trovato: {0}
EncryptedBundleFound=Bundle crittografato trovato: {0}
EncryptedPackag... |
combined_dataset/train/non-malicious/sample_23_66.ps1 | sample_23_66.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ServiceBus.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ServiceBus.internal.psm1'
if(Test-Path $internalModulePath) {
... |
combined_dataset/train/non-malicious/sample_19_78.ps1 | sample_19_78.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/sample_5_17.ps1 | sample_5_17.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcescheduler'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcescheduler.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
# Support... |
combined_dataset/train/non-malicious/New-StoredProcFunction_3.ps1 | New-StoredProcFunction_3.ps1 | # New-StoredProcFunction.ps1
# Steven Murawski
# http://blog.usepowershell.com
# 04/08/2009
# Replaced the parsing of the stored procedure text and use Information_Schema.Parameters to get the parameter information
# Thanks to Chad Miller for the idea.
# Example: ./New-StoredProcFunction.ps1 'Data Source=MySql... |
combined_dataset/train/non-malicious/Resolve-Aliases _1.7.ps1 | Resolve-Aliases _1.7.ps1 | #requires -version 2.0
## ResolveAliases Module v 1.6
########################################################################################################################
## Sample Use:
## Resolve-Aliases Script.ps1 | Set-Content Script.Resolved.ps1
## ls *.ps1 | Resolve-Aliases -Inplace
##############... |
combined_dataset/train/non-malicious/4056.ps1 | 4056.ps1 | param([string]$RootDir, [string]$CertThumbPrint = 'BB25149CDAF879A29DB6A011F6FC874AF32CBF51')
$cert = Get-ChildItem Cert:\CurrentUser\My\$CertThumbPrint
Get-ChildItem $RootDir -Recurse -Include *.ps1,*.psm1,*.ps1xml -File |
Where Name -ne 'Pscx.UserPreferences.ps1' |
Foreach {
Set-AuthenticodeSignatu... |
combined_dataset/train/non-malicious/sample_44_9.ps1 | sample_44_9.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/Remove-MyOldComputers.ps1 | Remove-MyOldComputers.ps1 | ##
# Remove-MyOldComputers.ps1
#
# Makes certian assumptions about your computers naming scheme: mainly that all your
# computers are named as follows: {username}* I.E. bob1, bob-test, bob-server, etc
#
##
param (
[String] $Name=((whoami).Split('\\')[1]),
[Int32] $MaxDaysOld=20
)
$root = [ADSI]''
... |
combined_dataset/train/non-malicious/608.ps1 | 608.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
[switch]$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://ola.hallengren.com/scripts/MaintenanceSolution.sql",
"http://ola.hallengren.com/scripts/DatabaseBackup.sql",
"http://ola.hallengren.com/scripts/DatabaseIntegrityCheck.sql",
"http://ola... |
combined_dataset/train/non-malicious/443.ps1 | 443.ps1 | Register-PSFConfigValidation -Name "datetime" -ScriptBlock {
Param (
$Value
)
$Result = New-Object PSObject -Property @{
Success = $True
Value = $null
Message = ""
}
try { [DateTime]$DateTime = $Value }
catch
{
$Result.Message = "Not a DateTime: $Value"
$Result.Success = $False
return $Result... |
combined_dataset/train/non-malicious/sample_56_30.ps1 | sample_56_30.ps1 | #
# Module manifest for module 'OCI.PSModules.Database'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Database.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/sample_27_48.ps1 | sample_27_48.ps1 | #
# Module manifest for module 'OCI.PSModules.Usage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Usage.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_48_38.ps1 | sample_48_38.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="C:\practice\demo\quick-reference\node_modules\.pnpm\node_modules"
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux ... |
combined_dataset/train/non-malicious/2519.ps1 | 2519.ps1 |
$MissingIndexesQuery =
"sel_SQLIndexesMissingByDatabase"
function Run-Query()
{
param (
$SqlQuery,
$SqlServer,
$SqlCatalog
)
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection("Data Source=$SqlServer;Integrated Security=SSPI;Initial Catalog=$SqlCatalog;");
$SqlCmd = New-Object System.Da... |
combined_dataset/train/non-malicious/2205.ps1 | 2205.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[ValidateNotNullOrEmpty()]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMessag... |
combined_dataset/train/non-malicious/1291.ps1 | 1291.ps1 |
function Get-CPermission
{
[CmdletBinding()]
[OutputType([System.Security.AccessControl.AccessRule])]
param(
[Parameter(Mandatory=$true)]
[string]
$Path,
[string]
$Identity,
[Switch]
$Inherited
)
... |
combined_dataset/train/non-malicious/Add new smtp_set prmary_2.ps1 | Add new smtp_set prmary_2.ps1 | #alias,addnewemailaddress
import-csv .\\source.csv | foreach {
$user = Get-Mailbox $_.alias
$user.emailAddresses+= $_.addnewemailaddress
$user.primarysmtpaddress = $_.addnewemailaddress
Set-Mailbox $user -emailAddresses $user.emailAddresses
set-Mailbox $user -PrimarySmtpAddress $user.primarysmtpaddress
}
|
combined_dataset/train/non-malicious/sample_40_88.ps1 | sample_40_88.ps1 | /* -----------------------------------------------------------------------
Copyright (c) Microsoft Corporation. All rights reserved.
----------------------------------------------------------------------- */
let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl();
let scripts = [plug... |
combined_dataset/train/non-malicious/Compare-Drive_1.ps1 | Compare-Drive_1.ps1 | param($ComputerName1,$ComputerName2)
$a = gwmi win32_volume -filter "DriveType=3" -computername $ComputerName1 | where {@('Y:','Z:') -notcontains $_.DriveLetter} | select name, @{n='capacity'; e={[math]::truncate($_.Capacity/1GB)}}
$b = gwmi win32_volume -filter "DriveType=3" -computername $ComputerName2 | where ... |
combined_dataset/train/non-malicious/sample_10_98.ps1 | sample_10_98.ps1 | ConvertFrom-StringData @'
id_dpm_eventlog_activity=Gathering Eventlogs
id_dpm_status_eventlogs=Running DC_DPMEventLogs.ps1
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAI... |
combined_dataset/train/non-malicious/Send-Mapi.ps1 | Send-Mapi.ps1 | ##############################################################################
#.AUTHOR
# Josh Einstein
# Einstein Technologies, LLC
##############################################################################
##############################################################################
#.SYNOPSIS
# Opens a... |
combined_dataset/train/non-malicious/4285.ps1 | 4285.ps1 | $scriptblock =
{
param ($Payload)
$PipeName = "PoshMSDaisy"
$p = [System.IO.Directory]::GetFiles("\\.\\pipe\\")
$start = $true
foreach ($i in $p) {
if ($i -like "*PoshMSDaisy") {
$start = $false
}
}
while ($start) {
add-Type -assembly "System.Core"
... |
combined_dataset/train/non-malicious/sample_15_94.ps1 | sample_15_94.ps1 | #
# Module manifest for module 'Microsoft.SME.StorageMigration'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.StorageMigration.psm1'
# Version number of this module.
ModuleVersion = '4.9.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ... |
combined_dataset/train/non-malicious/sample_29_69.ps1 | sample_29_69.ps1 | TОбмеження PrintAllTranslations та IgnoreTranslations не можна використовувати разом. oОбчислюваний стовпець "%{ccon_column/}" не можна додавати до гібридної таблиці "%{ccon_table/}". Вилучіть його.Не можна додавати стовпець "alternateOf", що використовується для агрегацій, до гібридної таблиці "%{ccon_table/}". Вилуч... |
combined_dataset/train/non-malicious/82bfeecc-3581-4dec-8684-4e98aef8a59a.ps1 | 82bfeecc-3581-4dec-8684-4e98aef8a59a.ps1 | # Enumerate fan speeds on an ESX host that is running WSMAN.
# This doesn't take advantage of CTP3's WSMAN cmdlets.
# Needs winrm installed.
$serverName = "your.server"
$user = "root"
$password = "password"
$x = [xml](winrm enumerate `
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor `
"-... |
combined_dataset/train/non-malicious/Format-Column 0.3.ps1 | Format-Column 0.3.ps1 | function global:Format-Column {
################################################################
#.Synopsis
# Formats incoming data to columns.
#.Description
# It works similarly as Format-Wide but it works vertically. Format-Wide outputs
# the data row by row, but Format-Columns outputs them column by column.... |
combined_dataset/train/non-malicious/sample_34_97.ps1 | sample_34_97.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/Script-Object.ps1 | Script-Object.ps1 | #Copyright (c) 2011 Justin Dearing
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, dist... |
combined_dataset/train/non-malicious/ESXi Config BackupScript_1.ps1 | ESXi Config BackupScript_1.ps1 | ###ESXi Configuration Backup Script
#DESCRIPION: This Script takes a CSV file with the hostname, username, and password of a list of ESXi servers, and backs up their configurations to a specified Destination
#USAGE: This script is meant to be run as a regular scheduled task or a pre-script for a backup job. There is ... |
combined_dataset/train/non-malicious/get-serials.ps1 | get-serials.ps1 | <#
.SYNOPSIS
Get the BIOS serial numbers from computers in the domain.
.DESCRIPTION
Return a list of computers with their serial numbers. For Dell computers the Win32_BIOS.SerialNumber property
is the service tag of the computer. This identifies the computer on the Dell support site... |
combined_dataset/train/non-malicious/3216.ps1 | 3216.ps1 | InModuleScope PoshBot {
Describe ScheduledMessage {
$msg = [Message]::new()
$msg.Id = 1
$msg.Text = "This is a test message"
$Interval = 'Days'
$TimeValue = 1
$Message = $msg
$StartAfter = (Get-Date).AddMinutes(1)
Context "Construc... |
combined_dataset/train/non-malicious/bc7d5dc9-76a4-432e-ad15-2f3acae17658.ps1 | bc7d5dc9-76a4-432e-ad15-2f3acae17658.ps1 | param (
$UserName,
$FilePath,
[switch]$SaveCredential=$False,
[switch]$RdpSaveCredential=$False,
[switch]$DeleteCredential=$False,
[switch]$Help=$False
)
$ScriptFilenam = $MyInvocation.MyCommand.Name # ScriptFilename wo path.
$ScriptUnbArgs = $MyInvocation.UnboundArguments # UnNamed Arguments of the Po... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.