full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/3691.ps1
3691.ps1
function Test-ShareCrud { $resourceGroup = getAssetName try { $AccountName = getAssetName $ShareName = getAssetName $description = "Test Share" $terms = "Test terms" $shareKind = "CopyBased" $createdShare = New-AzDataShare -AccountName $AccountName -ResourceGroupName $resourceGroup -Name $Share...
combined_dataset/train/non-malicious/sample_52_89.ps1
sample_52_89.ps1
# # Module manifest for module 'OCI.PSModules.Analytics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Analytics.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_26_33.ps1
sample_26_33.ps1
# # Module manifest for module 'OCI.PSModules.Ocvp' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ocvp.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/Get Twitter RSS Feed.ps1
Get Twitter RSS Feed.ps1
param ([String] $ScreenName) $client = New-Object System.Net.WebClient $idUrl = "https://api.twitter.com/1/users/show.json?screen_name=$ScreenName" $data = $client.DownloadString($idUrl) $start = 0 $findStr = '"id":' do { $start = $data.IndexOf($findStr, $start + 1) if ($start -gt 0) { $s...
combined_dataset/train/non-malicious/New-Zip_2.ps1
New-Zip_2.ps1
Function New-Zip { <# .SYNOPSIS Create a Zip File from any files piped in. .DESCRIPTION Requires that you have the SharpZipLib installed, which is available from http://www.icsharpcode.net/OpenSource/SharpZipLib/ .NOTES File Name : PowerZip.psm1 Author : Christophe CREMON (uxone) - http://powershel...
combined_dataset/train/non-malicious/1341.ps1
1341.ps1
function Disable-CIisSecurityAuthentication { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $SiteName, [Alias('Path')] [string] $VirtualPath = '', [Parameter(Mandatory=$true,Para...
combined_dataset/train/non-malicious/sample_33_33.ps1
sample_33_33.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Set-AMTAlarmClock { <# .Synopsis Sets a Intel Active Management Technology alarm clock timer .Description This CmdLet allows the user to set a wake timer on clients that have Intel Active Management Technology (AMT) firmwa...
combined_dataset/train/non-malicious/sample_67_93.ps1
sample_67_93.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 = '86.2.0' # Supported P...
combined_dataset/train/non-malicious/sample_40_87.ps1
sample_40_87.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Start-AMTIDER { <# .Synopsis Starts an Intel Active Management Technology IDE redirection session .Description This CmdLet starts an Intel Active Management Technology(AMT) IDE redirection(IDER) session to clients that hav...
combined_dataset/train/non-malicious/sample_6_21.ps1
sample_6_21.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .Synopsis Registers or unregisters the PowerShell ETW manifest .Parameter Path The fully qualified path to the PowerShell.Core.Instrumentation.man manifest file. The default value is the location of this script. .Paramet...
combined_dataset/train/non-malicious/sample_32_61.ps1
sample_32_61.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/3681.ps1
3681.ps1
function Test-TriggerCrud { $ResourceGroupName = getAssetName try{ $AccountName = getAssetName $SubName = getAssetName $TriggerName = getAssetName $RecurrenceInterval = "hour" $SynchronizationTime = "06/19/2019 22:53:33" $newTrigger = New-AzDataShareTrigger -ResourceGroupName $Resourc...
combined_dataset/train/non-malicious/sample_54_3.ps1
sample_54_3.ps1
# # Module manifest for module 'OCI.PSModules.Monitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Monitoring.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_31_14.ps1
sample_31_14.ps1
# # Module manifest for module 'OCI.PSModules.Recovery' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Recovery.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_54_60.ps1
sample_54_60.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.1.0' ...
combined_dataset/train/non-malicious/sample_31_46.ps1
sample_31_46.ps1
ConvertFrom-StringData @' IPAddressDisplayNameFormat=IP Address: {0} NetworkNameDisplayNameFormat=Name: {0} NetworkNameOfflineDisplayNameFormat=IP Address: Address on "{0}" CreateClusterProgressValidationStart=Validating servers suitability for a failover cluster. CreateClusterProgressValidationEnd=Done validating...
combined_dataset/train/non-malicious/sample_41_87.ps1
sample_41_87.ps1
# # Module manifest for module 'OCI.PSModules.Waf' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waf.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/Set-Domain.ps1
Set-Domain.ps1
function Set-Domain { param( [switch]$help, [string]$domain=$(read-host "Please specify the domain to join"), [System.Management.Automation.PSCredential]$credential = $(Get-Credential) ) $usage = "`$cred = get-credential `n" $usage += "Set-AvaDomain -domain corp.avanade.org -credential `$cred`n"...
combined_dataset/train/non-malicious/sample_40_36.ps1
sample_40_36.ps1
# -------------------------------------------------------------- # Copyright � Microsoft Corporation. All Rights Reserved. # Microsoft Corporation (or based on where you live, one of its affiliates) licenses this sample code for your internal testing purposes only. # Microsoft provides the following sample code ...
combined_dataset/train/non-malicious/Get-SiSReport_1.ps1
Get-SiSReport_1.ps1
Function Get-SiSReport { <# .SYNOPSIS Get the overall SIS usage information. .DESCRIPTION This function uses the sisadmin command to get the usage information for a SIS enabled drive. .PARAMETER SisDisk The drive letter of a disk that ...
combined_dataset/train/non-malicious/sample_13_29.ps1
sample_13_29.ps1
ConvertFrom-StringData @' id_proliantdl385nmicrashdump_sd=NMICrashDump is set to 1 on this HP ProLiant DL385 G5. This setting may block machine dumps via NMI to be generated. '@ # SIG # Begin signature block # MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEe...
combined_dataset/train/non-malicious/1952.ps1
1952.ps1
Describe "Trace-Command" -tags "Feature" { Context "Listener options" { BeforeAll { $logFile = setup -f traceCommandLog.txt -pass $actualLogFile = setup -f actualTraceCommandLog.txt -pass } AfterEach { if ( test-path $logfile ) { Remove-Item $logFile }...
combined_dataset/train/non-malicious/sample_57_9.ps1
sample_57_9.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> if (Test-Path "$PSScriptRoot\bin") { # Loa...
combined_dataset/train/non-malicious/Set-Wallpaper (CTP3)_1.ps1
Set-Wallpaper (CTP3)_1.ps1
#requires -version 2.0 ## Set-Wallpaper - set your windows desktop wallpaper ################################################################################################### ## Usage: ## Set-Wallpaper "C:\\Users\\Joel\\Pictures\\Wallpaper\\Dual Monitor\\mandolux-tiger.jpg" "Tile" ## ls *.jpg | get-random ...
combined_dataset/train/non-malicious/406.ps1
406.ps1
$license = New-PSFLicense -Product 'PSFramework' -Manufacturer 'Friedrich Weinmann' -ProductVersion $ModuleVersion -ProductType Module -Name MIT -Version "1.0.0.0" -Date (Get-Date -Year 2017 -Month 04 -Day 27 -Hour 0 -Minute 0 -Second 0) -Text @" Copyright (c) Friedrich Weinmann Permission is hereby granted, free of c...
combined_dataset/train/non-malicious/896.ps1
896.ps1
$Random=(New-Guid).ToString().Substring(0,8) $ResourceGroupName="myResourceGroup$Random" $AppName="AppServiceMonitor$Random" $Location="WestUS" New-AzResourceGroup -Name $ResourceGroupName -Location $Location New-AzAppservicePlan -Name AppServiceMonitorPlan -ResourceGroupName $ResourceGroupName -Location $Locat...
combined_dataset/train/non-malicious/sample_9_99.ps1
sample_9_99.ps1
#************************************************ # TS_DetectLowPathMTU.ps1 # Version 1.0 # Date: 02/06/2014 # Author: BBenson # Description: # Rule number: 262755 # Rule ID: d2aaab92-c906-4b3e-a4e5-67244c49c422 # Rule URL: https://kse.microsoft.com/Contribute/Idea/de6654f5-8b05-4f97-b67b-f9ad51bc78ab # P...
combined_dataset/train/non-malicious/1424.ps1
1424.ps1
function Enable-CNtfsCompression { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [Alias('FullName')] [string[]]$Path, [Switch]$Recurse, [Swi...
combined_dataset/train/non-malicious/sample_36_7.ps1
sample_36_7.ps1
# Localized 06/28/2023 07:56 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1 ConvertFrom-StringData @' ###PSLOC Troubleshoot_Title=Αντιμετώπιση προβλημάτων Troubleshoot_DetectNetworkCache=Έλεγχος της cache δικτύου του Windows Media Player... Resolution_Title=Ανάλυση Resolution_ResetConfiguration=Επαναφορά όλων τ...
combined_dataset/train/non-malicious/sample_58_53.ps1
sample_58_53.ps1
# # Module manifest for module 'OCI.PSModules.Operatoraccesscontrol' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Operatoraccesscontrol.dll' # Version number of this module. ModuleVersion = '84.0.0' #...
combined_dataset/train/non-malicious/Split.ps1
Split.ps1
function Split { <# .Synopsis Splits up a file into smaller files. .Description This function takes a file as input and splits it into files by a set number of lines. .Parameter filename The name of the file to be used as an input. This value can be piped to the function (see examples) .Parameter lines The n...
combined_dataset/train/non-malicious/Highlight-Syntax _3.0.ps1
Highlight-Syntax _3.0.ps1
#requires -version 2.0 # Highlight-Syntax.ps1 # version 2.0 # by Jeff Hillman # # this script uses the System.Management.Automation.PsParser class # to highlight PowerShell syntax with HTML. param( [string] $code, [switch] $LineNumbers ) if ( Test-Path $code -ErrorAction SilentlyContinue ) { $code =...
combined_dataset/train/non-malicious/Add-PrinterDriver.ps1
Add-PrinterDriver.ps1
#requires -version 2 function Add-PrinterDriver { <# .SYNOPSIS Adds printer drivers to the local computer from a specified print server. .DESCRIPTION Adds printer drivers to the local computer from a specified print server. The function collects all shared printer objects from the specified print server and inst...
combined_dataset/train/non-malicious/sample_25_57.ps1
sample_25_57.ps1
# # Module manifest for module 'OCI.PSModules.Containerengine' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Containerengine.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported P...
combined_dataset/train/non-malicious/sample_60_13.ps1
sample_60_13.ps1
# # Module manifest for module 'OCI.PSModules.Psql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Psql.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/Find sharable storage_1.ps1
Find sharable storage_1.ps1
# This function returns all datastores that can be shared amongst ESX hosts. function Get-ShareableDatastore { # Get all datastores. $datastores = Get-Datastore # Load the HostStorageSystems of all hosts. $hosts = Get-VMHost | Get-View -property ConfigManager $storageSystems = @() foreach ($h in $hosts) ...
combined_dataset/train/non-malicious/sample_26_58.ps1
sample_26_58.ps1
<# .SYNOPSIS Deploys a Service Fabric application type to a cluster. .DESCRIPTION This script deploys a Service Fabric application type to a cluster. It is invoked by Visual Studio when deploying a Service Fabric Application project. .NOTES WARNING: This script file is invoked by Visual Studio. Its paramet...
combined_dataset/train/non-malicious/sample_35_71.ps1
sample_35_71.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/sample_61_90.ps1
sample_61_90.ps1
# # Module manifest for module 'OCI.PSModules.Certificates' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Certificates.dll' # Version number of this module. ModuleVersion = '88.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/4239.ps1
4239.ps1
function New-IPv4Range { param( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)] $StartIP, [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=2)] ...
combined_dataset/train/non-malicious/sample_67_94.ps1
sample_67_94.ps1
# # Copyright (c) Microsoft Corporation. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ...
combined_dataset/train/non-malicious/sample_48_44.ps1
sample_48_44.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'...
combined_dataset/train/non-malicious/3988.ps1
3988.ps1
function WaitforStatetoBeSucceded { param([string]$resourceGroupName, [string]$namespaceName, [string]$drConfigName) $createdMigrationConfig = Get-AzServiceBusMigration -ResourceGroup $resourceGroupName -Name $namespaceName while ($createdMigrationConfig.MigrationState -ne "Active" -and $c...
combined_dataset/train/non-malicious/69.ps1
69.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 ($AadModule -eq $...
combined_dataset/train/non-malicious/sample_10_48.ps1
sample_10_48.ps1
ConvertFrom-StringData @' id_templateregkeycheck=Check for Registry Key id_templateregkeycheckdesc=Checking if HKLM\\SOFTWARE\\Microsoft\\Test\\DetectRootCause exists '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwE...
combined_dataset/train/non-malicious/where-in.ps1
where-in.ps1
function where-in { [cmdletbinding()] param ( [parameter(mandatory = $true,position = 1)] [system.Collections.IEnumerable]$collection, [parameter(position = 2)] [scriptblock]$predicate , [parameter(valuefrompipeline = $true)] $pipelineobject ) process { if ($predicate) { foreach ($__...
combined_dataset/train/non-malicious/934.ps1
934.ps1
$apiVersion = "2015-04-08" $resourceGroupName = "myResourceGroup" $accountName = "mycosmosaccount" $tableName = "table1" $tableThroughputResourceName = $accountName + "/table/" + $tableName + "/throughput" $tableThroughputResourceType = "Microsoft.DocumentDb/databaseAccounts/apis/tables/settings" $throughput = 500 $...
combined_dataset/train/non-malicious/Get-MailboxesOverSizeLim.ps1
Get-MailboxesOverSizeLim.ps1
# ------------------------------------------------------------------------------- # Script: Get-MailboxesOverSizeLimit.ps1 # Author: Chris Brown # Date: 04/04/2011 10:41:00 # Keywords: # comments: # # Versioning # 04/04/2011 CJB Initial Script # # ------------------------------------------------------------...
combined_dataset/train/non-malicious/Connect-LabManager.ps1
Connect-LabManager.ps1
function Ignore-SslErrors { # Create a compilation environment $Provider=New-Object Microsoft.CSharp.CSharpCodeProvider $Compiler=$Provider.CreateCompiler() $Params=New-Object System.CodeDom.Compiler.CompilerParameters $Params.GenerateExecutable=$False $Params.GenerateInMemory=$True $Params.IncludeDebugIn...
combined_dataset/train/non-malicious/Edit-File in Notepad++.ps1
Edit-File in Notepad++.ps1
<# .Synopsis Open a file for editing in notepad++ .Description Opens one or more files in Notepad++, passing all the switches each time. Accepts filenames on the pipeline .Notes I took the "no" off the parameters, because in PowerShell you only need to enter just enough of the parameter name to differ...
combined_dataset/train/non-malicious/LoadModuleConfig_2.ps1
LoadModuleConfig_2.ps1
################################################################################ ## Script Name: LoadModuleConfig ## Created On: 01/21/2010 ## Author: Thell Fowler ## File: LoadModuleConfig.ps1 ## Usage: Called from the NestedModules value from a module manifest. ## Version:...
combined_dataset/train/non-malicious/sample_31_68.ps1
sample_31_68.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/Move-Template_1.ps1
Move-Template_1.ps1
Function Move-Template{ <# .Synopsis Move a VM template .Description Move a VM template either to a new host via vmotion or to a new datastore via svmotion .Parameter Name Name of the VM to be migrated .Parameter VIObject Template to be migrated .Paramet...
combined_dataset/train/non-malicious/sample_58_21.ps1
sample_58_21.ps1
# diag_sha.psm1 # Created by tdimli # March 2020 # # Diagnostic functions for SHA area # version $SHA_version = "1.0.200425.0" # Area and Area/Component arrays # Example: $AREA = @("Component1", "Component2") $SHA = @() #Component/Diagnostic Function arrays # Example: $Component1 = @("Diag_Func1", "Dia...
combined_dataset/train/non-malicious/Test-TCPPort.ps1
Test-TCPPort.ps1
# http://powershell.codeplex.com Function Test-TCPPort { param ( [ValidateNotNullOrEmpty()] [string] $EndPoint = $(throw "Please specify an EndPoint (Host or IP Address)"), [string] $Port = $(throw "Please specify a Port") ) $TimeOut = 1000 $IP = [System.Net.Dns]::GetHostAddresses($EndPoint) $Address...
combined_dataset/train/non-malicious/Get-DiskUsage_2.ps1
Get-DiskUsage_2.ps1
Function Get-DiskUsage { <# .SYNOPSIS A tribute to the excellent Unix command DU. .DESCRIPTION This command will output the full path and the size of any object and it's subobjects. Using just the Get-DiskUsage command without any parameters will result in an output of the directory you are currently p...
combined_dataset/train/non-malicious/2647.ps1
2647.ps1
Add-Type -AssemblyName System.Web function New-Header{ param([string]$action = "get" ,[string]$resType ,[string]$resourceId ,[string]$connectionKey) $apiDate = (Get-Date).ToUniversalTime().ToString('R') $keyBytes = [System.Convert]::FromBase64String($connectionKey) ...
combined_dataset/train/non-malicious/sample_51_65.ps1
sample_51_65.ps1
## Copyright (c) Microsoft Corporation. All rights reserved. <# .SYNOPSIS This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. .DESCRIPTION This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. These performance recordings contain Microsoft-Antimal...
combined_dataset/train/non-malicious/763.ps1
763.ps1
function New-File { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true, Position=0, ParameterSetName="Path", ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, ...
combined_dataset/train/non-malicious/2078.ps1
2078.ps1
Add-Type -WarningAction Ignore @' public class Base { private int data; protected Base() { data = 10; } protected Base(int i) { data = i; } protected int Field; protected int Property { get; set; } public int Property1 { get; protected set; } public int ...
combined_dataset/train/non-malicious/2493.ps1
2493.ps1
$ips = '192.168.1.5','192.1..4444' $t = $ips | foreach { (New-Object Net.NetworkInformation.Ping).SendPingAsync($_, 250) } [Threading.Tasks.Task]::WaitAll($t) $t.Result
combined_dataset/train/non-malicious/sample_2_58.ps1
sample_2_58.ps1
#************************************************ # TS_DFSRRootCausesCheck.ps1 # Version 1.0.5 # Date: 08-21-2014 # Author: David Fisher # Description: DFSR Root causes troubleshooter #************************************************ Import-LocalizedData -BindingVariable DFSRCheck Write-DiagProgress -Activit...
combined_dataset/train/non-malicious/sample_11_54.ps1
sample_11_54.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/2370.ps1
2370.ps1
[OutputType([void])] [CmdletBinding()] param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$Server, [Parameter(Mandatory)] [ValidateScript({ if (-not (Test-Path -Path $_ -PathType Container)) { throw "The destination folder '$_' could not be found." } else { $true } })] [ValidateNotNu...
combined_dataset/train/non-malicious/3380.ps1
3380.ps1
[CmdletBinding(DefaultParameterSetName="CurrentDirectory")] Param ( [Parameter(ParameterSetName="AzurePowerShell", Mandatory=$true)] [switch]$AzurePowerShell, [Parameter(ParameterSetName="MsiInstall", Mandatory=$true)] [switch]$MsiInstall, [Parameter(ParameterSetName="GalleryInstall", Mandatory=$tr...
combined_dataset/train/non-malicious/sample_50_19.ps1
sample_50_19.ps1
# # Module manifest for module 'OCI.PSModules.Healthchecks' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/3966.ps1
3966.ps1
function Test-LBWithMultiIpConfigNICCRUD { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $lbName = Get-ResourceName $frontendName = Get-ResourceName $backendAddressPoolName = Get-ResourceName $probeName ...
combined_dataset/train/non-malicious/1114.ps1
1114.ps1
$Port = 9879 $SiteName = 'TestEnableIisDirectoryBrowsing' $VDirName = 'VDir' $WebConfig = Join-Path $TestDir web.config function Start-TestFixture { & (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve) Install-IisAppPool -Name $SiteName } function Stop-TestFixture { Unins...
combined_dataset/train/non-malicious/Run-Query (SharePoint).ps1
Run-Query (SharePoint).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/Script-Object_3.ps1
Script-Object_3.ps1
#Copyright (c) 2011 Justin Dearing # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, publish, dist...
combined_dataset/train/non-malicious/4032.ps1
4032.ps1
function Test-ResourceLockCRUD { $rgname = Get-ResourceGroupName $rname = Get-ResourceName $rglocation = Get-Location "Microsoft.Resources" "resourceGroups" "West US" $apiversion = "2014-04-01" $rg = New-AzResourceGroup -Name $rgname -Location $rglocation $actual = New-AzResourceLock -LockName $...
combined_dataset/train/non-malicious/sample_28_19.ps1
sample_28_19.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_29_47.ps1
sample_29_47.ps1
<# .SYNOPSIS Finds the repositories registered with PowerShellGet and registers them for PSResourceGet. #> function Import-PSGetRepository { [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Medium')] param( # Use the -Force switch to overwrite existing repositories. [switch...
combined_dataset/train/non-malicious/Get-InstalledProgram_v_3.ps1
Get-InstalledProgram_v_3.ps1
function Get-InstalledProgram() { param ( [String[]]$Computer, $User ) ############################################################################################# if ($User) {$Connection = Get-Credential -Credential $User} ########################################################################################...
combined_dataset/train/non-malicious/sample_43_18.ps1
sample_43_18.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 = '83.1.0' # S...
combined_dataset/train/non-malicious/Set Active Sync DevideID.ps1
Set Active Sync DevideID.ps1
# Requires a connection to Exchange Server, or Exchange Management Shell $s = New-PSSession -ConfigurationName Microsoft.Exchange -Name ExchMgmt -ConnectionUri http://ex14.domain.local/PowerShell/ -Authentication Kerberos Import-PSSession $s # Get all Client Access Server properties for all mailboxes with an Act...
combined_dataset/train/non-malicious/Ping Alert Script_1.ps1
Ping Alert Script_1.ps1
#Email Alert Parameters $to = "user@mydomain.com" $from = "unreachable@mydomain.com" $smtpserver = "my_exchange_server" #Array of computers to test $Computers = ("comp1" , "comp2" , "comp3" , "comp4") #Variable to hold INT value 0 $zero = 0 Foreach ($Computer in $Computers) { if...
combined_dataset/train/non-malicious/sample_32_84.ps1
sample_32_84.ps1
ConvertFrom-StringData @' FailoverClustersModuleRequired=Le module PowerShell obligatoire (FailoverClusters) est introuvable. Utilisez l'outil Rôles et fonctionnalités pour installer : Outils d'administration de serveur distant | Outils d’administration de fonctionnalités | Outils Clustering de basculement | Module Cl...
combined_dataset/train/non-malicious/3450.ps1
3450.ps1
function Test-LinkedService { $dfname = Get-DataFactoryName $rgname = Get-ResourceGroupName $rglocation = Get-ProviderLocation ResourceManagement $dflocation = Get-ProviderLocation DataFactoryManagement New-AzResourceGroup -Name $rgname -Location $rglocation -Force try ...
combined_dataset/train/non-malicious/2716.ps1
2716.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$True,Position=0)] [String]$File ) function GetBase64GzippedStream { Param( [Parameter(Mandatory=$True,Position=0)] [System.IO.FileInfo]$File ) $memFile = New-Object System.IO.MemoryStream (,[System.IO.File]::ReadAllBytes($File)) ...
combined_dataset/train/non-malicious/sample_6_75.ps1
sample_6_75.ps1
# Localized 06/28/2023 08:09 AM (GMT) 303:7.0.30723 archiveresources.psd1 # Localized ArchiveResources.psd1 ConvertFrom-StringData @' ###PSLOC PathNotFoundError=O caminho '{0}' não existe ou não é um caminho do sistema de arquivos válido. ExpandArchiveInValidDestinationPath=O caminho '{0}' não é um caminho de d...
combined_dataset/train/non-malicious/sample_54_69.ps1
sample_54_69.ps1
# # Module manifest for module 'OCI.PSModules.Desktops' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Desktops.dll' # Version number of this module. ModuleVersion = '83.3.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/Show-Fonts.ps1
Show-Fonts.ps1
ipmo PowerBoots # Require PowerBoots ## More readable: New-BootsWindow { ScrollViewer { StackPanel { ForEach($font in (New-Object Drawing.Text.InstalledFontCollection).Families | Select -Expand Name) { TextBlock "$font -- The brown fox (quickly) jumps over the ""lazy"" dog, 1234...
combined_dataset/train/non-malicious/New-Zip_4.ps1
New-Zip_4.ps1
Function New-Zip { <# .SYNOPSIS Create a Zip File from any files piped in. .DESCRIPTION Requires that you have the SharpZipLib installed, which is available from http://www.icsharpcode.net/OpenSource/SharpZipLib/ .NOTES File Name : PowerZip.psm1 Author : Christophe CREMON (uxone) - http://powershel...
combined_dataset/train/non-malicious/sample_45_2.ps1
sample_45_2.ps1
parameters: # Which publishing infra should be used. THIS SHOULD MATCH THE VERSION ON THE BUILD MANIFEST. # Publishing V1 is no longer supported # Publishing V2 is no longer supported # Publishing V3 is the default - name: publishingInfraVersion displayName: Which version of publishing should be used to p...
combined_dataset/train/non-malicious/sample_39_96.ps1
sample_39_96.ps1
param ( [Parameter(Mandatory = $true)] [string] $VmName, [Parameter(Mandatory = $true)] [string] $VmUsername, [Parameter(Mandatory = $true)] [string] $VmPassword ) # Add Trusted Hosts try { Start-Service winrm -Verbose:$VerbosePreference $currentTrustedHosts = (Get-Item WSM...
combined_dataset/train/non-malicious/444.ps1
444.ps1
Register-PSFConfigValidation -Name "stringarray" -ScriptBlock { Param ( $Value ) $Result = New-Object PSObject -Property @{ Success = $True Value = $null Message = "" } try { $data = @() foreach ($item in $Value) { $data += [string]$item } } catch { $Result.Message = "Not a str...
combined_dataset/train/non-malicious/3788.ps1
3788.ps1
Param( [Parameter(Mandatory = $true, HelpMessage="Name of the resource group to which the VM belongs to")] [ValidateNotNullOrEmpty()] [string]$resourceGroupName, [Parameter(Mandatory = $true, HelpMessage="Name of the VM")] [ValidateNotNullOrEmpty()] [string]$vmName ) $Verbos...
combined_dataset/train/non-malicious/sample_62_37.ps1
sample_62_37.ps1
# # Script Module file for Dism module. # # Copyright (c) Microsoft Corporation # # # Cmdlet aliases # Set-Alias Apply-WindowsUnattend Use-WindowsUnattend Set-Alias Add-ProvisionedAppxPackage Add-AppxProvisionedPackage Set-Alias Remove-ProvisionedAppxPackage Remove-AppxProvisionedPackage Set-Alias Get-Pr...
combined_dataset/train/non-malicious/Wizard template.ps1
Wizard template.ps1
####################################################################################################################### # File: wizard_template.ps1 # # Author: Alexander Petrovskiy ...
combined_dataset/train/non-malicious/PS2WCF_4.ps1
PS2WCF_4.ps1
<# .SYNOPSIS Functions to call WCF Services With PowerShell. .NOTES Version 1.1 10.02.2012 Requires Powershell v2 and .NET 3.5 Original version by Christian Glessner Blog: http://www.iLoveSharePoint.com Twitter: http://twitter.com/cglessner Codeplex: http://codeplex.com/iLoveSharePoint PowerS...
combined_dataset/train/non-malicious/sample_34_17.ps1
sample_34_17.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apach...
combined_dataset/train/non-malicious/4390.ps1
4390.ps1
function Ping-Endpoint { [CmdletBinding()] param ( [Parameter()] [ValidateNotNullOrEmpty()] [string] $Endpoint, [Parameter()] $Credential, [Parameter()] $Proxy, [Parameter()] $ProxyCredential, [Parameter()] [...
combined_dataset/train/non-malicious/2750.ps1
2750.ps1
& $env:windir\system32\tasklist.exe /v /fo csv | Select-Object -Skip 1 | % { $o = "" | Select-Object ImageName,PID,SessionName,SessionNum,MemUsage,Status,UserName,CPUTime,WindowTitle $row = $_ -replace '(,)(?=(?:[^"]|"[^"]*")*$)', "`t" -replace "`"" $o.ImageName, $o.PID, $o.SessionName, $o.Ses...
combined_dataset/train/non-malicious/sample_34_41.ps1
sample_34_41.ps1
# # Module manifest for module 'OCI.PSModules.Networkfirewall' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Networkfirewall.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported P...
combined_dataset/train/non-malicious/sample_66_94.ps1
sample_66_94.ps1
#requires -Version 5.0 enum BcArtifactSource { OnPrem Sandbox Insider } #Import-Module (Join-Path $PSScriptRoot ClientContext\ClientContext.psd1) #Import-Module (Join-Path $PSScriptRoot ClientContext\ClientContext.psm1) #. "$PSScriptRoot\ClientContext\ClientContextLibLoader.ps1" -BcLibVersion (G...
combined_dataset/train/non-malicious/sample_66_48.ps1
sample_66_48.ps1
# Runs OptProf for MSBuild binaries based on an insertion build trigger: none # Prevents this pipeline from triggering on check-ins pr: none # don't run this on PR as well, this should only trigger off on MSBuild runs schedules: - cron: "0 9 * * Wed,Sat" displayName: Weekly OptProf Run branches: includ...
combined_dataset/train/non-malicious/3164.ps1
3164.ps1
if (-not (Get-Module -Name Microsoft.Lync.Model)) { try { Import-Module -Name (Join-Path -Path ${env:ProgramFiles(x86)} -ChildPath "Microsoft Office 2013\LyncSDK\Assemblies\Desktop\Microsoft.Lync.Model.dll") -ErrorAction Stop } catch { Write-Warning "Mi...
combined_dataset/train/non-malicious/678.ps1
678.ps1
Function Get-ExistingDataExtension { $proxy = New-RsWebServiceProxy return $proxy.ListExtensions("Data")[0].Name } Describe "Set-RsDataSource" { $dataSourceName = $null $extension = $null $credentialRetrieval = $null $dataSourcePath = $null BeforeEach { ...
combined_dataset/train/non-malicious/4139.ps1
4139.ps1
[CmdletBinding()] param () Remove-Item -Path ($env:windir + '\temp\ActivityLog.xml') -ErrorAction SilentlyContinue -Force Remove-Item -Path ($env:windir + '\temp\inventory.xml') -ErrorAction SilentlyContinue -Force $ErrCode = (Start-Process -FilePath ((Get-ChildItem -Path $env:ProgramFiles, ${env:ProgramFiles(x86)} ...