full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/3100.ps1 | 3100.ps1 |
$buildDir = "$PSScriptRoot\build"
$ErrorActionPreference = 'Stop'
if (Test-Path $buildDir) {
Write-Verbose "Removing build dir"
Remove-Item $buildDir -Recurse -Force -Confirm:$false -Verbose -ErrorAction 'Stop'
}
if (Test-Path "$PSScriptRoot\Examples") {
Write-Verbose "Removing all examples"
... |
combined_dataset/train/non-malicious/3388.ps1 | 3388.ps1 |
function Test-VirtualMachineScaleSet
{
Test-VirtualMachineScaleSet-Common $false
}
function Test-VirtualMachineScaleSet-ManagedDisks
{
Test-VirtualMachineScaleSet-Common $true
}
function Test-VirtualMachineScaleSet-Common($IsManaged)
{
$rgname = Get-ComputeTestResourceName
try
... |
combined_dataset/train/non-malicious/3045.ps1 | 3045.ps1 | function Should-Contain($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
[bool] $succeeded = $ActualValue -contains $ExpectedValue
if ($Negate) {
$succeeded = -not $succeeded
}
if (-not $succeeded) {
if ($Negate) {
return New-Object psobject -Propert... |
combined_dataset/train/non-malicious/Get-ProxyAddress.ps1 | Get-ProxyAddress.ps1 | Param (
[Parameter(Mandatory=$true,
Position=0,
ValueFromPipeline=$true,
HelpMessage="Enter SMTP address to search for in Active-Directory."
)]
[string]$objSMTP
)
Function Get-ProxyAddresses ([string]$Address){
$objAD = $null
$objAD = Get-QADObject -LdapFilter "(proxyAddre... |
combined_dataset/train/non-malicious/sample_5_14.ps1 | sample_5_14.ps1 | #************************************************
# TS_DfsrUpdateWorkerThreadCountCheck.ps1
# Version 1.0.1
# Date: 6/15/2012
# Author: v-blchen
# Description: [Idea ID 2831] [Windows] DFSR Reg setting UpdateWorkerThreadCount = 64 may cause hang
# Rule number: 2831
# Rule URL: http://sharepoint/sites/rules/Ru... |
combined_dataset/train/non-malicious/sample_31_85.ps1 | sample_31_85.ps1 | #
# Module manifest for module 'NetworkControllerFc'
#
# Generated by: vinodko
#
# Generated on: 1/31/2023
#
@{
# Script module or binary module file associated with this manifest.
RootModule = ''
# Version number of this module.
ModuleVersion = '1.1.0'
# ID used to uniquely identify this module... |
combined_dataset/train/non-malicious/sample_20_38.ps1 | sample_20_38.ps1 | #************************************************
# TS_ServicingCorruptionCheck.ps1
# Version 1.0.1
# Date: 12/28/2012
# Author: v-kaw
# Description: [Idea ID 5712] [Windows] Run Dism checkhealth on Win8 or 2012 to detect possible servicing corruption
# Rule number: 5712
# Rule URL: http://sharepoint/sites/ru... |
combined_dataset/train/non-malicious/4224.ps1 | 4224.ps1 | function Invoke-WScriptBypassUAC
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True)]
[string]
$payload
)
function Local:Get-TempFileName {
$sTempFolder = $env:Temp
$sTempFolder = $sTempFolder + "\"
$sTempFileName = [System.IO.Path]::Get... |
combined_dataset/train/non-malicious/Take-Screenshot.ps1 | Take-Screenshot.ps1 | Function Take-ScreenShot {
<#
.SYNOPSIS
Used to take a screenshot of the desktop or the active window.
.DESCRIPTION
Used to take a screenshot of the desktop or the active window and save to an image file if needed.
.PARAMETER screen
Screenshot of the entire screen
.PARAMETER activewindow
... |
combined_dataset/train/non-malicious/sample_42_89.ps1 | sample_42_89.ps1 | #
# Module manifest for module 'OCI.PSModules.Computecloudatcustomer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computecloudatcustomer.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
... |
combined_dataset/train/non-malicious/sample_11_2.ps1 | sample_11_2.ps1 | import { BundledLanguageInfo, DynamicImportLanguageRegistration } from 'shikiji-core';
/**
* Generated by scripts/prepare.ts
*/
declare const bundledLanguagesInfo: BundledLanguageInfo[];
declare const bundledLanguagesBase: {
[k: string]: DynamicImportLanguageRegistration;
};
declare const bundledLanguagesAlias:... |
combined_dataset/train/non-malicious/sample_29_0.ps1 | sample_29_0.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_26_71.ps1 | sample_26_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Announcementsservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Announcementsservice.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# S... |
combined_dataset/train/non-malicious/sample_18_48.ps1 | sample_18_48.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-диска.... |
combined_dataset/train/non-malicious/sample_65_30.ps1 | sample_65_30.ps1 | @(echo off) > $null
if #ftw NEQ '' goto :init
($true){ $Error.clear(); }
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# wrapper script for vcpkg
# this is intended to be dot-sourced and then you can use the vcpkg() function
# Workaround for $IsWindows not existing in Windows PowerShell
if... |
combined_dataset/train/non-malicious/Backup AdventureWorks.ps1 | Backup AdventureWorks.ps1 | Invoke-SqlBackup -sqlserver "WIN7\\Kilimanjaro" -dbname "AdventureWorks" `
-filepath "C:\\Temp\\AdventureWorks_db_$(((Get-Date).ToString("yyyyMMddHHmm"))).bak"
|
combined_dataset/train/non-malicious/sample_16_18.ps1 | sample_16_18.ps1 | ConvertFrom-StringData @'
id_systemfiles_title=System Files
id_systemfiles_status=Collecting System Files
id_systemfilesdirectorylistings_title=System Files Directory Listings
id_systemfilesdirectorylistings_status=Collecting System Files Directory Listings
id_systemfilesacllistings_title=System Files ACL Listings... |
combined_dataset/train/non-malicious/sample_21_77.ps1 | sample_21_77.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
#
# Azure File Sync (AFS): repair the corrupted event channels
#
... |
combined_dataset/train/non-malicious/sample_12_41.ps1 | sample_12_41.ps1 | ###########################################################################
# DC_Disk_Quota
# Version 1.0
# Date: 09-26-2012
# Author: mifannin
# Description: Collects Disk Quota Data
###########################################################################
Import-LocalizedData -BindingVariable Quota -FileNa... |
combined_dataset/train/non-malicious/sample_42_22.ps1 | sample_42_22.ps1 | function trySetDesignerProp(tname, ttype, val) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0);
trait.value = val;
// services.debug.trace(tname + "=" + val);
}
if (command.getTrait("state").value == 0) {
command.getTrait("state").value = 2;
trySetDesignerProp("snap",... |
combined_dataset/train/non-malicious/ConvertTo-Hex_7.ps1 | ConvertTo-Hex_7.ps1 | # Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx
param ( [string]$SidString )
# Create SID .NET object using SID string provided
$sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring
# Create a byte array of the proper length
$sidBytes = New-Object byte[] ... |
combined_dataset/train/non-malicious/a83538ba-c3bf-4a64-9961-04a6b9a4f0a9.ps1 | a83538ba-c3bf-4a64-9961-04a6b9a4f0a9.ps1 | # This script supports being run with -WhatIf and -Confirm parameters.
[CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')]
param (
# Regex of the states that should be included in the process killing field.
[string]$IncludeStates = '^(Disc)$', # Only DISCONNECTED sessions by default.
#... |
combined_dataset/train/non-malicious/TruncatePath.ps1 | TruncatePath.ps1 | ###
# TruncatePath
# Version 1.0.6 (05 Nov 2008)
# Description: Replaces long provider paths in the prompt with ellipses
# Notes: Place in your profile
#
# By Mike Hays, http://www.mike-hays.net
###
$maxPathLength = 40
$showFullPath = $false
Function Prompt
{
$currentPath = (Get-Location).Path
if ( ... |
combined_dataset/train/non-malicious/sample_0_11.ps1 | sample_0_11.ps1 | #************************************************
# TS_InfoCacheLevelCheck.ps1
# Version 1.0
# Date: 1-2-2012
# Author: v-anecho
# Description: If you are experiencing slow logons or slow enumeration of shares, the InfoCacheLevel registry value may resolve the issue.
#*********************************************... |
combined_dataset/train/non-malicious/1229.ps1 | 1229.ps1 |
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
function Assert-WebsiteBinding
{
param(
[string[]]
$Binding
)
$website = Get-IisWebsite -Name $SiteName
[string[]]$actualBindings = $website.Bindings | ForEac... |
combined_dataset/train/non-malicious/sample_55_10.ps1 | sample_55_10.ps1 | @{
GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
FunctionsToExport = @()
CmdletsToExport = "Get-Credential", "Get-ExecutionP... |
combined_dataset/train/non-malicious/sample_5_33.ps1 | sample_5_33.ps1 | @{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.ServiceFabric.Powershell'
# Version number of this module.
ModuleVersion = '3.1.0.0'
# ID used to uniquely identify this module
GUID = 'd2c42633-5254-4a82-a312-1dc0697a55cd'
# Author of this module
Author = '... |
combined_dataset/train/non-malicious/sample_37_72.ps1 | sample_37_72.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 = '80.0.0'
... |
combined_dataset/train/non-malicious/sample_20_75.ps1 | sample_20_75.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al... |
combined_dataset/train/non-malicious/1831.ps1 | 1831.ps1 |
Describe "Tests for New-PSDrive cmdlet." -Tag "CI","RequireAdminOnWindows" {
Context "Validate New-PSDrive Cmdlet with -Persist switch." {
BeforeEach {
$UsedDrives = Get-PSDrive | Select-Object -ExpandProperty Name
$PSDriveName = 'D'..'Z' | Where-Object -FilterScript {$_ -notin $... |
combined_dataset/train/non-malicious/validate an IP address_4.ps1 | validate an IP address_4.ps1 | # validate given IP address as an IPAdress (given string input)
PARAM($IP=$(read-host "Enter any IP Address"))
## YOU could do this, but ...
# $IP -match "(\\d{1,3}).(\\d{1,3}).(\\d{1,3}).(\\d{1,3})" -and -not ([int[]]$matches[1..4] -gt 255)
## you shouldn't parse things yourself when it's in the framework. You... |
combined_dataset/train/non-malicious/Backup-ModifiedGPOsv1.1.ps1 | Backup-ModifiedGPOsv1.1.ps1 | ###########################################################################"
#
# NAME: Backup-ModifiedGPOs.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jan.egil.ring@powershell.no
#
# COMMENT: All Group Policy Objects modified in the specified timespan are backup up to the specified backup path.
# For more d... |
combined_dataset/train/non-malicious/sample_65_57.ps1 | sample_65_57.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/sample_23_44.ps1 | sample_23_44.ps1 | #
# Script module for module 'Az.Billing' that is executed when 'Az.Billing' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 05/16/2024 06:33:06
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
... |
combined_dataset/train/non-malicious/1740.ps1 | 1740.ps1 |
param(
[string] $SigningXmlPath = (Join-Path -Path $PSScriptRoot -ChildPath 'signing.xml'),
[switch] $SkipPwshExe
)
if ($SkipPwshExe) {
$xmlContent = Get-Content $SigningXmlPath | Where-Object { $_ -notmatch '__INPATHROOT__\\pwsh.exe' }
} else {
$xmlContent = Get-Content $signingXmlPath |... |
combined_dataset/train/non-malicious/sample_25_80.ps1 | sample_25_80.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/sample_21_84.ps1 | sample_21_84.ps1 | ###########################################################
#
# 'ExtensionService' module
#
###########################################################
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
Import-Module "$PSScriptRoot\ServiceHelper.psm1"
$script:GCInstallPath = "$PSScriptRoot\..... |
combined_dataset/train/non-malicious/sample_61_73.ps1 | sample_61_73.ps1 | # Name: tss_update-script.ps1 for TSS (former TSSv2)
<#
.SYNOPSIS
Script to [auto-]update TSS to latest version or download latest zip from CesdiagTools/GitHub.
.DESCRIPTION
Script will search on "https://microsoft.githubenterprise.com/css-windows/WindowsCSSToolsDevRep/releases/tag" for latest TSS version
... |
combined_dataset/train/non-malicious/sample_12_46.ps1 | sample_12_46.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\typescript@5.3.3\node_modules\typescript\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\typ... |
combined_dataset/train/non-malicious/sample_36_56.ps1 | sample_36_56.ps1 | @{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.NetworkController.Powershell'
# Version number of this module.
ModuleVersion = '1.0.0.0'
# ID used to uniquely identify this module
GUID = '05718206-c147-47b6-83f5-92f52af61c6e'
# Author of this module
Author... |
combined_dataset/train/non-malicious/1045.ps1 | 1045.ps1 |
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$rootDir = $null
$childDir = $null
$grandchildFile = $null
$childFile = $null
function Assert-EverythingCompressed
{
Assert-Compressed -Path $rootDir
Assert-Compressed -Path $childDi... |
combined_dataset/train/non-malicious/sample_39_12.ps1 | sample_39_12.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 = '75.1.0'
# Supported P... |
combined_dataset/train/non-malicious/2595.ps1 | 2595.ps1 | 
param(
$ServerList = "E:\Dexma\Servers.txt"
, $ReportFileName = "E:\Dexma\FreeSpace.htm"
, $EmailTo = "mmessano@primealliancesolutions.com"
, $EmailFrom = "mmessano@primealliancesolutions.com"
, $EmailSubject = "Disk Space Report for $Domain"
, $SMTPServer = "10.0.5.199"
)
clear
$Domain = [System.Direct... |
combined_dataset/train/non-malicious/Get-NaShares.ps1 | Get-NaShares.ps1 | # Glenn Sizemore www . Get-Admin . Com
# Requires the NetApp OnTap SDK v3.5
#
# Will connect to the destination Filer and retrieve all cifs shares,
# and there permissions. While we can get cifs information directly
# from a filer we can't get ACL information easily. The only options
# are either RPC(too hard ... |
combined_dataset/train/non-malicious/1949.ps1 | 1949.ps1 |
Describe "Get-PSBreakpoint" -Tags "CI" {
$scriptName = "Get-PSBreakpoint.Tests.ps1"
$fullScriptPath = Join-Path -Path $PSScriptRoot -ChildPath $scriptName
AfterEach {
Get-PSBreakpoint -Script $fullScriptPath | Remove-PSBreakpoint
}
It "should be able to get PSBreakpoint with using Id sw... |
combined_dataset/train/non-malicious/sample_46_22.ps1 | sample_46_22.ps1 | #
# Module manifest for module 'OCI.PSModules.Workrequests'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Workrequests.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_41_0.ps1 | sample_41_0.ps1 | # Localized 04/14/2024 08:54 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=Д&а
PromptNoString=&Нет
BundleFound=Найденный набор: {0}
PackageFound=Обнаружен пакет: {0}
EncryptedBundleFound=Найден зашифрованный набор: {0}
EncryptedPackageFoun... |
combined_dataset/train/non-malicious/sample_66_51.ps1 | sample_66_51.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.Synopsis
Group Policy tools use administrative template files (.admx, .adml) to populate policy settings in the user interface.
This allows administrators to manage registry-based policy settings.
This script installes Powe... |
combined_dataset/train/non-malicious/3805.ps1 | 3805.ps1 |
function New-WADConfigFromTemplate ($inputPath, $outputPath, $storageAccountName)
{
(Get-Content $inputPath).replace('[StorageAccountName]', $storageAccountName) | Set-Content $outputPath;
}
function Test-DiagnosticsExtensionBasic
{
$rgname = Get-ComputeTestResourceName
$loc = Get-ComputeVM... |
combined_dataset/train/non-malicious/912.ps1 | 912.ps1 |
$subscriptionId = "yourSubscriptionId"
$resourceGroupName ="yourResourceGroupName"
$snapshotName = "yourSnapshotName"
$sasExpiryDuration = "3600"
$storageAccountName = "yourstorageaccountName"
$storageContainerName = "yourstoragecontainername"
$storageAccountKey = 'yourStorageAccountKey'
$destinationVHD... |
combined_dataset/train/non-malicious/sample_62_23.ps1 | sample_62_23.ps1 | <#
.SYNOPSIS
SyncShare.psd1 file
This is a place-holder module file only for agent patch build purposes
#>
Write-Host "This module functionality is deprecated and is place-holder only"
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEE... |
combined_dataset/train/non-malicious/sample_24_63.ps1 | sample_24_63.ps1 | @{
# Script module or binary module file associated with this manifest.
RootModule = 'JustEnoughAdministration.psm1'
DscResourcesToExport = 'JeaEndpoint'
# Version number of this module.
ModuleVersion = '1.0'
# ID used to uniquely identify this module
GUID = '12801695-aad7-42ff-... |
combined_dataset/train/non-malicious/sample_37_19.ps1 | sample_37_19.ps1 | <TemplateItem>
<Name>Code - Handle errors</Name>
<IconType>.svg</IconType>
<IconData>H4sIAAAAAAAACrVV224bNxB9z1ewCxSIAYrL4Z2ylQBZp0EBpw1Qp0XzpkpraRt5V1htLKdf30Ou
5EugAn1oZcHkkDNnztyoi9f3txt2V/e7pmtnBQlZsLpddMumXc2Kj9c/TELBdsO8Xc43XVvPirYr
Xr96cfHd5c/V9e8f3rLd3Yp9+Pjm6seKFZOy/E1XZXl5fcl++fUdI0Fl+fangh... |
combined_dataset/train/non-malicious/57.ps1 | 57.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_63_13.ps1 | sample_63_13.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 = '85.2.0'
# Supported P... |
combined_dataset/train/non-malicious/756.ps1 | 756.ps1 | $ModuleManifestName = 'SampleModule.psd1'
Import-Module $PSScriptRoot\..\$ModuleManifestName
Describe 'Module Manifest Tests' {
It 'Passes Test-ModuleManifest' {
Test-ModuleManifest -Path $PSScriptRoot\..\$ModuleManifestName
$? | Should Be $true
}
}
|
combined_dataset/train/non-malicious/sample_21_43.ps1 | sample_21_43.ps1 | ConvertFrom-StringData @'
id_sccm_activity_collectconfigmgrlogs=Obtaining Configuration Manager Logs
id_sccm_ccm_collectconfigmgrlogs=Copying CCM Logs...
id_sccm_sms_collectconfigmgrlogs=Copying SMS Logs...
id_sccm_crashdumps_collectconfigmgrlogs=Copying most recent copy of SMS CrashDumps...
id_sccm_adminui_collec... |
combined_dataset/train/non-malicious/sample_0_9.ps1 | sample_0_9.ps1 | [
Description ("DCIM_NetworkAttribute represents the Network device attribute details."),
Provider ("dcismprovider"),
Version ("1.0.0"),
Invisible
]
class DCIM_NetworkAttributes{
[
Description ("A unique identifier for the instance."),
Key
]
string InstanceID;
... |
combined_dataset/train/non-malicious/sample_3_82.ps1 | sample_3_82.ps1 | #$debug = $false
# Load Common Library:
. ./utils_cts.ps1
# Load DSD Common Function Library
. ./utils_DSD.ps1
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo... |
combined_dataset/train/non-malicious/UIAutomation Simple 2.ps1 | UIAutomation Simple 2.ps1 | [Reflection.Assembly]::Load("UIAutomationClient, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
[Reflection.Assembly]::Load("UIAutomationTypes, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
function Select-Window {
PARAM( [string]$Text="*", [switch]$Recurse,
[Syst... |
combined_dataset/train/non-malicious/sample_26_1.ps1 | sample_26_1.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmsynthetics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmsynthetics.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/154.ps1 | 154.ps1 | function Get-SCSMIRComment
{
[CmdletBinding()]
PARAM
(
[System.WorkItem.Incident[]]$Incident
)
PROCESS
{
FOREACH ($IR in $Incident)
{
TRY
{
$FilteredIncidents = $IR.AppliesToTroubleTicket | Where-Object {
... |
combined_dataset/train/non-malicious/sample_12_23.ps1 | sample_12_23.ps1 | #
# Module manifest for module 'OCI.PSModules.Computeinstanceagent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computeinstanceagent.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# S... |
combined_dataset/train/non-malicious/sample_42_76.ps1 | sample_42_76.ps1 | # Localized 05/08/2024 05:10 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/ADFS MSOL update.ps1 | ADFS MSOL update.ps1 | Add-PSSnapin Microsoft.Adfs.Powershell
Import-Module MSOnline
$cred = Get-Credential
$AdfsServer = Read-Host "Please type the name of the ADFS server"
Write-Host "Connecting to MSOnline..."
Connect-MsolService -credential:$cred
Write-Host "Setting the local ADFS server..."
Set-MSOLADFSContext -Computer:$Ad... |
combined_dataset/train/non-malicious/2815.ps1 | 2815.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(ImagePath, LaunchString, MD5) as ct,
ImagePath,
LaunchString,
MD5,
Time,
Publisher
FROM
*autorunsc.tsv
WHERE
ImagePath is not null and
Publisher not like '(Verified)%' a... |
combined_dataset/train/non-malicious/sample_60_1.ps1 | sample_60_1.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_10_14.ps1 | sample_10_14.ps1 | ##----------------------------------------------------------------------------
## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved.
##---------------------------------------------------------------------------
# Import shared functions and vars
. .\Commonalities.ps1
. .\StringConstants.ps1
Wr... |
combined_dataset/train/non-malicious/Invoke-Command.ps1 | Invoke-Command.ps1 | Param($file,$cmd,[switch]$whatif,[switch]$verbose)
Begin{
function Ping-Server {
Param([string]$srv)
$pingresult = Get-WmiObject win32_pingstatus -f "address='$srv'"
if($pingresult.statuscode -eq 0) {$true} else {$false}
}
$servers = @()
}
Process{
if($_)
{
... |
combined_dataset/train/non-malicious/chkhash_15.ps1 | chkhash_15.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... |
combined_dataset/train/non-malicious/sample_43_67.ps1 | sample_43_67.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/Down with SOPA!.ps1 | Down with SOPA!.ps1 | <#
.Synopsis
Let's fill the logs of the US House and Senate servers with the message we don't want SOPA or E-Parasite!
.Description
Runs an while(1) loop that grabs a couple URI's from each branch's website and sleeps for 1 second between requests.
#>
# twitter tags
#occupyUSSenate
#occupyUSHouse
#sopa
#epa... |
combined_dataset/train/non-malicious/sample_7_12.ps1 | sample_7_12.ps1 | ConvertFrom-StringData @'
id_windowsupdatelogcollect=Collecting Windows Update
id_windowsupdatelogcollectdesc=Collecting \\Windows\\windowsupdate.log
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63... |
combined_dataset/train/non-malicious/sample_16_77.ps1 | sample_16_77.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Microsoft.PowerShell.Utility\Import-LocalizedData -BindingVariable Strings -FileName Strings -ErrorAction Ignore
Microsoft.PowerShell.Management\Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 | ForEach-Object {
. $PSItem.FullName
}
... |
combined_dataset/train/non-malicious/sample_58_19.ps1 | sample_58_19.ps1 | #
# Module manifest for module 'OCI.PSModules.Jms'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jms.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/Start-Job proxy function_1.ps1 | Start-Job proxy function_1.ps1 | <#
Example on how to use Proxy Cmdlets in combination with object events.
For more information see:
http://blog.powershell.no/2011/02/07/powershell-using-proxy-cmdlets-in-combination-with-object-events
For more information about proxy functions, see the following article on the
Microsoft PowerShell Team ... |
combined_dataset/train/non-malicious/2724.ps1 | 2724.ps1 |
& net localgroup administrators | Select-Object -Skip 6 | ? {
$_ -and $_ -notmatch "The command completed successfully"
} | % {
$o = "" | Select-Object Account
$o.Account = $_
$o
} |
combined_dataset/train/non-malicious/2305.ps1 | 2305.ps1 | param($Computername,$Group)
$group = [ADSI]"WinNT://$Computername/$Group"
@($group.Invoke("Members")) |
foreach { $_.GetType().InvokeMember("Name", 'GetProperty', $null, $_, $null) } |
combined_dataset/train/non-malicious/625.ps1 | 625.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://netcologne.dl.sourceforge.net/project/keepass/KeePass%202.x/2.27/KeePass-2.27-Setup.exe"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ForEach-Object{... |
combined_dataset/train/non-malicious/ConvertFrom-Property 3.7.ps1 | ConvertFrom-Property 3.7.ps1 | <#
.SYNOPSIS
Converts data from flat or single-level property files into PSObjects
.DESCRIPTION
Converts delimited string data such as .ini files, or the format-list output of PowerShell, into objects
.EXAMPLE
netsh http show sslcert | join-string "`n" |
ConvertFrom-PropertyString -ValueSeparator " ... |
combined_dataset/train/non-malicious/2835.ps1 | 2835.ps1 |
function Get-DefaultBuildFile {
param(
[boolean] $UseDefaultIfNoneExist = $true
)
if (test-path $psake.config_default.buildFileName -pathType Leaf) {
Write-Output $psake.config_default.buildFileName
} elseif (test-path $psake.config_default.legacyBuildFileName -pathType Leaf) {
... |
combined_dataset/train/non-malicious/ScriptTransforms module.ps1 | ScriptTransforms module.ps1 | function new-parameterTransform
{
[cmdletbinding()]
param(
[Parameter(Mandatory=$true,Position=0)]
[string] $name,
[Parameter(Mandatory=$true, Position=1)]
[scriptblock] $script
)
add-Type -TypeDefinition @"
using System;
using System.ComponentModel;
using System.Management.Automation;
... |
combined_dataset/train/non-malicious/chkhash_4.ps1 | chkhash_4.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... |
combined_dataset/train/non-malicious/3204.ps1 | 3204.ps1 | function Export-PSCredential {
[cmdletbinding()]
param (
[parameter(Mandatory=$true)]
[pscredential]$Credential = (Get-Credential),
[parameter()]
[Alias("FullName")]
[validatescript({
Test-Path -Path (Split-Path -Path $_ -Parent)
})]
... |
combined_dataset/train/non-malicious/sample_2_3.ps1 | sample_2_3.ps1 | #************************************************
# DC_Ex_ExBPAcmd.ps1
# Version 1.0.0
# Date: 04-27-2012
# Author: Brian Prince - brianpr@microsoft.com
# Description: This script runs ExBPAcmd.exe to generate health check for Organization, Administrative Group and local Exchange 2007 or 2010 Server.
#***********... |
combined_dataset/train/non-malicious/3305.ps1 | 3305.ps1 |
function New-PoshBotInstance {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope='Function', Target='*')]
[cmdletbinding(DefaultParameterSetName = 'path')]
param(
[parameter(
Mandatory,
ParameterSetName = 'Path'... |
combined_dataset/train/non-malicious/1864.ps1 | 1864.ps1 |
Describe "History cmdlet test cases" -Tags "CI" {
Context "Simple History Tests" {
BeforeEach {
$setting = [system.management.automation.psinvocationsettings]::New()
$setting.AddToHistory = $true
$ps = [PowerShell]::Create("NewRunspace")
... |
combined_dataset/train/non-malicious/3167.ps1 | 3167.ps1 |
param(
[switch]$Finalize,
[switch]$Test,
[string]$ProjectRoot = $ENV:APPVEYOR_BUILD_FOLDER
)
$Timestamp = Get-date -uformat "%Y%m%d-%H%M%S"
$PSVersion = $PSVersionTable.PSVersion.Major
$TestFile = "TestResults_PS$PSVersion`_$TimeStamp.xml"
$Address = "https://ci.appveyor.com/api/test... |
combined_dataset/train/non-malicious/3807.ps1 | 3807.ps1 |
function Test-ExportLogAnalyticThrottledRequestsNegative
{
$loc = Get-ComputeOperationLocation;
$from = Get-Date -Year 2018 -Month 2 -Day 27 -Hour 9;
$to = Get-Date -Year 2018 -Month 2 -Day 28 -Hour 9;
$sasuri = 'https://fakestore.blob.core.windows.net/mylogs/fakesas';
Assert-ThrowsCo... |
combined_dataset/train/non-malicious/sample_4_80.ps1 | sample_4_80.ps1 | Function RunBCDEdit ($BCDEditCommand, [switch]$CollectFile) {
$OutputFile = $ComputerName + "_BCDEdit.TXT"
$CommandLineToExecute = "cmd.exe /c $BCDEditCommand >> $OutputFile"
#header
$date=Get-Date
"-" * ($CommandLineToExecute.Length + 35) + "`r`n[$date] $BCDEditCommand`r`n" + "-" * ($BCDEditCommand.Leng... |
combined_dataset/train/non-malicious/Select-Random.ps1 | Select-Random.ps1 | param([array]$Collection)
begin {
$result = $Seed
if ($args -eq '-?') {
''
'Usage: Select-Random [[-Collection] <array>]'
''
'Parameters:'
' -Collection : The collection from which to select a random entry.'
' -? : Display this usa... |
combined_dataset/train/non-malicious/Added_Deleted AD Objects_1.ps1 | Added_Deleted AD Objects_1.ps1 | #REQUIRES -pssnapin quest.activeroles.admanagement
#REQUIRES -pssnapin Pscx
begin {
# Build variables
$strSMTPServer = "192.168.xx.xx";
$strEmailFrom = "AD_Admin@yourdomain.com";
$strEmailTo = "admin@yourdomain.com";
$borders = "=" * 25;
[int]$days = -60
function TombStonedObjects {
# create Directory ... |
combined_dataset/train/non-malicious/Find-DuplicateSMTP_1.ps1 | Find-DuplicateSMTP_1.ps1 | #######################################################################
#### Written By: Kevin Dunn ####
#### Date: 1/21/2009 ####
#### ####
#### FindDu... |
combined_dataset/train/non-malicious/sample_53_48.ps1 | sample_53_48.ps1 | <#
.SYNOPSIS Launch Developer PowerShell
.DESCRIPTION
Locates and imports a Developer PowerShell module and calls the Enter-VsDevShell cmdlet. The Developer PowerShell module
is located in one of several ways:
1) From a path in a Visual Studio installation
2) From the latest installation of Visual Studio (hig... |
combined_dataset/train/non-malicious/sample_65_8.ps1 | sample_65_8.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/Invoke-MoveRequest_1.ps1 | Invoke-MoveRequest_1.ps1 | ###########################################################################
#
# NAME: Invoke-MoveRequest.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jer@powershell.no
#
# COMMENT: Script to use when migrating mailboxes to Microsoft Exchange Server 2010 Cross-Forest. Prepares user objects already
# moved to... |
combined_dataset/train/non-malicious/sample_34_16.ps1 | sample_34_16.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_63_52.ps1 | sample_63_52.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/PS2WCF_1.ps1 | PS2WCF_1.ps1 | # Call WCF Services With PowerShell V1.0 22.12.2008
#
# by Christian Glessner
# Blog: http://www.iLoveSharePoint.com
# Twitter: http://twitter.com/cglessner
# Codeplex: http://codeplex.com/iLoveSharePoint
#
# requires .NET 3.5
# load WCF assemblies
[void][System.Reflection.Assembly]::LoadWithPartialName("Sy... |
combined_dataset/train/non-malicious/953.ps1 | 953.ps1 |
$uniqueId=$(-join ((97..122) + (48..57) | Get-Random -Count 15 | % {[char]$_}))
$apiVersion = "2015-04-08"
$location = "West US 2"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount-$uniqueId"
$resourceType = "Microsoft.DocumentDb/databaseAccounts"
$locations = @(
@{ "locationName"="Wes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.