full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/209.ps1 | 209.ps1 | Function Add-SCCMUserDeviceAffinity
{
[CmdletBinding()]
Param (
[Parameter(Mandatory = $True, HelpMessage = "Please Enter Site Server Site code")]
$SiteCode,
[Parameter(Mandatory = $True, HelpMessage = "Please Enter Site Server Name")]
$SiteServer,
[Parameter(Mandatory... |
combined_dataset/train/non-malicious/sample_62_8.ps1 | sample_62_8.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmcontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmcontrolplane.dll'
# Version number of this module.
ModuleVersion = '89.0.0'
# Supported P... |
combined_dataset/train/non-malicious/Watch-Process_1.ps1 | Watch-Process_1.ps1 | Function Watch-Process {
<#
.DESCRIPTION
Creates an event handler for monitoring either process creation or deletion. This requires to be run as administrator.
.SYNOPSIS
Watches for process creation or deletion.
.PARAMETER computerName
Name of the remote computer. Make sure you have privileges to acces... |
combined_dataset/train/non-malicious/sample_34_40.ps1 | sample_34_40.ps1 | #
# Module manifest for module 'OCI.PSModules.Common'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Common.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/Restart-IISAppPool_1.ps1 | Restart-IISAppPool_1.ps1 | function Restart-IISAppPool {
[CmdletBinding(SupportsShouldProcess=$true)]
#.Synopsis
# Restarts an IIS AppPool
#.Parameter ComputerName
# The name of an IIS web server where the AppPool resides
#.Parameter AppPool
# The name of the AppPool to recycle (if you include wildcards, results in... |
combined_dataset/train/non-malicious/NPS Server Synchronize_2.ps1 | NPS Server Synchronize_2.ps1 | ###Network Policy Server Synchronization Script
#This script copies the configuration from the NPS Master Server and imports it on this server.
#The Account that this script runs under must have Local Administrator rights to the NPS Master.
#This was designed to be run as a scheduled task on the NPS Secondary Server... |
combined_dataset/train/non-malicious/Invoke-MoveRequest_2.ps1 | Invoke-MoveRequest_2.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_26_60.ps1 | sample_26_60.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 = '79.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/Get-LocalGroupMembers.ps1 | Get-LocalGroupMembers.ps1 | function Get-LocalGroupMembers {
param($groupname)
$pattern = "*Name=`"$groupname`""
$groupusers = gwmi Win32_GroupUser | Where { $_.GroupComponent -like $pattern }
# Now extract the usernames.
foreach ($user in $groupusers) {
if ($user.PartComponent -match 'Name="([^"]+)') {
Write-Output $matches[... |
combined_dataset/train/non-malicious/1404.ps1 | 1404.ps1 |
function Grant-CServicePermission
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[Parameter(Mandatory=$true)]
[string]
$Identity,
[Parameter(Mandatory=$true,ParameterSetName='FullControl')]... |
combined_dataset/train/non-malicious/sample_61_57.ps1 | sample_61_57.ps1 | #
# Module manifest for module 'OCI.PSModules.Accessgovernancecp'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Accessgovernancecp.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Suppo... |
combined_dataset/train/non-malicious/Security group monitor.ps1 | Security group monitor.ps1 | #Get group membership for a list of security
#groups and export to an XML for comparison
#against baseline.
#
$script:WorkingDirectory = split-path $myinvocation.Mycommand.Definition -parent
Function Re-Baseline
{
#First, declare array and hashtable.
$securitygroups = @()
$table = @{}
#Import Security... |
combined_dataset/train/non-malicious/sample_50_68.ps1 | sample_50_68.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcemanager.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_38_63.ps1 | sample_38_63.ps1 | #
# Module manifest for module 'PowerShellProTools'
#
# Generated by: Ironman Software, LLC
#
# Generated on: 3/19/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'PowerShellProTools.psm1'
# Version number of this module.
ModuleVersion = '2024.3.0'
# Suppo... |
combined_dataset/train/non-malicious/Get-PendingUpdates.ps1 | Get-PendingUpdates.ps1 | Function Get-PendingUpdates {
<#
.SYNOPSIS
Retrieves the updates waiting to be installed from WSUS
.DESCRIPTION
Retrieves the updates waiting to be installed from WSUS
.PARAMETER Computer
Computer or computers to find updates for.
.EXAMPLE
Get-PendingUpdates
... |
combined_dataset/train/non-malicious/2300.ps1 | 2300.ps1 |
$Csv = Import-Csv "C:\Dropbox\Powershell\scripts\PrinterModelAndIPs.csv"
$server_printers = Get-WMIObject -Class "Win32_Printer" -NameSpace "root\cimv2" -computername ctxps
foreach ($row in $Csv) {
$model = $row.Model;
$ip = $row.IP;
$printer = $server_printers | ? {$_.comment -eq $ip }
if ($printer)... |
combined_dataset/train/non-malicious/1010.ps1 | 1010.ps1 |
$random = (New-Guid).ToString().Substring(0,8)
$subscriptionId = "my-azure-subscription-id"
$apimServiceName = "apim-$random"
$resourceGroupName = "apim-rg-$random"
$location = "Japan East"
$organisation = "Contoso"
$adminEmail = "admin@contoso.com"
$userEmail = "user@contoso.com"
$userFirstName = "userFirstN... |
combined_dataset/train/non-malicious/637.ps1 | 637.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://heanet.dl.sourceforge.net/project/greenshot/Greenshot/Greenshot%201.1/Greenshot-INSTALLER-1.1.7.17.exe"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ... |
combined_dataset/train/non-malicious/sample_56_48.ps1 | sample_56_48.ps1 | . "$PSScriptRoot\..\project\api.ps1"
. "$PSScriptRoot\helpers.ps1"
function Put-Current-Parametrage-Under-Git-LFS {
Set-Location (Get-Project-Root)
& git lfs track "Custom/parametrage/current/*.*"
}
function Drop-Referential-Tables-Triggers {
foreach ($tableName in Get-Referencial-Tables) {
... |
combined_dataset/train/non-malicious/Get-Parameter_11.ps1 | Get-Parameter_11.ps1 | function Get-Parameter ( $Cmdlet, [switch]$ShowCommon, [switch]$Full ) {
$command = Get-Command $Cmdlet -ea silentlycontinue
# resolve aliases (an alias can point to another alias)
while ($command.CommandType -eq "Alias") {
$command = Get-Command ($command.definition)
}
if (-not $command) { return }
... |
combined_dataset/train/non-malicious/sample_11_18.ps1 | sample_11_18.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/3773.ps1 | 3773.ps1 |
$subscriptionId ="302110e3-cd4e-4244-9874-07c91853c809"
$reservationOrderId = "704aee8c-c906-47c7-bd22-781841fb48b5"
$reservationId = "ac7f6b04-ff45-4da1-83f3-b0f2f6c8128e"
function Test-GetCatalog
{
$catalog = Get-AzReservationCatalog -SubscriptionId $subscriptionId -ReservedResourceType Virtual... |
combined_dataset/train/non-malicious/sample_43_7.ps1 | sample_43_7.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 = '77.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_29_68.ps1 | sample_29_68.ps1 | {
"Vitest Describe": {
"prefix": "videscribe",
"body": [
"describe('${1:name}', () => {",
"\t${0}",
"})"
],
"description": "Vitest Describe"
},
"Vitest Describe - Concurrent": {
"prefix": "videscribe-concurrent",
"body": [
"describe.concurrent('${1:name}', () => {",... |
combined_dataset/train/non-malicious/2832.ps1 | 2832.ps1 | $global:psakeSwitches = @('-docs', '-task', '-properties', '-parameters')
function script:psakeSwitches($filter) {
$psakeSwitches | Where-Object { $_ -like "$filter*" }
}
function script:psakeDocs($filter, $file) {
if ($file -eq $null -or $file -eq '') { $file = 'psakefile.ps1' }
psake $file -docs | out-strin... |
combined_dataset/train/non-malicious/sample_38_9.ps1 | sample_38_9.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/Compare-DatabaseColumns.ps1 | Compare-DatabaseColumns.ps1 | param( [String[]]$Table = $null,
$SqlServerOne = 'YourDatabaseServer',
$FirstDatabase = 'FirstDatabaseToCompare',
$SqlUsernameOne = 'SQL Login',
$SqlPasswordOne = 'SQL Password',
$SqlServerTwo = 'YourDatabaseServer',
$SecondDatabase = 'SecondDatabaseToCompare',
... |
combined_dataset/train/non-malicious/Get-Parameter 2.5.ps1 | Get-Parameter 2.5.ps1 | #Requires -version 2.0
#.Synopsis
# Enumerates the parameters of one or more commands
#.Notes
# With many thanks to Hal Rottenberg, Oisin Grehan and Shay Levy
# Version 0.80 - April 2008 - By Hal Rottenberg http://poshcode.org/186
# Version 0.81 - May 2008 - By Hal Rottenberg http://poshcode.org/255
# Ver... |
combined_dataset/train/non-malicious/sample_51_56.ps1 | sample_51_56.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... |
combined_dataset/train/non-malicious/sample_15_91.ps1 | sample_15_91.ps1 | # ---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------------------------... |
combined_dataset/train/non-malicious/Import-GalPhoto.ps1 | Import-GalPhoto.ps1 | <#
.Synopsis
Import Exchange 2010 Gal photo for one or more users.
.DESCRIPTION
This function invokes the Import-RecipientDataProperty cmdldet to import a picture into the thumbnailPhoto attribute of an Exchange mailbox.
It assumes you have a directory containing all images to import, with the file names... |
combined_dataset/train/non-malicious/2598.ps1 | 2598.ps1 | param(
$Subscribers = @('PSQLSMC30', 'PSQLCBS30', 'STGSQL610', 'ISQLDEV610', 'QSQL610'
'PSQLDLS30', 'PSQLDLS31', 'PSQLDLS32', 'PSQLDLS33', 'PSQLDLS34', 'PSQLDLS35', 'PSQLSVC21')
)
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServr.Rmo")
$DBQuery = "DECLARE @Subs table (
publisher sysnam... |
combined_dataset/train/non-malicious/sample_53_75.ps1 | sample_53_75.ps1 | // @ES5 => ./es5.ohm
ES6 <: ES5 {
AssignmentExpression<guardIn> += ArrowFunction<guardIn>
ArrowFunction<guardIn> = ArrowParameters<guardIn> #(spacesNoNL "=>") ConciseBody<guardIn>
ConciseBody<guardIn> = ~"{" AssignmentExpression<guardIn> -- noBraces
| "{" FunctionBody "}" ... |
combined_dataset/train/non-malicious/sample_65_73.ps1 | sample_65_73.ps1 | #
# Module manifest for module 'OCI.PSModules.Ailanguage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ailanguage.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/4270.ps1 | 4270.ps1 |
function Brute-Ad
{
[cmdletbinding()]
Param
(
[string[]]$list,
$domain
)
Write-Output ""
Write-Output "[+] Brute-ad module started"
Write-Output ""
if ($list)
{
$allpasswords = $list
Write-Output 'The provided list will be used: '$allpasswords`n
}
else
{
... |
combined_dataset/train/non-malicious/sample_61_10.ps1 | sample_61_10.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
function Unpublish-ServiceFab... |
combined_dataset/train/non-malicious/sample_16_48.ps1 | sample_16_48.ps1 | <#
.SYNOPSIS
Creates and throws an invalid argument exception.
.PARAMETER Message
The message explaining why this error is being thrown.
.PARAMETER ArgumentName
The name of the invalid argument that is causing this error to be thrown.
#>
function New-InvalidArgumentExcept... |
combined_dataset/train/non-malicious/3218.ps1 | 3218.ps1 |
describe 'New-PoshBotCardResponse' {
BeforeAll {
$imgUrl = 'https://github.com/poshbotio/PoshBot/raw/master/Media/poshbot_logo_300_432.png'
$linkUrl = 'https://github.com/poshbotio/PoshBot'
}
it 'Returns a [PoshBot.Card.Response] object' {
$resp = New-PoshBotCardResponse -Text 'ab... |
combined_dataset/train/non-malicious/sample_26_35.ps1 | sample_26_35.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/606.ps1 | 606.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://download.deluge-torrent.org/windows/deluge-1.3.7-win32-setup.exe"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ForEach-Object{
try{
$_.... |
combined_dataset/train/non-malicious/ShowUI Weather Widget_1.ps1 | ShowUI Weather Widget_1.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.5,... |
combined_dataset/train/non-malicious/1471.ps1 | 1471.ps1 |
function Set-ModuleVersion
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$ManifestPath,
[string]
$SolutionPath,
[string]
$AssemblyInfoPath,
[string]
$ReleaseNotesPath,
... |
combined_dataset/train/non-malicious/Migrate UserFolder.ps1 | Migrate UserFolder.ps1 | param(
$RootFolder = "\\\\domain.local\\users",
$NewRootFolder = "\\\\domain.local\\users2",
$LogFolder = "c:\\Projects\\HomeDirs",
$NewSubFolders = @("Documents","Favorites","Desktop","Links","Contacts","BlaBla"),
[switch]$SetACL
)
$UserFolders = gci -Path $RootFolder | ?{$_.PSIsContainer}
$UserFolders | forea... |
combined_dataset/train/non-malicious/Speech Recognition_1.ps1 | Speech Recognition_1.ps1 | $null = [Reflection.Assembly]::LoadWithPartialName("System.Speech")
## Create the two main objects we need for speech recognition and synthesis
if(!$Global:SpeechModuleListener){ ## For XP's sake, don't create them twice...
$Global:SpeechModuleSpeaker = new-object System.Speech.Synthesis.SpeechSynthesizer
... |
combined_dataset/train/non-malicious/84835da8-9f4e-46f7-84f6-64197c8d0f7b.ps1 | 84835da8-9f4e-46f7-84f6-64197c8d0f7b.ps1 | Hi,
I've tried your excellent -Append feature for export-csv and it works good. I've only have a short question.
Is it possible to make the append to new columns instead of rows? I'd like to combine two csv files as a part of an automation script and then I must get this to work.
Import-csv C:\\Visiolizer\... |
combined_dataset/train/non-malicious/Get-User_8.ps1 | Get-User_8.ps1 | $script:dse = 'LDAP://my.domain.com'
function script:User-Exists([string]$username)
{
$username = $($username).Trim()
$srch = New-Object DirectoryServices.DirectorySearcher $global:dse
$srch.Filter = "(&(objectClass=user)(sAMAccountName=$username))"
$srch.PageSize = 10000
$srch.SearchScope = "Subtree... |
combined_dataset/train/non-malicious/3818.ps1 | 3818.ps1 |
function Test-VirtualMachineScaleSetDiskEncryptionExtension
{
[string]$loc = Get-ComputeVMLocation;
$loc = $loc.Replace(' ', '');
$rgname = 'adetstrg';
$vmssName = 'vmssadetst';
$keyVaultResourceId = '/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/resourceGroups/suredd-rg/pr... |
combined_dataset/train/non-malicious/Test-64BitOS.ps1 | Test-64BitOS.ps1 | Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public static class Win32Api
{
[DllImport("Kernel32.dll", EntryPoint = "IsWow64Process")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool IsWow64Process(
[In] IntPtr hProcess,
[Out, M... |
combined_dataset/train/non-malicious/AD-GroupMembers_v1.ps1 | AD-GroupMembers_v1.ps1 | function AD-GroupMembers() {
param (
$Domen,
$Group,
$User
)
if ($User){$Connection = Get-Credential -Credential $user}
if($Connection){$Member = Get-QADGroupMember -Service $Domen -Identity $Group -Credential $Connection -SizeLimit 0 -ErrorAction SilentlyContinue | Sort Name | Format-Table Name,NTAccountName,Si... |
combined_dataset/train/non-malicious/sample_30_29.ps1 | sample_30_29.ps1 | #
# Module manifest for module 'OCI.PSModules.Objectstorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Objectstorage.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/PowerSmug - Sync Smugmug.ps1 | PowerSmug - Sync Smugmug.ps1 | # PowerSmug photo sync script v1.0
# This PowerShell script will syncronize a folder of images with a users SmugMug account
# Please set the appropriate variables in the User Defined Variables region
# For more information visit
#
# Images are uploaded to a gallery with the same name as the folder they are contai... |
combined_dataset/train/non-malicious/sample_33_37.ps1 | sample_33_37.ps1 | $ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
$script:GCInstallPath = "$PSScriptRoot\..\..\.."
$script:GCBinariesFolderName = "GC"
$script:GCBinariesPath = Join-Path $script:GCInstallPath $script:GCBinariesFolderName
$script:CleanupExePath = Join-Path $script:GCBinariesPath "em_extension_cleanup... |
combined_dataset/train/non-malicious/4449.ps1 | 4449.ps1 | function Resolve-PackageSource
{
Write-Debug ($LocalizedData.ProviderApiDebugMessage -f ('Resolve-PackageSource'))
Set-ModuleSourcesVariable
$SourceName = $request.PackageSources
if(-not $SourceName)
{
$SourceName = "*"
}
foreach($moduleSourceName in $SourceName)
{
if... |
combined_dataset/train/non-malicious/sample_7_32.ps1 | sample_7_32.ps1 | #************************************************
# TS_SysvolNetLogonShareCheck.ps1
# Version 1.0.1
# Date: 03-29-2011
# Author: Your Name - Your Email Address
# Description: SYSVOL and/or NETLOGON shares are missing on domain controller
#************************************************
Import-LocalizedData -... |
combined_dataset/train/non-malicious/sample_59_10.ps1 | sample_59_10.ps1 | # Helper functions to be used across resources
Function New-DellEventLog{
[CmdletBinding()]
param(
[Parameter (Mandatory=$false)][System.string] $LogName="DellClientBIOS PowerShell",
[Parameter (Mandatory=$false)][System.string] $SourceName="DellBIOSProvider DSC"
)
$Cust... |
combined_dataset/train/non-malicious/Parse HTML Tables.ps1 | Parse HTML Tables.ps1 | # Parse tables within HTML files and return the rows as PowerShell objects.
# The idea here is similar to (though not nearly as complete as) Perl's HTML::TableParse.
# This function should run anywhere but it's a bit slow because of the COM interface
# it uses. There seem to be a few .NET libraries out there that wo... |
combined_dataset/train/non-malicious/Get-EwsEmail.ps1 | Get-EwsEmail.ps1 | $ewsPath = "C:\\Program Files\\Microsoft\\Exchange\\Web Services\\1.1\\Microsoft.Exchange.WebServices.dll"
Add-Type -Path $ewsPath
$ews = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService -ArgumentList "Exchange2007_SP1"
$cred = (Get-Credential).GetNetworkCredential()
$ews.Credentials = New-Object Sy... |
combined_dataset/train/non-malicious/3145.ps1 | 3145.ps1 |
. 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'
Connect-ExchangeServer -auto
Get-MailBox -Identity USERNAME
|
combined_dataset/train/non-malicious/852.ps1 | 852.ps1 |
$resourceGroup = "containerdeletetestrg"
$location = "eastus"
$storageAccountName = "containerdeletetest"
$prefix = "image"
$storageAccount = Get-AzStorageAccount `
-ResourceGroupName $resourceGroup `
-Name $storageAccountName
$ctx = $storageAccount.Context
Write-Host "All containers"
Get-AzStorageC... |
combined_dataset/train/non-malicious/sample_46_44.ps1 | sample_46_44.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_Ti... |
combined_dataset/train/non-malicious/sample_40_0.ps1 | sample_40_0.ps1 | function Get-CodeCoverage {
Param(
[Parameter(Mandatory = $false)]
$LaunchConfig
)
$ServiceUrl = Get-ServiceUrl -Method 'GetCodeCoverage' -LaunchConfig $LaunchConfig
$Credential = Get-ALTestRunnerCredential -LaunchConfig $LaunchConfig
$CodeCoverageFile = Get-ValueFromALTestR... |
combined_dataset/train/non-malicious/sample_21_5.ps1 | sample_21_5.ps1 | @{
GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Get-WinEvent", "New-WinEvent", "Get-C... |
combined_dataset/train/non-malicious/34.ps1 | 34.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_34.ps1 | sample_63_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/1574.ps1 | 1574.ps1 | function Get-MrLeapYear {
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline=$true)]
[ValidateRange(1582,9999)]
[int[]]$Year = (Get-Date).Year
)
PROCESS {
foreach ($y in $Year) {
if ($y / 400 -is [int]) {
Write-Output "$y is a leap ... |
combined_dataset/train/non-malicious/sample_7_53.ps1 | sample_7_53.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'https://aka... |
combined_dataset/train/non-malicious/sample_56_20.ps1 | sample_56_20.ps1 | """
Module for working with Windows PowerShell DSC (Desired State Configuration)
This module is Alpha
This module applies DSC Configurations in the form of PowerShell scripts or
MOF (Managed Object Format) schema files.
Use the ``psget`` module to manage PowerShell resources.
The idea is to leverage Salt to push DS... |
combined_dataset/train/non-malicious/sample_28_40.ps1 | sample_28_40.ps1 | #
# Module manifest for module 'OCI.PSModules.Common'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Common.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/Get-GroupMembership_3.ps1 | Get-GroupMembership_3.ps1 | ## Get-DistinguishedName -- look up a DN from a user's (login) name
function Get-DistinguishedName {
Param($UserName)
$ads = New-Object System.DirectoryServices.DirectorySearcher([ADSI]'')
$ads.filter = "(&(objectClass=Person)(samAccountName=$UserName))"
$s = $ads.FindOne()
return $s.GetDirectoryEnt... |
combined_dataset/train/non-malicious/sample_55_69.ps1 | sample_55_69.ps1 | <#
.SYNOPSIS
UninstallSyncServiceIIS.ps1 script file
This is a place-holder file only fofr agent patch build purposes
#>
Write-Host "This file functionality is deprecated and is place-holder only"
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# ... |
combined_dataset/train/non-malicious/2351.ps1 | 2351.ps1 |
$sUnionEmployeesFilePath = 'Union Lawson Employees.csv';
$sUapEmployeesFilePath = 'UAPEmployees.csv';
$sOutputFilePath = 'old-non-employee-AD-user-accounts.tsv';
$iDefinedOldDays = 90;
$dDaysAgo = [DateTime]::Now.Subtract([TimeSpan]::FromDays($iDefinedOldDays));
$aUnionContent = Get-Content $sUnionEmployeesFilePat... |
combined_dataset/train/non-malicious/sample_60_37.ps1 | sample_60_37.ps1 | <Configuration>
<!-- ################ VIEW DEFINITIONS ################ -->
<ViewDefinitions>
<View>
<Name>Counter</Name>
<ViewSelectedBy>
<TypeName>Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet</TypeName>
</ViewSelectedBy>
<TableControl>
... |
combined_dataset/train/non-malicious/sample_28_62.ps1 | sample_28_62.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudguard'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudguard.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_32_26.ps1 | sample_32_26.ps1 | @{
# Script module or binary module file associated with this manifest
ModuleToProcess = 'nuget.psm1'
# Version number of this module.
ModuleVersion = '2.0.0.0'
# ID used to uniquely identify this module
GUID = '76e6f9c4-7045-44c0-a557-17fab0835c12'
# Author of this module
Author = 'NuGet Team'
# Com... |
combined_dataset/train/non-malicious/753.ps1 | 753.ps1 |
[CmdletBinding(DefaultParameterSetName='Increment')]
param(
[Parameter(ParameterSetName='Increment')]
[ValidateSet('Major', 'Minor', 'Patch', 'Preview')]
[string]
$IncrementLevel = 'Preview',
[Parameter(Mandatory, ParameterSetName='SetVersion')]
[semver]
$NewVersion,
[Parameter(Ma... |
combined_dataset/train/non-malicious/sample_49_28.ps1 | sample_49_28.ps1 | #########################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Localized PSGet.Resource.psd1
#
#########################################################################################
ConvertFrom-StringData @'
###PSL... |
combined_dataset/train/non-malicious/3666.ps1 | 3666.ps1 |
function Test-DatabaseDataMaskingPrivilegedUsersChanges
{
$testSuffix = getAssetName
Create-DataMaskingTestEnvironment $testSuffix
$params = Get-SqlDataMaskingTestEnvironmentParameters $testSuffix
try
{
$policy = Get-AzSqlDatabaseDataMaskingPolicy -ResourceGroupName $params.rgname -ServerNa... |
combined_dataset/train/non-malicious/sample_39_21.ps1 | sample_39_21.ps1 |
function GetRestoreType {
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.DoNotExportAttribute()]
param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.RestoreRequestType]
$RestoreType
)
process {
$type =... |
combined_dataset/train/non-malicious/sample_25_12.ps1 | sample_25_12.ps1 | #
# Module manifest for module 'OCI.PSModules.Capacitymanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Capacitymanagement.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Suppo... |
combined_dataset/train/non-malicious/Get-EnumValues.ps1 | Get-EnumValues.ps1 | function Get-EnumValues ( $EnumType ) {
# Code somewhat stolen from Joel here: http://huddledmasses.org/ideas-for-writing-composable-powershell-scripts/
Begin {
$listItems = @()
}
Process {
if( $_ -is [type] -and $_.IsEnum ) {
$listItems+= [Enum]::GetValues($_)
}
elseif( $_.GetType().IsEnum ) {
... |
combined_dataset/train/non-malicious/test_1.ps1 | test_1.ps1 | [CmdletBinding()]
param()
"This file is in the $PSScriptRoot folder."
# SIG # Begin signature block
# MIIPGwYJKoZIhvcNAQcCoIIPDDCCDwgCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUtq5NTq7Q77yPgrtRePzRWHVn
# THuggg... |
combined_dataset/train/non-malicious/new.ps1 | new.ps1 | $Shell = New-Object -com shell.application
$NetCons = $Shell.Namespace(0x31)
$NetCons.Items() |
where {$_.Name -like 'Local Area Connection*'} |
foreach{$AdapName=$_.Name; get-WmiObject -class Win32_NetworkAdapter |
where-Object {$_.NetConnectionID -eq $AdapName} |
foreach {$MAC=$_.MacAddress}
... |
combined_dataset/train/non-malicious/Prevent-Screensaver_1.ps1 | Prevent-Screensaver_1.ps1 | #########################################################
# Prevent-Screensaver
#########################################################
# This script "presses" a keyboard key every minute
# for specified number of minutes which makes
# Windows "think" you are at your desktop
# so the screensaver does not start ... |
combined_dataset/train/non-malicious/sample_38_97.ps1 | sample_38_97.ps1 | #
# Module manifest for module 'OCI.PSModules.Clusterplacementgroups'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Clusterplacementgroups.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
... |
combined_dataset/train/non-malicious/sample_29_52.ps1 | sample_29_52.ps1 | #
# Module manifest for module 'OCI.PSModules.Licensemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSE... |
combined_dataset/train/non-malicious/3421.ps1 | 3421.ps1 |
function Test-CreatesNewSimpleResource
{
$rgname = Get-ResourceGroupName
$rname = Get-ResourceName
$rglocation = Get-ProviderLocation ResourceManagement
$location = Get-ProviderLocation "Microsoft.Sql/servers"
$apiversion = "2014-04-01"
$resourceType = "Microsoft.Sql/servers"
New-AzureRmResou... |
combined_dataset/train/non-malicious/sample_1_39.ps1 | sample_1_39.ps1 | #************************************************
# DC_NfsServer-Component.ps1
# Version 1.0.06.26.14: Created script.
# Version 1.1.08.13.14: Updated comments. Added data collection for NIS registry value: "HKLM\system\CurrentControlSet\services\NisSvc". TFS264084
# Date: 2014
# Author: Boyd Benson (bbenson@micr... |
combined_dataset/train/non-malicious/sample_1_86.ps1 | sample_1_86.ps1 | #pragma namespace("\\\\.\\Root\\CIMV2\\DCIM")
//*************************************************************
//*** Registers ism Win32 Provider ***
//*************************************************************
instance of __Win32Provider as $dcismprovider
{
Name = "dcismprovider";
ClsId = "{22C... |
combined_dataset/train/non-malicious/sample_67_1.ps1 | sample_67_1.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicemesh'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicemesh.dll'
# Version number of this module.
ModuleVersion = '89.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/731.ps1 | 731.ps1 |
function Set-RsItemDataSource
{
[cmdletbinding()]
param
(
[Alias('ItemPath', 'DataSourcePath', 'Path')]
[Parameter(Mandatory = $True, ValueFromPipeline = $true)]
[string]
$RsItem,
[Parameter(Mandatory = $True)]
$DataSource,
[string]
... |
combined_dataset/train/non-malicious/sample_44_12.ps1 | sample_44_12.ps1 | <#
.SYNOPSIS
NewSelfSignedCertificate.ps1 script file
This is a place-holder file only for agent patch build purposes
#>
Write-Host "This file functionality is deprecated and is place-holder only"
# SIG # Begin signature block
# MIInvgYJKoZIhvcNAQcCoIInrzCCJ6sCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# ... |
combined_dataset/train/non-malicious/sample_42_73.ps1 | sample_42_73.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
#
# Azure File Sync (AFS): repair the corrupted event channels
#
... |
combined_dataset/train/non-malicious/2528.ps1 | 2528.ps1 |
gwmi -query "SELECT SystemName `
,Caption `
,VolumeName `
,Size `
,Freespace `
FROM win32_logicaldisk `
WHERE DriveType=3" -computer (gc E:\Dexma\Servers.txt) `
| Select-Object SystemName `
,Caption `
,VolumeName `
,@{Name="Size(GB)"; Expression={"{0:N2}" -f ($_... |
combined_dataset/train/non-malicious/Get-Packet.ps1 | Get-Packet.ps1 | #
# get-packet.ps1
#
# Receives and displays all incoming IP packets. NIC driver must support promiscuous mode.
#
# Usage: get-packet.ps1 [-LocalIP [<String>]] [-Protocol [<String>]] [[-Seconds] [<Int32>]] [-ResolveHosts] [-Statistics] [-Silent]
#
# Author: Robbie Foust (rfoust@duke.edu)
# Date: Nov 19, 2007
... |
combined_dataset/train/non-malicious/1263.ps1 | 1263.ps1 |
function Test-CFirewallStatefulFtp
{
[CmdletBinding()]
param()
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
if( -not (Assert-CFirewallConfigurable) )
{
return
}
$output = netsh advfirewall show g... |
combined_dataset/train/non-malicious/Download-FreeReflector.p.ps1 | Download-FreeReflector.p.ps1 | #Thanks http://27.am/posts/how-to-download-net-reflector-6-for-free
add-type @'
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Reflection;
namespace LookingGlass
{
젨젨public class RedGateDownloader
젨젨젨젨public static void Download()
젨젨젨젨{
젨젨젨젨젨젨QueryDownloadUrl("... |
combined_dataset/train/non-malicious/2769.ps1 | 2769.ps1 |
Get-ItemProperty -Path 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\*' | Where-Object { $_.Debugger }
Get-ItemProperty -Path 'HKLM:SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\*' | Where-Object { $_.Debugger } |
combined_dataset/train/non-malicious/sample_27_24.ps1 | sample_27_24.ps1 | # <copyright>
# INTEL CONFIDENTIAL
#
# Copyright 2022 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you ("License").
# Unless the License provides otherwise, you may not us... |
combined_dataset/train/non-malicious/238.ps1 | 238.ps1 | function Get-SCSMWorkItemRequestOffering
{
PARAM (
[Parameter(ValueFromPipeline)]
$SMObject
)
BEGIN { Import-Module -Name SMLets -ErrorAction Stop }
PROCESS
{
foreach ($Item in $SMObject)
{
(Get-SCSMRelationshipObject -BySource $Item | Where-Object { $_.RelationshipID -eq "2730587f-3d88-a4e4-42d8-08cf... |
combined_dataset/train/non-malicious/137.ps1 | 137.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.