full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/0ba8cce5-b168-4f3d-a2e5-9c04920fb80e.ps1 | 0ba8cce5-b168-4f3d-a2e5-9c04920fb80e.ps1 |
# The $test variable can be pretty much whatever you want it to be, or with a little adjustment it isn't even necessary.
# I just wanted to set it up like this for the $match variable later on
$test=(get-folder testing|get-vm)
#$data and the csv is where all the information lies that this script/s pulls
$data=i... |
combined_dataset/train/non-malicious/3998.ps1 | 3998.ps1 |
function Test-E2ESchedules
{
$resourceGroupName = "to-delete-01"
$automationAccountName = "fbs-aa-01"
$output = Get-AzAutomationAccount -ResourceGroupName $resourceGroupName -AutomationAccountName $automationAccountName -ErrorAction SilentlyContinue
$StartTime = Get-Date "13:00:00"
$S... |
combined_dataset/train/non-malicious/Find Local Group Members_8.ps1 | Find Local Group Members_8.ps1 | # Author: Hal Rottenberg
# Purpose: Find matching members in a local group
# Used tip from RichS here: http://powershellcommunity.org/Forums/tabid/54/view/topic/postid/1528/Default.aspx
# Change these two to suit your needs
$ChildGroups = "Domain Admins", "Group Two"
$LocalGroup = "Administrators"
$MemberName... |
combined_dataset/train/non-malicious/sample_16_79.ps1 | sample_16_79.ps1 | ConvertFrom-StringData @'
id_ex2003_exchdumpact=Exchange Support Tool - ExchDump
id_ex2003_exchdumpstat=Running ExchDump.exe to collect configuration information
id_ex2003_exchdumpreportsection=Exchange Configuration Information
id_ex2003_exchdumpfiledescription=Exchange Configuration Information
'@
# SIG # Beg... |
combined_dataset/train/non-malicious/sample_1_18.ps1 | sample_1_18.ps1 | <#
.SYNOPSIS
DC_CM12BitlockerInfo.ps1 - Configuration Manager module for collecting bitlocker information
.DESCRIPTION
Leverages existing DND Module functionality to collect bitlocker information
.NOTES
Dev. Lead: sabieler
Authors : lamosley
Requires : PowerShell V4 (Supported from Windows 8.1... |
combined_dataset/train/non-malicious/Added_Deleted AD Objects_2.ps1 | Added_Deleted AD Objects_2.ps1 | #REQUIRES -pssnapin quest.activeroles.admanagement
#REQUIRES -pssnapin Pscx
begin {
# Build variables
$strSMTPServer = "xx.xx.xx.xx";
$strEmailFrom = "AD_Admin@yourdomain.com";
$strEmailTo = "admin@yourdomain.com";
$borders = "=" * 25;
[int]$days = -60
function TombStonedObjects {
# create Directory Se... |
combined_dataset/train/non-malicious/890.ps1 | 890.ps1 |
$gitrepo="https://github.com/Azure-Samples/app-service-web-dotnet-get-started.git"
$webappname="mywebapp$(Get-Random)"
$location="West Europe"
New-AzResourceGroup -Name myResourceGroup -Location $location
New-AzAppServicePlan -Name $webappname -Location $location `
-ResourceGroupName myResourceGroup -Tier Free
N... |
combined_dataset/train/non-malicious/Out-Html.ps1 | Out-Html.ps1 | ################################################################################
# Out-HTML - converts cmdlets help to HTML format
# Based on Out-wiki by Dimitry Sotnikov (http://dmitrysotnikov.wordpress.com/2008/08/18/out-wiki-convert-powershell-help-to-wiki-format/)
#
# Modify the invocation line at the bottom of... |
combined_dataset/train/non-malicious/Get Exchange DB Stats_1.ps1 | Get Exchange DB Stats_1.ps1 | # requires -version 2.0
#
# get-sgstats2010.ps1
#
# returns various info about storage groups
#
# Author: rfoust@duke.edu
# Modified: May 20, 2012
#
# This has only been tested with Exchange 2010
# Use -nomountpoint if you don't use mountpoints in your environment
param([string]$server=$env:computername.to... |
combined_dataset/train/non-malicious/Import-Iis-Log_2.ps1 | Import-Iis-Log_2.ps1 | param
(
[Parameter(
Mandatory=$true,
Position = 0,
ValueFromPipeline=$true,
HelpMessage="Specifies the path to the IIS *.log file to import. You can also pipe a path to Import-Iss-Log."
)]
[ValidateNotNullOrEmpty()]
[string]
$Path,
[Parameter(
Position = 1,
HelpMessage="Specifies the d... |
combined_dataset/train/non-malicious/sample_43_27.ps1 | sample_43_27.ps1 | #
# Module manifest for module 'OCI.PSModules.Artifacts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Artifacts.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_44_34.ps1 | sample_44_34.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/sample_35_16.ps1 | sample_35_16.ps1 | # Localized 04/14/2024 08:54 PM (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_19_73.ps1 | sample_19_73.ps1 | #
# Module manifest for module 'OCI.PSModules.Core'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Core.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_3_48.ps1 | sample_3_48.ps1 | #
# Module manifest for module 'OCI.PSModules.Oce'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Oce.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/825.ps1 | 825.ps1 |
$cred = Get-Credential
New-AzVmss `
-ResourceGroupName "myResourceGroup" `
-VMScaleSetName "myScaleSet" `
-Location "EastUS2" `
-VirtualNetworkName "myVnet" `
-SubnetName "mySubnet" `
-PublicIpAddressName "myPublicIPAddress" `
-LoadBalancerName "myLoadBalancer" `
-UpgradePolicyMode "Automatic" `
... |
combined_dataset/train/non-malicious/sample_45_95.ps1 | sample_45_95.ps1 | /* eslint-disable no-undef */
var plugin = require("plugin-vs-v2");
if (typeof plugin != "undefined") {
plugin.Messaging.addEventListener("pluginready", function () {
setHtmlText();
});
}
function setHtmlText() {
// resource strings used by docker.web.default.html
setTextContent("#dockerWebCor... |
combined_dataset/train/non-malicious/sample_32_51.ps1 | sample_32_51.ps1 |
function Update-AzDataProtectionBackupInstanceAssociatedPolicy
{
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBackupInstanceResource')]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('... |
combined_dataset/train/non-malicious/2333.ps1 | 2333.ps1 |
[CmdletBinding(DefaultParameterSetName = 'Default')]
param (
[Parameter()]
[ValidateNotNullOrEmpty()]
[string[]]$DhcpServer,
[Parameter(ParameterSetName = 'HostName')]
[ValidateNotNullOrEmpty()]
[string[]]$HostName,
[Parameter(ParameterSetName = 'MacAddress')]
[ValidateNotNullOrEmpty()]
[string[]]$MacAddr... |
combined_dataset/train/non-malicious/Add-SqlClientAlias.ps1 | Add-SqlClientAlias.ps1 | #######################
<#
.SYNOPSIS
Adds a SQL Server Client Alias by setting registry key.
.DESCRIPTION
Provides same functionality as cliconfg.exe GUI. Although there is a WMI provider to add client network aliases, the differences between SQL version make it diffult to use. This method creates the registry ke... |
combined_dataset/train/non-malicious/Test-WebDAV_3.ps1 | Test-WebDAV_3.ps1 | function Test-WebDav ()
{
param ( $Url = "$( throw 'URL parameter is required.')" )
$xhttp = New-Object -ComObject msxml2.xmlhttp
$xhttp.open("OPTIONS", $url, $false)
$xhttp.send()
if ( $xhttp.getResponseHeader("DAV") ) { $true }
else { $false }
}
|
combined_dataset/train/non-malicious/3225.ps1 | 3225.ps1 |
InModuleScope PoshBot {
describe 'Set-PoshBotStatefulData' {
BeforeAll {
$PSDefaultParameterValues = @{
'Set-PoshBotStatefulData:Verbose' = $false
}
$global:PoshBotContext = [pscustomobject]@{
Plugin = 'TestPl... |
combined_dataset/train/non-malicious/Force WSUS Check.ps1 | Force WSUS Check.ps1 | # Powershell Script to force clients check into WSUS server
# Import Active Directory PS Modules CMDLETS
Import-Module ActiveDirectory
$comps = Get-ADComputer -Filter {operatingsystem -like "*server*"}
$cred = Get-Credential
Foreach ($comp in $comps) {
Invoke-Command -computername $comp.Name -credential... |
combined_dataset/train/non-malicious/sample_2_9.ps1 | sample_2_9.ps1 | # Load Reporting Utilities
#_#$debug = $false
# Load Common Library:
. ./utils_cts.ps1
<# Load the SQL Common Library
. ./utils_DSD.ps1 #SQL
. ./TS_RemoteSetup.ps1 #Cluster,HyperV,Remote
. ./utils_Exchange.ps1
#>
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.Script... |
combined_dataset/train/non-malicious/sample_41_25.ps1 | sample_41_25.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicemanagerproxy'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicemanagerproxy.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Sup... |
combined_dataset/train/non-malicious/sample_62_17.ps1 | sample_62_17.ps1 | # Script: tss_ExportVPNProfiles.ps1
#region ::::: Script Input PARAMETERS :::::
#$ScriptVer="1.01" #Date: 2024-03-21
[CmdletBinding()]param(
[Parameter(Mandatory=$true, Position=0)] [String] $PrefixTime,
[Parameter(Mandatory=$true, Position=1)] [string] $TssPhase
)
function CollectNET_VpnProfiles {
# Get VPN... |
combined_dataset/train/non-malicious/sample_19_71.ps1 | sample_19_71.ps1 | ConvertFrom-StringData @'
id_ctsipsec=IPsec
id_ctsipsecdescription=Collects information about IPsec.
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlA... |
combined_dataset/train/non-malicious/sample_50_16.ps1 | sample_50_16.ps1 | #
# Script module for module 'Az.ApplicationInsights' that is executed when 'Az.ApplicationInsights' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:39
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
... |
combined_dataset/train/non-malicious/sample_23_57.ps1 | sample_23_57.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/98.ps1 | 98.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 ($Aad... |
combined_dataset/train/non-malicious/sample_44_35.ps1 | sample_44_35.ps1 | [CmdletBinding()]
param (
[string]$OutFile,
[string]$AltDownload,
[string]$Proxy,
[string]$AltHisEndpoint
)
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
$refVersion = [version] '4.5'
$provider = 'Microsoft.HybridCompute'
# Error codes used by azcmagent are ... |
combined_dataset/train/non-malicious/sample_57_79.ps1 | sample_57_79.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_0_74.ps1 | sample_0_74.ps1 | ConvertFrom-StringData @'
id_clustercsvd=Cluster Shared Volume information
id_clustercsvdesc=Obtaining information about Cluster Shared Volumes
'@
# SIG # Begin signature block
# MIIoPAYJKoZIhvcNAQcCoIIoLTCCKCkCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
... |
combined_dataset/train/non-malicious/2465.ps1 | 2465.ps1 | function New-LogEntry {
[CmdletBinding()]
param (
[Parameter(ValueFromRemainingArguments = $true)]
[string]$Message
)
begin {
$FilePath = 'C:\MyWorkLog.csv'
function Convert-TimeStringToTimeSpan($TimeString) {
$AllowedLabels = (New-TimeSpan).Psobject.Properties.Name
$AllowedLabels += $Allowed... |
combined_dataset/train/non-malicious/sample_49_78.ps1 | sample_49_78.ps1 | #
# Module manifest for module 'CloudCommon'
#
# Generated by: Microsoft Corporation
#
# Generated on: 2/2/2017
#
@{
# Script module or binary module file associated with this manifest.
#RootModule = ''
# Version number of this module.
ModuleVersion = '1.2100.2531.331'
# ID used to uniquely iden... |
combined_dataset/train/non-malicious/sample_57_8.ps1 | sample_57_8.ps1 | ##########################################################################
# DELL PROPRIETARY INFORMATION
#
# This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this
# software to you under the terms of a license agreement,nondisclosure agreement or both.
# You may not copy, disclose, o... |
combined_dataset/train/non-malicious/sample_49_15.ps1 | sample_49_15.ps1 | #
# Module manifest for module 'OCI.PSModules.Jmsjavadownloads'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported... |
combined_dataset/train/non-malicious/2170.ps1 | 2170.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/4328.ps1 | 4328.ps1 | function Get-DynamicParameters
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[Uri]
$Location,
[Parameter(Mandatory=$true)]
[REF]
$PackageManagementProvider
)
$paramDictionary = New-Object System.Managemen... |
combined_dataset/train/non-malicious/sample_52_12.ps1 | sample_52_12.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/27.ps1 | 27.ps1 | . $PSScriptRoot\Shared.ps1
InModuleScope posh-git {
Describe 'Get-GitBranch Tests' {
Context 'Get-GitBranch GIT_DIR Tests' {
It 'Returns GIT_DIR! when in .git dir of the repo' {
$repoRoot = (Resolve-Path $PSScriptRoot\..).Path
Set-Location $repoRoot\.git -ErrorAc... |
combined_dataset/train/non-malicious/sample_60_11.ps1 | sample_60_11.ps1 | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.verifyRFC3161Timestamp = void 0;
const core_1 = require("@sigstore/core");
const error_1 = require("../error");
const certificate_1 = require("../key/certificate");
const trust_1 = require("../trust");
function verifyRFC3161Timestamp(t... |
combined_dataset/train/non-malicious/2419.ps1 | 2419.ps1 |
[CmdletBinding()]
param (
[switch]$DeclineAllNonMatches,
[switch]$SyncWsus,
[string]$LogFilePath = "$PsScriptRoot\SCCM-WSUSUpdateSync.log",
[ValidateScript({ Test-Connection -ComputerName $_ -Quiet -Count 1})]
[string]$CmSiteServer = '',
[string]$CmSiteCode = '',
[ValidateScript({ Test-Connection -ComputerName ... |
combined_dataset/train/non-malicious/sample_10_55.ps1 | sample_10_55.ps1 | #************************************************
# DC_GetSQLSetupLogs.ps1
# Version 1.0.0
# Date: 8-19-2011
# Author: Shon Hauck - Shonh@Microsoft.com
# Description: Used to Get SQL Setup Logs (Bootstrap Directory for SQL 9, 10 , 10.5, 11)
#
# Date: 4-15-2020
# Modified By: João Polisel - JPolisel@Microsoft.co... |
combined_dataset/train/non-malicious/357ba246-f3a1-4446-97ea-d22781827866.ps1 | 357ba246-f3a1-4446-97ea-d22781827866.ps1 |
function Write-ProgressForm {
<#
.SYNOPSIS
Write-ProgressForm V1.0
GUI Replacement for PowerShell's Write-Progress command
.DESCRIPTION
GUI Replacement for PowerShell's Write-Progress command
Uses same named parameters for drop-in replacement
CAVEATS: You can't close the Form by clicking on it,... |
combined_dataset/train/non-malicious/sample_13_90.ps1 | sample_13_90.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/sample_23_78.ps1 | sample_23_78.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/sample_47_2.ps1 | sample_47_2.ps1 | Get-Module | ForEach-Object { Remove-Module -Name $_.Name -Force }
$PSModuleAutoloadingPreference = 'none'
Import-Module Microsoft.PowerShell.Utility
[void][System.Reflection.Assembly]::Load('System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
[void][System.Reflection.Assembly]::Load... |
combined_dataset/train/non-malicious/Export top n SQLPlans_1.ps1 | Export top n SQLPlans_1.ps1 | <#
ALZDBA SQLServer_Export_SQLPlans_SMO.ps1
Export top n consuming sqlplans via avg_worker_time (=cpu) for all databases of a given SQLServer (SQL2005+) Instance
results in a number of .SQLPlan files and the consumption overview .CSV file
#>
#requires -version 2
#SQLServer instance
$SQLInstance = 'uabe0db97\\ua... |
combined_dataset/train/non-malicious/Run-Query (SharePoint)_2.ps1 | Run-Query (SharePoint)_2.ps1 | function Run-Query($siteUrl, $queryText)
{
[reflection.assembly]::loadwithpartialname("microsoft.sharePOint") | out-null
[reflection.assembly]::loadwithpartialname("microsoft.office.server") | out-null
[reflection.assembly]::loadwithpartialname("microsoft.office.server.search") | out-null
$s = [microsoft.share... |
combined_dataset/train/non-malicious/sample_19_76.ps1 | sample_19_76.ps1 | @{
GUID="c61d6278-02a3-4618-ae37-a524d40a7f44 "
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
ModuleToProcess="PSDiagnostics.psm1"
Func... |
combined_dataset/train/non-malicious/2824.ps1 | 2824.ps1 | function Send-GraphiteMetric
{
param
(
[CmdletBinding(DefaultParametersetName = 'Date Object')]
[parameter(Mandatory = $true)]
[string]$CarbonServer,
[parameter(Mandatory = $false)]
[ValidateRange(1, 65535)]
[int]$CarbonServerPort = 2003,
[parameter(Man... |
combined_dataset/train/non-malicious/sample_54_40.ps1 | sample_54_40.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_49_76.ps1 | sample_49_76.ps1 | # Copyright (C) Intel Corporation, 2021 All Rights Reserved.
function Invoke-GenerateKeyPair {
<#
.Synopsis
Generate Key Pair.
.Description
This cmdlet generates a KeyPair object and adds the new key to AMT.
.Notes
AMT Provisioning:
The vPro client AMT firmware must be provisione... |
combined_dataset/train/non-malicious/sample_65_82.ps1 | sample_65_82.ps1 | #
# Module manifest for module 'OCI.PSModules.Streaming'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Streaming.dll'
# Version number of this module.
ModuleVersion = '90.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_55_57.ps1 | sample_55_57.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=An environment variable of this name and type already exists.
EnvironmentErrorDoesNotExists=An environment variable of this name and type does not exist.
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# ... |
combined_dataset/train/non-malicious/sample_33_94.ps1 | sample_33_94.ps1 | var state = command.getTrait("state");
var manipData = services.manipulators.getManipulatorData("CameraManipulator");
var mode = null;
if (manipData != null) {
mode = manipData.getTrait("CameraManipulationMode");
}
var tool = new Object();
tool.activate = function () {
state.value = 2;
if... |
combined_dataset/train/non-malicious/sample_57_29.ps1 | sample_57_29.ps1 | aΟ περιορισμός PrintAllTranslations δεν μπορεί να χρησιμοποιηθεί με περιορισμό IgnoreTranslations. Δεν έχετε τη δυνατότητα να προσθέσετε την υπολογιζόμενη στήλη "%{oii_column/}" στον υβριδικό πίνακα "%{oii_table/}". Καταργήστε την υπολογιζόμενη στήλη.¯Δεν έχετε τη δυνατότητα να προσθέσετε μια στήλη "alternateOf" η οπο... |
combined_dataset/train/non-malicious/elevate-process (sudo).ps1 | elevate-process (sudo).ps1 | function elevate-process
{
$file, [string]$arguments = $args;
$psi = new-object System.Diagnostics.ProcessStartInfo $file;
$psi.Arguments = $arguments;
$psi.Verb = "runas";
$psi.WorkingDirectory = get-location;
[System.Diagnostics.Process]::Start($psi);
}
set-alias sudo elevate-process;
|
combined_dataset/train/non-malicious/40.ps1 | 40.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 -N... |
combined_dataset/train/non-malicious/sample_30_5.ps1 | sample_30_5.ps1 | ##########################################################################################
# <copyright file="Microsoft.EnterpriseManagement.Shell.Functions.ps1" company="Microsoft">
# Copyright (c) Microsoft Corporation. All rights reserved.
# </copyright>
# <summary>Microsoft.EnterpriseManagement.OperationsM... |
combined_dataset/train/non-malicious/PerformanceHistory 2.52.ps1 | PerformanceHistory 2.52.ps1 | ##requires -version 2.0
## Get-PerformanceHistory.ps1
##############################################################################################################
## Lets you see the amount of time recent commands in your history have taken
## History:
## v2.52 - added regex-based iteration counting to calculate... |
combined_dataset/train/non-malicious/sample_67_83.ps1 | sample_67_83.ps1 | # Localized 06/28/2023 08:04 AM (GMT) 303:7.0.30723 terminalservices_model.psd1
#
# Only add new (name,value) pairs to the end of this table
# Do not remove, insert or re-arrange entries
#
ConvertFrom-StringData @'
###PSLOC start localizing
#
# ActivationStatusCheck
#
Activation... |
combined_dataset/train/non-malicious/59.ps1 | 59.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 ($Aad... |
combined_dataset/train/non-malicious/sample_50_35.ps1 | sample_50_35.ps1 | $url = $args[0]
Write-Host "Downloading Microsoft Edge Beta"
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\microsoft-edge-beta.msi"
$wc.Downloadfile($url, $msiInstaller)
Write-Host "Installing Microsoft Edge Beta"
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $argument... |
combined_dataset/train/non-malicious/sample_7_86.ps1 | sample_7_86.ps1 | . ./utils_cts.ps1
SkipSecondExecution
Consume-GenericMessages
# SIG # Begin signature block
# MIIoPAYJKoZIhvcNAQcCoIIoLTCCKCkCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDMPV42+aNUJPQ4
# ASdUcqzQU9xIEqt... |
combined_dataset/train/non-malicious/sample_59_94.ps1 | sample_59_94.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_6_60.ps1 | sample_6_60.ps1 | # DC_RunSqlDiagScripts.ps1
# This script has dependencies on utils_CTS and utils_DSD
#
param( [Object[]] $instances, [switch]$CollectSqlDiag, [switch]$CollectAlwaysOnInfo )
#_# SQLDIAG script name for SQL Server 2014
New-Variable SQL_SCRIPT_SQLDIAG_2014 -Value "sp_sqldiag12.sql" -Option ReadOnly
#... |
combined_dataset/train/non-malicious/sample_47_19.ps1 | sample_47_19.ps1 |
///////////////////////////////////////////////////////////////////////////////
// Helper to set a designer prop
///////////////////////////////////////////////////////////////////////////////
function setDesignerProp(tname, ttype, tvalue) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)... |
combined_dataset/train/non-malicious/sample_31_37.ps1 | sample_31_37.ps1 |
. $PSScriptRoot\PathProcessingNonExistingPaths.ps1
. $PSScriptRoot\PathProcessingNoWildcards.ps1
. $PSScriptRoot\PathProcessingWildcards.ps1
# SIG # Begin signature block
# MIIreQYJKoZIhvcNAQcCoIIrajCCK2YCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7... |
combined_dataset/train/non-malicious/sample_8_83.ps1 | sample_8_83.ps1 | ConvertFrom-StringData @'
id_printspooleroldsplshd_sd=Orphaned print jobs were detected in Spooler folder and this may affect printing performance
'@
# SIG # Begin signature block
# MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG... |
combined_dataset/train/non-malicious/1435.ps1 | 1435.ps1 |
function Grant-CPrivilege
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Identity,
[Parameter(Mandatory=$true)]
[string[]]
$Privilege
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet ... |
combined_dataset/train/non-malicious/2673.ps1 | 2673.ps1 |
[CmdletBinding()]
param
(
[Parameter(Mandatory = $false, HelpMessage="Optional administration credentials")]
[PSCredential] $Credentials,
[Parameter(Mandatory = $true, HelpMessage="Required Site Url")]
[string] $Url,
[Parameter(Mandatory = $false, HelpMessage="Optional Force switch")]
[sw... |
combined_dataset/train/non-malicious/1970.ps1 | 1970.ps1 |
Describe 'Unit tests for JsonObject' -tags "CI" {
BeforeAll {
$jsonWithEmptyKey = '{"": "Value"}'
$jsonContainingKeysWithDifferentCasing = '{"key1": "Value1", "Key1": "Value2"}'
$testCasesJsonDepthWithAndWithoutReturnHashTable = @(
@{ Depth = 2; ReturnHashTable = $true }
... |
combined_dataset/train/non-malicious/1056.ps1 | 1056.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$carbonTestInstaller = Join-Path -Path $PSScriptRoot -ChildPath 'MSI\CarbonTestInstaller.msi' -Resolve
$carbonTestInstallerActions = Join-Path -Path $PSScriptRoot -ChildPath 'MSI\CarbonTestInstallerWithCustomActions.msi' -Reso... |
combined_dataset/train/non-malicious/2648.ps1 | 2648.ps1 |
$db = Get-ChildItem '\\TARKIN\C$\Backups' -Recurse | Where-Object {$_.Extension -eq '.bak'}
foreach($d in $db){
$header = Invoke-Sqlcmd -ServerInstance TARKIN -Database tempdb "RESTORE HEADERONLY FROM DISK='$($d.FullName)'"
Restore-SqlDatabase -ServerInstance TARKIN -Database $header.DatabaseName ... |
combined_dataset/train/non-malicious/ADFS troubleshooting_1.ps1 | ADFS troubleshooting_1.ps1 | <#
This Script will check the MSOnline Office 365 setup. It will prompt the user running it to specify the
credentials. It will then check compare the onsite information with the online information and inform the
user if it is out of sync.
#>
$PSAdmin = Read-host "This script needs to be run as Administrator,... |
combined_dataset/train/non-malicious/sample_30_81.ps1 | sample_30_81.ps1 | # Initialize variables if they aren't already defined.
# These may be defined as parameters of the importing script, or set after importing this script.
# CI mode - set to true on CI server for PR validation build or official build.
[bool]$ci = if (Test-Path variable:ci) { $ci } else { $false }
# Build configuration.... |
combined_dataset/train/non-malicious/sample_51_54.ps1 | sample_51_54.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 = '73.1.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_28_36.ps1 | sample_28_36.ps1 | ConvertFrom-StringData @'
###PSLOC
CheckNICConnectivity = Find out which NICs are able to connect on each node.
NoPingableConnections = Server '{0:ServerName}' does not have any pingable connections. Could be caused by the failed network configuration step or, less likely, a hardware failure.
NetworkingAlreadyConfi... |
combined_dataset/train/non-malicious/sample_11_21.ps1 | sample_11_21.ps1 | ConvertFrom-StringData @'
id_filesnottobackup2k3check_st=There are too many HKLM\\SYSTEM\\CurrentControlSet\\Control\\BackupRestore\\FilesNotToBackup entries and this may cause problems with ntbackup
'@
# SIG # Begin signature block
# MIIoUwYJKoZIhvcNAQcCoIIoRDCCKEACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgE... |
combined_dataset/train/non-malicious/SearchZIP_4.psm1 .ps1 | SearchZIP_4.psm1 .ps1 | function SearchZIPfiles {
<#
.SYNOPSIS
Search for (filename) strings inside compressed ZIP or RAR files (V2.8).
.DESCRIPTION
In any directory containing a large number of ZIP/RAR compressed Web Page files
this procedure will search each individual file name for simple text strings,
listing both the source RAR... |
combined_dataset/train/non-malicious/sample_59_68.ps1 | sample_59_68.ps1 | #
# Module manifest for module 'OCI.PSModules.Integration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Integration.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/1043.ps1 | 1043.ps1 |
[CmdletBinding()]
param(
[Switch]
$SkipWebsite
)
Set-StrictMode -Version Latest
& (Join-Path -Path $PSScriptRoot -ChildPath 'Carbon\Import-Carbon.ps1' -Resolve)
& (Join-Path -Path $PSScriptRoot -ChildPath 'Tools\Silk\Import-Silk.ps1' -Resolve)
$licenseFileName = 'LICENSE.txt'
$noticeFileName = 'NOTICE... |
combined_dataset/train/non-malicious/2275.ps1 | 2275.ps1 | param(
[parameter(Mandatory=$false)]
$SiteServer,
[parameter(Mandatory=$false)]
$TaskSequence
)
function Load-Form {
$Form.Controls.AddRange(@($DGVPackageRef, $DGVPackageDP, $ButtonValidate, $ButtonRedist, $OutputBox, $GBPackageRef, $GBPackageDP, $GBPackageOption, $GBPackageInfo))
$ButtonValidate.Enabled = $fa... |
combined_dataset/train/non-malicious/3403.ps1 | 3403.ps1 |
function Test-SetAzureRmVMSqlServerAKVExtension
{
Set-StrictMode -Version latest; $ErrorActionPreference = 'Stop'
$rgname = Get-ComputeTestResourceName
$loc = Get-ComputeVMLocation
try
{
New-AzureRmResourceGroup -Name $rgname -Location $loc -Force;
$vmsize... |
combined_dataset/train/non-malicious/2028.ps1 | 2028.ps1 |
Describe "Parameter Binding Tests" -Tags "CI" {
It "Should throw a parameter binding exception when two parameters have the same position" {
function test-PositionalBinding1 {
[CmdletBinding()]
param (
[Parameter(Position = 0)] [int]$Parameter1 = 0,
[Paramet... |
combined_dataset/train/non-malicious/sample_64_13.ps1 | sample_64_13.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/Send-HTMLFormattedEmail_4.ps1 | Send-HTMLFormattedEmail_4.ps1 | ##################################################
# cmdlets
##################################################
#-------------------------------------------------
# Send-HTMLFormattedEmail
#-------------------------------------------------
# Usage: Send-HTMLFormattedEmail -?
#------------------------------------... |
combined_dataset/train/non-malicious/sample_40_75.ps1 | sample_40_75.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydataplane.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Support... |
combined_dataset/train/non-malicious/New-ISEMenu_4.ps1 | New-ISEMenu_4.ps1 | Import-Module ShowUI
Function New-ISEMenu {
New-Grid -AllowDrop:$true -Name "ISEAddonCreator" -columns Auto, * -rows Auto,Auto,Auto,*,Auto,Auto -Margin 5 {
New-Label -Name Warning -Foreground Red -FontWeight Bold -Column 1
($target = New-TextBox -Name txtName -Column 1 -Row ($Row=1))
New-Label... |
combined_dataset/train/non-malicious/sample_56_46.ps1 | sample_56_46.ps1 | #
# Module manifest for module 'OCI.PSModules.Core'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Core.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/ShowUI Weather Widget.ps1 | ShowUI Weather Widget.ps1 |
## And a slick weather widget using Yahoo's forecast and images
New-UIWidget -AsJob {
Grid {
Rectangle -RadiusX 10 -RadiusY 10 -StrokeThickness 0 -Width 170 -Height 80 -HorizontalAlignment Left -VerticalAlignment Top -Margin "60,40,0,0" -Fill {
LinearGradientBrush -Start "0.5,0" -End "0.... |
combined_dataset/train/non-malicious/sample_67_36.ps1 | sample_67_36.ps1 | <#
.SYNOPSIS
This module is part of TSS FW and implements support for tracing Container scenarios
.DESCRIPTION
This module is part of TSS FW and implements support for tracing Container scenarios
.NOTES
Dev. Lead: wiaftrin, milanmil
Authors : wiaftrin, milanmil
Requires : PowerShell V4(Supported f... |
combined_dataset/train/non-malicious/sample_64_30.ps1 | sample_64_30.ps1 | #
# Module manifest for module 'OCI.PSModules.Cims'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cims.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_46_75.ps1 | sample_46_75.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/sample_17_53.ps1 | sample_17_53.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/Get-Computer.ps1 | Get-Computer.ps1 | function Get-Computer {
<#
.Synopsis
Retrieves basic information about a computer.
.Description
The Get-Computer cmdlet retrieves basic information such as
computer name, domain or workgroup name, and whether or not the computer
is on a workgroup or a domain for the local computer.
.Exa... |
combined_dataset/train/non-malicious/sample_1_7.ps1 | sample_1_7.ps1 | #************************************************
# DC_TaskListSvc.ps1
# Version 1.1
# Date: 2014,2019
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about running services
# Called from: Networking Diagnostics
#*******************************************************
Trap [E... |
combined_dataset/train/non-malicious/chkhash_20.ps1 | chkhash_20.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.