full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/Quest Dynamic Group 005.ps1 | Quest Dynamic Group 005.ps1 | <#
2012.07.06
Information will be uploaded shortly.
#>
|
combined_dataset/train/non-malicious/sample_53_71.ps1 | sample_53_71.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 = '83.2.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_24_41.ps1 | sample_24_41.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Er bestaat al een omgevingsvariabele met deze naam en dit type.
EnvironmentErrorDoesNotExists=Er bestaat geen omgevingsvariabele met deze naam en dit type.
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
... |
combined_dataset/train/non-malicious/List AD Users CSV_3.ps1 | List AD Users CSV_3.ps1 | $NumDays = 0
$LogDir = ".\\User-Accounts.csv"
$currentDate = [System.DateTime]::Now
$currentDateUtc = $currentDate.ToUniversalTime()
$lltstamplimit = $currentDateUtc.AddDays(- $NumDays)
$lltIntLimit = $lltstampLimit.ToFileTime()
$adobjroot = [adsi]''
$objstalesearcher = New-Object System.DirectoryServices.Dire... |
combined_dataset/train/non-malicious/638.ps1 | 638.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://download.microsoft.com/download/F/4/4/F4461C3D-B378-473D-B15A-28BC0BD849E8/MessageAnalyzer64.msi"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ForEac... |
combined_dataset/train/non-malicious/sample_21_46.ps1 | sample_21_46.ps1 | @{
GUID="766204A6-330E-4263-A7AB-46C87AFC366C"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManC... |
combined_dataset/train/non-malicious/sample_29_97.ps1 | sample_29_97.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/286.ps1 | 286.ps1 | function Get-PSFTaskEngineTask
{
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFTaskEngineTask')]
Param (
[string]
$Name = "*"
)
[PSFramework.TaskEngine.TaskHost]::Tasks.Values | Where-Object Name -Like $Name
} |
combined_dataset/train/non-malicious/271.ps1 | 271.ps1 | function ConvertFrom-Base64
{
[CmdletBinding()]
PARAM (
[parameter(Mandatory = $true, ValueFromPipeline)]
[String]$String
)
TRY
{
Write-Verbose -Message "[ConvertFrom-Base64] Converting String"
[System.Text.Encoding]::Default.GetString(
[System.Convert]::... |
combined_dataset/train/non-malicious/859.ps1 | 859.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests', ''
. "$here\$sut"
$clusterName = $ENV:ClusterName
$httpUserPassword = $ENV:HttpPassword
$securePassword = ConvertTo-SecureString $httpUserPassword -AsPlainText -Force
$creds = New-Object -... |
combined_dataset/train/non-malicious/3378.ps1 | 3378.ps1 |
[CmdletBinding(
SupportsShouldProcess=$true
)]
param(
[Parameter(Mandatory = $false)]
[string] $Version,
[Parameter(Mandatory = $false)]
[ValidateSet("Latest", "Stack")]
[string] $Target = "Latest",
[Parameter(Mandatory = $false)]
[string] $SourceBaseUri,
[Parameter(Man... |
combined_dataset/train/non-malicious/sample_28_38.ps1 | sample_28_38.ps1 | class HealthModel
{
# Attributes for Azure Monitor schema
[string]$Name #Name of the individual test/rule/alert that was executed. Unique, not exposed to the customer.
[string]$Title #User-facing name; one or more sentences indicating the direct issue.
[string]$Severity #Severity of the result (Cri... |
combined_dataset/train/non-malicious/sample_8_63.ps1 | sample_8_63.ps1 | <#
.SYNOPSIS
Collects basic information about the installed instance of WSUS Server
.DESCRIPTION
Collects basic information about the installed instance of WSUS Server and generates two files:
COMPUTERNAME_WSUS_BasicInfo.txt
(Optional) COMPUTERNAME_WSUS_UpdateApprovals.txt
.PARAMETER GetApprovedUpdates
(Opt... |
combined_dataset/train/non-malicious/sample_8_99.ps1 | sample_8_99.ps1 | #************************************************
# DC_ServicingLogs.ps1
# Version 1.0
# Date: 2009-2019
# Author: + Walter Eder (waltere@microsoft.com)
# Description: Collects Servicing additional information.
# Called from: TS_AutoAddCommands_SETUP.ps1
#*******************************************************
... |
combined_dataset/train/non-malicious/sample_39_4.ps1 | sample_39_4.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 = '75.1.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/1991.ps1 | 1991.ps1 |
Describe 'Get-CimClass' -Tags "CI" {
It 'can get CIM_Error CIM class' -Pending:(-not $IsWindows) {
Get-CimClass -ClassName CIM_Error | Should -Not -BeNullOrEmpty
}
It 'can get class when namespace is specified' -Pending:(-not $IsWindows) {
Get-CimClass -ClassName CIM_OperatingSystem -Na... |
combined_dataset/train/non-malicious/2003.ps1 | 2003.ps1 |
param([switch]$useModule, [string]$FullPath)
$global:CoreScriptPath = Join-Path $PSScriptRoot 'AutomountSubstDriveCore.ps1'
if ($useModule)
{
$m = New-Module {
function Test-DrivePresenceFromModule
{
param ([String]$Path)
& $global:CoreScriptPath -Path $Path
}
... |
combined_dataset/train/non-malicious/3090.ps1 | 3090.ps1 | function Verify-Null {
param (
[Parameter(ValueFromPipeline = $true)]
$Actual
)
if ($null -ne $Actual) {
throw [Exception]"Expected `$null but got '$Actual'."
}
$Actual
}
|
combined_dataset/train/non-malicious/sample_4_55.ps1 | sample_4_55.ps1 | <#
.SYNOPSIS
checks precondition before invoking (HCITelematry.ps1) Telemetry infomation from Azure stack HCI Host
.DESCRIPTION
The iSMCheckHCISystem.ps1 checks for server where Hyper-V + Failover Cluster + S2D cluster is enable
.PARAMETER OutputPath
Output path for telemetry collection, pass to HCITe... |
combined_dataset/train/non-malicious/3657.ps1 | 3657.ps1 |
function Handle-FailoverGroupTest($scriptBlock, $primaryLocation = "North Europe", $secondaryLocation = "West US 2", $serverVersion = "12.0", $rg = $null, $server1 = $null, $server2 = $null, $cleanup = $false)
{
try
{
$isCreated = $rg -eq $null
$rg = if ($rg -eq $null) { Create-ResourceGroupForTest... |
combined_dataset/train/non-malicious/sample_61_13.ps1 | sample_61_13.ps1 | # powershell completion for azcmagent -*- shell-script -*-
function __azcmagent_debug {
if ($env:BASH_COMP_DEBUG_FILE) {
"$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE"
}
}
filter __azcmagent_escapeStringWithSpecialChars {
$_ -replace '\s|#|@|\$... |
combined_dataset/train/non-malicious/1647.ps1 | 1647.ps1 |
function Split-File ([string]$inFile, [int]$bufSize = 5mb) {
$stream = [System.IO.File]::OpenRead($inFile)
$chunkNum = 1
$barr = New-Object byte[] $bufSize
$fileinfo = [System.IO.FileInfo]$inFile
$name = $fileinfo.Name
$dir = $fileinfo.Directory
while ($bytesRead = $stream.... |
combined_dataset/train/non-malicious/Save-Credentials_5.ps1 | Save-Credentials_5.ps1 | <#
.SYNOPSIS
The script saves a username and password, encrypted with a custom key to to a file.
.DESCRIPTION
The script saves a username and password, encrypted with a custom key to to a file. The key is coded into the script but should be changed before use. The key allows the password to be decrypted ... |
combined_dataset/train/non-malicious/3777.ps1 | 3777.ps1 |
function Test-ServerEndpoint2
{
$resourceGroupName = Get-ResourceGroupName
Write-Verbose "RecordMode : $(Get-StorageTestMode)"
try
{
$storageSyncServiceName = Get-ResourceName("sss")
$syncGroupName = Get-ResourceName("sg")
$serverEndpointName = Get-Re... |
combined_dataset/train/non-malicious/sample_32_69.ps1 | sample_32_69.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/1594.ps1 | 1594.ps1 |
function CopyTo-Image {
param (
[string]$file,
[string]$image
)
$date = date -f yyyyMMddHHmmss
$fileext = $file.split('.')[-1]
if ($fileext -eq 'zip') {
$zip = $file
} else {
$zip = "c:\temp\$date.zip"
Compress-Archive $file $zip
}
$path = S... |
combined_dataset/train/non-malicious/sample_8_67.ps1 | sample_8_67.ps1 | # 2023-02-20 WalterE mod Trap #we#
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_"
}
Import-LocalizedData -BindingVariable ScriptStrings
... |
combined_dataset/train/non-malicious/177.ps1 | 177.ps1 | function Send-Email
{
[CmdletBinding(DefaultParameterSetName = 'Main')]
param
(
[Parameter(ParameterSetName = 'Main',
Mandatory = $true)]
[Alias('EmailTo')]
[String[]]$To,
[Parameter(ParameterSetName = 'Main',
Mandatory = $true)]
[Alias('EmailFrom', 'FromAddress')]
[String]$From,
[Par... |
combined_dataset/train/non-malicious/New-ComplexPassword.ps1 | New-ComplexPassword.ps1 | # $Id: New-ComplexPassword.ps1 170 2008-09-05 19:49:48Z jon $
# $Revision: 170 $
Function New-ComplexPassword ([int]$Length=8, $digits=$null, $alphaUpper=$null, $alphaLower=$null, $special=$null)
{
# ASCII data taken from http://msdn2.microsoft.com/en-us/library/60ecse8t(VS.80).aspx
# Make sure the passwo... |
combined_dataset/train/non-malicious/4447.ps1 | 4447.ps1 | function Get-InstalledPackage
{
[CmdletBinding()]
param
(
[Parameter()]
[string]
$Name,
[Parameter()]
[string]
$RequiredVersion,
[Parameter()]
[string]
$MinimumVersion,
[Parameter()]
[string]
$MaximumVersion
... |
combined_dataset/train/non-malicious/437.ps1 | 437.ps1 |
$registrationEvent = {
}
$begin_event = {
function Get-LogFilePath
{
[CmdletBinding()]
param (
)
$path = Get-PSFConfigValue -FullName 'PSFramework.Logging.LogFile.FilePath'
$logname = Get-PSFConfigValue -FullName 'PSFramework.Logging.LogFile.LogName'
$scriptBlock = {
param (
[string... |
combined_dataset/train/non-malicious/1322.ps1 | 1322.ps1 |
function Write-CDscError
{
[CmdletBinding()]
[OutputType([Diagnostics.Eventing.Reader.EventLogRecord])]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[Diagnostics.Eventing.Reader.EventLogRecord[]]
$EventLogRecord,
[Switch]
$PassT... |
combined_dataset/train/non-malicious/4142.ps1 | 4142.ps1 |
Function Import-LGPO {
Param([String]$LGPOName, [String]$LGPOLocation, [String]$GPOType)
$Executable = $Global:RelativePath+"ImportRegPol.exe"
If ($GPOType -eq "Machine") {
$GPOType = "\DomainSysvol\GPO\Machine\registry.pol"
} else {
$GPOType = "\DomainSysvol\GPO\User\registry.pol"
}
$Parameters = "-m "... |
combined_dataset/train/non-malicious/511.ps1 | 511.ps1 |
function Get-ADPrincipalGroupMembershipRecurse{
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[ValidateNotNullOrEmpty()]
$ADUser,
[Parameter(Mandatory=$false)]
[ValidateNotNullOrEmpty()]
$ADGroup,
[Parameter(Mandatory=$false)]
$Level = 0
)
... |
combined_dataset/train/non-malicious/sample_55_60.ps1 | sample_55_60.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_42_97.ps1 | sample_42_97.ps1 | <TemplateItem>
<Name>AI - Chat - Personalized</Name>
<IconType>.svg</IconType>
<IconData>H4sIAAAAAAAACu1a205sxxF991dMJq9z2X3vtg62DhdbkXBiKbajPEUYJkCMAQEGn/P1WWtVNzMQ
fCK/RrEtpnvv6u66rqrq7Xdf/vrz1exxc3d/eXO9N3eraT7bXJ/enF1en+/Nv//uq2Wdf/nFZ+/+
cPiXg+/+/u3R7P7xfPbt9/vHfzqYzZfr9d/CwXp9+N3h7K8/fD1zK7deH/... |
combined_dataset/train/non-malicious/Connect-WebService.ps1 | Connect-WebService.ps1 | ##############################################################################\n##\n## Connect-WebService\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n## Connect to a given web service, and create a type that allows you to\n## interact with that web service... |
combined_dataset/train/non-malicious/sample_14_75.ps1 | sample_14_75.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\update-browserslist-db@1.0.13_browserslist@4.22.3\node_modules\update-browserslist-db\node_modules;C:\Users\abder\c... |
combined_dataset/train/non-malicious/555.ps1 | 555.ps1 |
function Add-SPOSubsite
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$title,
[Parameter(Mandatory=$false, Position=2)]
[string]$webTemplate = "STS
[Parameter(Mandatory=$false, Position=3)]
[string]$description = "",
[Parameter(Mandatory=$false, Positi... |
combined_dataset/train/non-malicious/Get-Characteristics.ps1 | Get-Characteristics.ps1 | ##############################################################################\n##\n## Get-Characteristics\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\nGet ... |
combined_dataset/train/non-malicious/861.ps1 | 861.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests', ''
. "$here\$sut"
$clusterName = $ENV:ClusterName
$httpUserPassword = $ENV:HttpPassword
$securePassword = ConvertTo-SecureString $httpUserPassword -AsPlainText -Force
$creds = New-Object -... |
combined_dataset/train/non-malicious/sample_8_81.ps1 | sample_8_81.ps1 | Import-LocalizedData -BindingVariable Strings
Function GetWin32OSFromRemoteSystem([string] $MachineName){
trap [Exception]
{
WriteTo-ErrorDebugReport -ErrorRecord $_ -ScriptErrorText ("[GetWin32OSFromRemoteSystem] Error contacting " + $MachineName)
continue
}
#Obtain OS From Remote Machine and retu... |
combined_dataset/train/non-malicious/3886.ps1 | 3886.ps1 |
function Test-PowerBIEmbeddedCapacity
{
try
{
$RGlocation = Get-RG-Location
$location = Get-Location
$resourceGroupName = Get-ResourceGroupName
$capacityName = Get-PowerBIEmbeddedCapacityName
New-AzResourceGroup -Name $resourceGroupName -Location $RGlocation
$capacityCreated = New-AzPowerBIEmbed... |
combined_dataset/train/non-malicious/2567.ps1 | 2567.ps1 |
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null
function getwmiinfo ($svr) {
gwmi -query "select * from
Win32_ComputerSystem" -computername $svr | select Name,
Model, Manufacturer, Description, DNSHostName,
Domain, DomainRole, PartOfDomain, NumberOfProcessor... |
combined_dataset/train/non-malicious/sample_63_61.ps1 | sample_63_61.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.apa... |
combined_dataset/train/non-malicious/2490.ps1 | 2490.ps1 |
function Start-PacketTrace {
[CmdletBinding()]
[OutputType()]
param
(
[Parameter()]
[ValidateNotNullOrEmpty()]
[ValidateScript({ Test-Path -Path ($_ | Split-Path -Parent) -PathType Container })]
[ValidatePattern('.*\.etl$')]
[string[]]$TraceFilePath,
[Parameter()]
[switch]$Force
)
begin {
Set-St... |
combined_dataset/train/non-malicious/1681.ps1 | 1681.ps1 | $dnsservers = "192.168.1.100","192.168.1.1"
$computers = Get-Content ComputerList.txt
foreach ($comp in $computers)
{
$adapters = gwmi -q "select * from win32_networkadapterconfiguration where ipenabled='true'" -ComputerName $comp
foreach ($adapter in $adapters)
{
$adapter.setDNSServerSearchOrder($dnsservers)
}
... |
combined_dataset/train/non-malicious/sample_35_77.ps1 | sample_35_77.ps1 | #
# Script module for module 'Az.Relay' that is executed when 'Az.Relay' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:43
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
if ... |
combined_dataset/train/non-malicious/904.ps1 | 904.ps1 | $fqdn="<Replace with your custom domain name>"
$webappname="mywebapp$(Get-Random)"
$location="West Europe"
New-AzResourceGroup -Name $webappname -Location $location
New-AzAppServicePlan -Name $webappname -Location $location `
-ResourceGroupName $webappname -Tier Free
New-AzWebApp -Name $webappname -Location $loca... |
combined_dataset/train/non-malicious/1437.ps1 | 1437.ps1 |
filter Add-IisServerManagerMember
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
$InputObject,
[Parameter(Mandatory=$true)]
[Microsoft.Web.Administration.ServerManager]
$ServerManager,
[Switch]
... |
combined_dataset/train/non-malicious/sample_23_19.ps1 | sample_23_19.ps1 | #
# Module manifest for module 'OCI.PSModules.Fusionapps'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fusionapps.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_12_44.ps1 | sample_12_44.ps1 | #************************************************
# TS_IPv6Check.ps1
# Version 1.0
# Date: 5-1-2012
# Author: davidcop
# Description: Checks for nics with IPv6 unchecked and the disabledcomponents registry value does not exist
#************************************************
#_# update for Win10
if ((($OSVe... |
combined_dataset/train/non-malicious/4085.ps1 | 4085.ps1 |
[CmdletBinding()]
param ()
function Enable-Reboot {
[CmdletBinding()]
param ()
$TaskSequence = New-Object -ComObject Microsoft.SMS.TSEnvironment
$TaskSequence.Value('SMSTSRebootRequested') = $true
}
If ((Get-ChildItem "REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component B... |
combined_dataset/train/non-malicious/Get-MWSOrder.ps1 | Get-MWSOrder.ps1 | // --------------------------------------------------------------------------------------------------------------------
// <copyright file="GetOrderCmdlet.cs" company="Huddled Masses">
// Copyright (c) 2011 Joel Bennett
// </copyright>
// <summary>
// Defines the Get-Order Cmdlet for Amazon Marketplace Orders ... |
combined_dataset/train/non-malicious/sample_58_2.ps1 | sample_58_2.ps1 | # Localized 06/27/2024 06:02 AM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=예(&Y)
PromptNoString=아니요(&N)
BundleFound=찾은 번들: {0}
PackageFound=찾은 패키지: {0}
EncryptedBundleFound=암호화된 번들 찾음: {0}
EncryptedPackageFound=암호화된 패키지 찾음: {0}
Certificat... |
combined_dataset/train/non-malicious/sample_10_76.ps1 | sample_10_76.ps1 | ConvertFrom-StringData @'
id_appxregistrykeys_title=Registry Keys
id_appxregistrykeys_status=Collecting Appx Registry Keys
id_appxfiles_title=Appx Files
id_appxfiles_status=Collecting Appx Files
id_dirlistings_title=Dir Listings
id_dirlistings_status=Collecting Appx Directory Listings
id_appxdatalogs_title=Appx ... |
combined_dataset/train/non-malicious/Users_Contacts from CSV.ps1 | Users_Contacts from CSV.ps1 | #=============================================================================#
#=============================================================================#
#=============================================================================#
#
# SCRIPT : CreateOrUpdateUsersOrContacts.ps1
# LAST UPDATE : 9/18/2009... |
combined_dataset/train/non-malicious/3741.ps1 | 3741.ps1 |
$global:createdKeys = @()
$global:createdSecrets = @()
$global:createdCertificates = @()
$global:createdManagedStorageAccounts = @()
$invocationPath = Split-Path $MyInvocation.MyCommand.Definition;
function Get-KeyVault([bool] $haspermission=$true)
{
if ($global:testVault -ne "" -and $haspermission... |
combined_dataset/train/non-malicious/4424.ps1 | 4424.ps1 | function Publish-Module {
[CmdletBinding(SupportsShouldProcess = $true,
PositionalBinding = $false,
HelpUri = 'https://go.microsoft.com/fwlink/?LinkID=398575',
DefaultParameterSetName = "ModuleNameParameterSet")]
Param
(
[Parameter(Mandatory = $true,
Paramete... |
combined_dataset/train/non-malicious/sample_28_11.ps1 | sample_28_11.ps1 | # @(#) MQMBID sn=p935-L240201 su=_TSUFq8DwEe6a1qdb8O1Dfw pn=cmd/install/pc/winnt/web/UnpackFeature.ps1
########################################################################
# #
# Program name: UnpackFeature.ps1 ... |
combined_dataset/train/non-malicious/2511.ps1 | 2511.ps1 | param(
$SqlServerOne = 'YourDatabaseServer',
$FirstDatabase = 'FirstDatabaseToCompare',
$SqlUsernameOne = 'SQL Login',
$SqlPasswordOne = 'SQL Password',
$SqlServerTwo = 'YourDatabaseServer',
$SecondDatabase = 'SecondDatabaseToCompare',
$SqlUsernameTwo = 'SQL Login',
$SqlPasswordTwo = 'SQL Password',
$FilePr... |
combined_dataset/train/non-malicious/673.ps1 | 673.ps1 |
$reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl }
Function Set-FolderReportDataSource
{
param (
[string]
$NewFolderPath
)
$tempProxy = New-RsWebServiceProxy -ReportServerUri $reportServerUri
$localResources... |
combined_dataset/train/non-malicious/sample_24_3.ps1 | sample_24_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Managementagent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Managementagent.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_52_88.ps1 | sample_52_88.ps1 | using namespace System.Management.Automation
using namespace System.Management.Automation.Language
# This is an example profile for PSReadLine.
#
# This is roughly what I use so there is some emphasis on emacs bindings,
# but most of these bindings make sense in Windows mode as well.
Import-Module PSReadLine
... |
combined_dataset/train/non-malicious/sample_17_3.ps1 | sample_17_3.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.apa... |
combined_dataset/train/non-malicious/3093.ps1 | 3093.ps1 | function Verify-NotSame {
param (
[Parameter(ValueFromPipeline = $true)]
$Actual,
[Parameter(Mandatory = $true, Position = 0)]
$Expected
)
if ([object]::ReferenceEquals($Expected, $Actual)) {
throw [Exception]"Expected the objects to be different instance but they we... |
combined_dataset/train/non-malicious/sample_20_36.ps1 | sample_20_36.ps1 | #This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER #EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABI... |
combined_dataset/train/non-malicious/4413.ps1 | 4413.ps1 | function Save-Script {
[CmdletBinding(DefaultParameterSetName = 'NameAndPathParameterSet',
HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=619786',
SupportsShouldProcess = $true)]
Param
(
[Parameter(Mandatory = $true,
ValueFromPipelineByPropertyName = $true,
... |
combined_dataset/train/non-malicious/sample_7_88.ps1 | sample_7_88.ps1 | ConvertFrom-StringData @'
id_ctsfirewallrunningcheck=Windows Firewall Running check
id_ctsfirewallrunningcheckdescription=Verify the Windows Firewall service is running
id_firewallrunningcheckdesc=The Windows Firewall service is not running
id_firewallstartmodecheckdesc=The Windows Firewall start mode is not set to... |
combined_dataset/train/non-malicious/sample_3_84.ps1 | sample_3_84.ps1 | "use strict";
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, selec... |
combined_dataset/train/non-malicious/sample_55_54.ps1 | sample_55_54.ps1 | function trySetDesignerProp(tname, ttype, val) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0);
trait.value = val;
}
if (command.getTrait("state").value == 0) {
command.getTrait("state").value = 2;
trySetDesignerProp("exportAsText", "bool", true);
}
else {
command.g... |
combined_dataset/train/non-malicious/sample_64_29.ps1 | sample_64_29.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_2_76.ps1 | sample_2_76.ps1 | #
# Module manifest for module 'OCI.PSModules.Dns'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dns.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/Sybase Error Log Check.ps1 | Sybase Error Log Check.ps1 |
# Description
# ===========
# This script is to check the Sybase ASE Server errorlog for certain strings... |
combined_dataset/train/non-malicious/sample_9_92.ps1 | sample_9_92.ps1 | ConvertFrom-StringData @'
id_sccm_checksqlconfig=Checking SQL Database Configuration
id_sccm_checksqlvalue=Checking the Value of
id_sccm_checksqlconfigdesc=Trying to connect to the SQL Database
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGs... |
combined_dataset/train/non-malicious/Send-HTMLFormattedEmail_6.ps1 | Send-HTMLFormattedEmail_6.ps1 | ##################################################
# cmdlets
##################################################
#-------------------------------------------------
# Send-HTMLFormattedEmail
#-------------------------------------------------
# Usage: Send-HTMLFormattedEmail -?
#------------------------------------... |
combined_dataset/train/non-malicious/sample_13_81.ps1 | sample_13_81.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_67_27.ps1 | sample_67_27.ps1 | #
# Module manifest for module 'OCI.PSModules.Recovery'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Recovery.dll'
# Version number of this module.
ModuleVersion = '89.0.0'
# Supported PSEditions
Comp... |
combined_dataset/train/non-malicious/3131.ps1 | 3131.ps1 |
function Split-IPv4Subnet
{
[CmdletBinding(DefaultParameterSetName='CIDR')]
param(
[Parameter(
Position=0,
Mandatory=$true,
HelpMessage='IPv4-Address which is in the subnet')]
[IPAddress]$IPv4Address,
[Parameter(
ParameterSetName... |
combined_dataset/train/non-malicious/sample_31_44.ps1 | sample_31_44.ps1 | $rubydir = split-path $MyInvocation.MyCommand.Definition -parent
# Execute 'enable' and 'disable' in the context of the current powershell session, so that env vars are effective for subsequent commands.
if ($args[0] -eq "enable" -or $args[0] -eq "disable") {
$rubyfile = $rubydir + "/ruby"
$op = $args[0] + "ps1"
... |
combined_dataset/train/non-malicious/Write-Log System Center.ps1 | Write-Log System Center.ps1 | function Write-Log
{
<#
.Synopsis
Write a message to a log file in a format compatible with Trace32 and Config Manager logs.
.Description
This cmdlet takes a given message and formats that message such that it's compatible with
the Trace32 log viewer tool used for reading/parsing Syst... |
combined_dataset/train/non-malicious/Select-Alive_1.ps1 | Select-Alive_1.ps1 | ## this filer passes through only objects that are pingable
## it takes any object as input, but the property containing the hostname
## to ping must be specified if the object is not a string
function Select-Alive {param( [object]$InputObject,
[string]$Property,
[int32]$Requests = 3,
[switch]$Verbose... |
combined_dataset/train/non-malicious/Get-User_11.ps1 | Get-User_11.ps1 | function Get-User($user)
{
# this function should be passed the CN of the user to be returned
$dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
$root = [ADSI] "LDAP://$($dom.Name)"
$searcher = New-Object System.DirectoryServices.DirectorySearcher $root
$searcher.filter = "(&(objec... |
combined_dataset/train/non-malicious/1666.ps1 | 1666.ps1 |
$TargetApplication = "C:\Program Files\Pulseway\pcmontask.exe"
$TargetArguments = " support"
$ShortcutFile = "$env:Public\Desktop\Get Support.lnk"
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)
$Shortcut.TargetPath = $TargetApplication
$Shortcut.Arguments = ... |
combined_dataset/train/non-malicious/sample_6_58.ps1 | sample_6_58.ps1 | #************************************************
# TS_PrinterKB2457866Check.ps1
# Version 1.0.1
# Date: 03-27-2011
# Author: v-anecho
# Description: Checks if machine is server 2008 R2 sp0 or sp1, and event log 602 exists, and hotfix kb 2457866 is installed if true generate alert
#******************************... |
combined_dataset/train/non-malicious/sample_53_88.ps1 | sample_53_88.ps1 | # Localized 06/28/2023 07:58 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=疑难解答
Troubleshoot_DetectDVDDevice=正在检查 DVD 设备...
Troubleshoot_DetectDVDvideoDecoder=正在检查用于播放 DVD 的视频解码器...
Troubleshoot_DetectDVDAudioDecoder=正在检查用于播放 DVD 的音频解码器...
Resolution_Title... |
combined_dataset/train/non-malicious/sample_22_91.ps1 | sample_22_91.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/2024.ps1 | 2024.ps1 |
Import-Module HelpersRemoting
Import-Module HelpersCommon
Describe "Remote runspace pool should expose commands in endpoint configuration" -Tags 'Feature','RequireAdminOnWindows' {
BeforeAll {
if ($isWindows -and (Test-CanWriteToPsHome))
{
$configName = "restrictedV"
$c... |
combined_dataset/train/non-malicious/3884.ps1 | 3884.ps1 |
function Test-CrudUserAssignedIdentity
{
$MSINamespace = "Microsoft.ManagedIdentity";
$MSIResourceType = "userAssignedIdentities";
$MSIPreferredLocation = "westus";
$rgName1 = getAssetName;
$rgName2 = getAssetName;
$identityName1 = getAssetName;
$identityName2 = getAssetName;
$identityN... |
combined_dataset/train/non-malicious/sample_36_70.ps1 | sample_36_70.ps1 | #
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ... |
combined_dataset/train/non-malicious/sample_25_70.ps1 | sample_25_70.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module -Name "$PSScriptRoot\..\RoleHelper... |
combined_dataset/train/non-malicious/sample_20_28.ps1 | sample_20_28.ps1 | <#
.SYNOPSIS
Module for extended installed Windows Updates report
.DESCRIPTION
Collects information on installed Windows Updates and generates a report in .html format
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedback : ... |
combined_dataset/train/non-malicious/Create VApps in vSphere.ps1 | Create VApps in vSphere.ps1 | <#
.SYNOPSIS
Creates VApps within DevStack with reservations for CPU & RAM
.DESCRIPTION
Creates VApps within DevStack vSphere Environment, available parameters are:
-VIServer (Optional, defaults to DevStack) {FQDN of VCentre Server}
-AppName (Required) {VApp Label}
-Location (Required) {Managed | Un-mana... |
combined_dataset/train/non-malicious/sample_35_53.ps1 | sample_35_53.ps1 | #
# Module manifest for module 'OCI.PSModules.Waf'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waf.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/Get-DiskSizeInfo_1.ps1 | Get-DiskSizeInfo_1.ps1 | Function Get-DiskSizeInfo {
<#
.DESCRIPTION
Check the Disk(s) Size and remaining freespace.
.PARAMETER ComputerName
Specify the computername(s)
.INPUTS
System.String
.OUTPUTS
System.Management.Automation.PSObject
.EXAMPLE
... |
combined_dataset/train/non-malicious/2800.ps1 | 2800.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(CommandLine) as ct,
CommandLine
FROM
*ProcsWMI.tsv
GROUP BY
CommandLine
ORDER BY
ct ASC
"@
& logparser -stats:off -i:csv -dtlines:0 -fixedsep:on -rtp:-1 "$lpquery"
} else {
$ScriptName = [... |
combined_dataset/train/non-malicious/3579.ps1 | 3579.ps1 |
function Api-CrudTest {
Param($resourceGroupName, $serviceName)
$context = New-AzApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName
$apis = Get-AzApiManagementApi -Context $context
Assert-AreEqual 1 $apis.Count
Assert-NotNull $apis[0].Api... |
combined_dataset/train/non-malicious/sample_29_11.ps1 | sample_29_11.ps1 | ijSTF2QMV0d+rdP3fk8k58e4dbGMnGcE+0IfrYbbIAa2BKY6Ed/Japjpn6PoO0D4vuJAIxsfPZhZMY+LdwqeCoyBghZieoiaqA8034VEJJl9EfUIAgtpCCz4uZM9ozU4thHCg9YO8eZuRRz0rhbyM809lfYzn7exOqLx6lXxRsqJke6Yo0g246tB2Ssejjmv9juYXVcTEMPOE6ajX866nZ6goXfliVzPq6Ux/cy3XLpXlAWh8vy2dAIJTlt8OQY9Q7RIVzolbF/KzRCsgfBhdCWw07oPy9NL8sb6xLviTtK8AGUePEt0JbCX27qiZDdq... |
combined_dataset/train/non-malicious/179.ps1 | 179.ps1 | function Get-SCCMUserCollectionDeployment
{
[CmdletBinding()]
PARAM
(
[Parameter(Mandatory)]
[Alias('SamAccountName')]
$UserName,
[Parameter(Mandatory)]
$SiteCode,
[Parameter(Mandatory)]
$ComputerName,
[Alias('RunAs')]
[System.Mana... |
combined_dataset/train/non-malicious/3382.ps1 | 3382.ps1 | [CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]$TestExecPath,
[Parameter(Mandatory=$false)]
[string]$ModuleFilter
)
$dirPath = (Join-Path $PSScriptRoot -ChildPath '..')
$artPath = (Join-Path $dirPath 'artifacts')
$srcPath = (Join-Path $dirPath -ChildPath 'src')
$libPath = (Join-Path... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.