full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_38_13.ps1
sample_38_13.ps1
ConvertFrom-StringData @' FailoverClustersModuleRequired=O módulo PowerShell (FailoverClusters) necessário não foi encontrado. Utilize a Ferramenta de Funções e Funcionalidades para instalar: Ferramentas de Administração Remota do Servidor | Ferramentas de Administração de Funcionalidades | Ferramentas de Clustering d...
combined_dataset/train/non-malicious/3863.ps1
3863.ps1
$dll = dir | Where-Object {$_.Name -match "Peering.Test.dll"} | % {$_.FullName}; [Reflection.Assembly]::LoadFile($dll); $ipGenerator = New-Object Microsoft.Azure.Commands.Peering.Test.ScenarioTests.IPGenerator; function TestSetup-CreateResourceGroup { $resourceGroupName = getAssetName "MockRg" Wri...
combined_dataset/train/non-malicious/4026.ps1
4026.ps1
function Test-RoleDefinitionCreateTests { $rdName = 'CustomRole Tests Role' $inputFilePath = Join-Path -Path $TestOutputRoot -ChildPath Resources\NewRoleDefinition.json New-AzRoleDefinitionWithId -InputFile $inputFilePath -RoleDefinitionId ee78fa8a-3cdd-418e-a4d8-949b57a33dcd $rd ...
combined_dataset/train/non-malicious/Convert-CBZ2CBR.ps1
Convert-CBZ2CBR.ps1
########################################################################### # # NAME: Convert-CBZ2CBR.ps1 # # AUTHOR: Neiljmorrow # EMAIL: Neiljmorrow@gmail.com # # NOTE: Written to use command line version of 7zip (http://7zip.com) # from the default install location. Please modify the path below # if necessa...
combined_dataset/train/non-malicious/sample_55_61.ps1
sample_55_61.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_64_69.ps1
sample_64_69.ps1
param([string] $AgentInstallDir) #Get the agent updater module path using intallation directory details $AgentInstallDir=$AgentInstallDir.Trim() $AgentUpdaterModulePath=Join-Path -Path $AgentInstallDir -ChildPath "Kailani.Afs.Updater.Cmdlets.dll" Write-Host "Running the agent updater action from $AgentUpdaterModu...
combined_dataset/train/non-malicious/sample_20_25.ps1
sample_20_25.ps1
-- Automatically generated by SQLQueryTestSuite -- Number of queries: 7 -- !query SELECT percentile_disc(0.0) WITHIN GROUP (ORDER BY a) as p0, percentile_disc(0.1) WITHIN GROUP (ORDER BY a) as p1, percentile_disc(0.2) WITHIN GROUP (ORDER BY a) as p2, percentile_disc(0.3) WITHIN GROUP (ORDER BY a) as p3, per...
combined_dataset/train/non-malicious/536.ps1
536.ps1
function Enable-SPOFeature { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string]$featureId, [Parameter(Mandatory=$true, Position=2)] [bool]$force, [Parameter(Mandatory=$true, Position=3)] [Microsoft.SharePoint.Client.FeatureDefinitionScope]$featureDefinitionScope ...
combined_dataset/train/non-malicious/Search-Registry.ps1
Search-Registry.ps1
##############################################################################\n##\n## Search-Registry\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nSearch t...
combined_dataset/train/non-malicious/sample_67_5.ps1
sample_67_5.ps1
# # Module manifest for module 'Az.StackHCI' # # Generated by: Microsoft Corporation # # Generated on: 7/31/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.StackHCI.psm1' # Version number of this module. ModuleVersion = '2.4.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_28_53.ps1
sample_28_53.ps1
// workaround for https://github.com/microsoft/fast/issues/5675 export function updateProxy(id) { if (!id) { return; } const element = document.getElementById(id); if (element && element.form) { if (element.form.id !== '') { element.proxy.setAttribute("form", elemen...
combined_dataset/train/non-malicious/d9442693-acf2-4df5-8552-91dec539a96f.ps1
d9442693-acf2-4df5-8552-91dec539a96f.ps1
<# .SYNOPSIS Writes out the the words for 99 Bottle of Beer on the wall. .DESCRIPTION Writes out the the words for 99 Bottle of Beer on the wall. .PARAMETER BottlesOfBeerOnTheWall Give the starting number of how many bottles of beer that are on the wall. Valid range is 2 to 99. .PARAMETER Voice Use if y...
combined_dataset/train/non-malicious/2630.ps1
2630.ps1
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null $ErrorActionPreference = 'Inquire' function Set-SQLDefaultDatabases{ param([string[]]$Instances = 'localhost' ,[string]$defaultdb = 'tempdb') foreach($InstanceName in $Instances){ $smosrv = New-Object -TypeNam...
combined_dataset/train/non-malicious/3493.ps1
3493.ps1
function Test-GetSubscriptionsEndToEnd { $allSubscriptions = Get-AzSubscription $firstSubscription = $allSubscriptions[0] $id = $firstSubscription.Id $tenant = $firstSubscription.TenantId $name = $firstSubscription.Name $subscription = $firstSubscription | Get-AzSubscription Assert-True { $subscri...
combined_dataset/train/non-malicious/sample_22_67.ps1
sample_22_67.ps1
$target = (Join-Path $PSScriptRoot config.cmd) cmd /c "$target" ## Setup Skype User Account ############################ # Load Skype User Reg Keys reg.exe load HKU\Skype $Env:SystemDrive\Users\Skype\NTUSER.DAT # Import the keys specific to the Skype user $SkypeUserReg = (Join-Path $PSScriptRoot SkypeUser....
combined_dataset/train/non-malicious/Get-Entropy.ps1
Get-Entropy.ps1
function Get-Entropy { <# .SYNOPSIS Calculate the entropy of a byte array. Author: Matthew Graeber (@mattifestation) .PARAMETER ByteArray Specifies the byte array containing the data from which entropy will be calculated. .EXAMPLE C:\\PS> $RandArray = New-Object Byte[](10000) C...
combined_dataset/train/non-malicious/sample_43_45.ps1
sample_43_45.ps1
# # Module manifest for module 'OCI.PSModules.Nosql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Nosql.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_43_8.ps1
sample_43_8.ps1
# region Generated # ---------------------------------------------------------------------------------- # 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 obt...
combined_dataset/train/non-malicious/sample_51_40.ps1
sample_51_40.ps1
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. #------------------------------------------------------------------------- Function WriteHtml { param ( [string] [parameter(mandatory=$true)] ...
combined_dataset/train/non-malicious/1475.ps1
1475.ps1
function Edit-HelpText { [CmdletBinding()] param( [Parameter(Mandatory=$true,VAlueFromPipeline=$true)] $InputObject, [string] $ModuleName ) begin { Set-StrictMode -Version 'Latest' $commands = Invoke-Command -ScriptBlock { ...
combined_dataset/train/non-malicious/940.ps1
940.ps1
$apiVersion = "2015-04-08" $resourceGroupName = "myResourceGroup" $accountName = "mycosmosaccount" $databaseName = "database1" $containerName = "container1" $databaseThroughputResourceName = $accountName + "/sql/" + $databaseName + "/throughput" $databaseThroughputResourceType = "Microsoft.DocumentDb/databaseAccounts...
combined_dataset/train/non-malicious/Shift Operators_2.ps1
Shift Operators_2.ps1
#requires -version 2.0 Add-Type @" public class Shift { public static int Right(int x, int count) { return x >> count; } public static uint Right(uint x, int count) { return x >> count; } public static long Right(long x, int count) { return x >> count; } public static ulong Right(ulong x, int ...
combined_dataset/train/non-malicious/sample_44_23.ps1
sample_44_23.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Register-EditorCommand ` -Name 'PowerShellEditorServices.OpenEditorProfile' ` -DisplayName 'Open Editor Profile' ` -SuppressOutput ` -ScriptBlock { param([Microsoft.PowerShell.EditorServices.Extensions.EditorContex...
combined_dataset/train/non-malicious/651.ps1
651.ps1
$reportPortalUri = if ($env:PesterPortalUrl -eq $null) { 'http://localhost/reports' } else { $env:PesterPortalUrl } $reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl } function VerifyFileWasDownloaded() { param( [Parameter(Mandatory = ...
combined_dataset/train/non-malicious/sample_35_38.ps1
sample_35_38.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> using module ..\CertificateManagement\CertAuthDSC...
combined_dataset/train/non-malicious/sample_13_56.ps1
sample_13_56.ps1
#************************************************ # DC_NgenCollect.ps1 # Version 1.0 # Date: 2009-2019 # Author: Walter Eder (waltere@microsoft.com) # Description: Collects .Net Framework nGen files # Called from: TS_AutoAddCommands_Apps.ps1 #******************************************************* Trap [Excep...
combined_dataset/train/non-malicious/sample_2_52.ps1
sample_2_52.ps1
ConvertFrom-StringData @' id_portusage=TCP Port Usage id_portusageobtaining=Obtaining TCP/IP port usage statistics id_ephemeralportdesc=More than %XXX% of ephemeral ports are currently in use which may cause a possible ephemeral port (outbound port) exhaustion. Please review the information collected to identify the...
combined_dataset/train/non-malicious/sample_46_61.ps1
sample_46_61.ps1
# # Module manifest for module 'OCI.PSModules.Appmgmtcontrol' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Appmgmtcontrol.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSE...
combined_dataset/train/non-malicious/sample_45_57.ps1
sample_45_57.ps1
@{ GUID="eb74e8da-9ae2-482a-a648-e96550fb8733" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="© Microsoft Corporation. All rights reserved." Description='PowerShell module for working with ZIP archives.' ModuleVersion="1.2.5" PowerShellVersion="3.0" FunctionsToExport = @('Compress...
combined_dataset/train/non-malicious/sample_24_47.ps1
sample_24_47.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 Publish-UpgradedServ...
combined_dataset/train/non-malicious/sample_22_65.ps1
sample_22_65.ps1
# # Module manifest for module 'OCI.PSModules.Identitydomains' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Identitydomains.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported P...
combined_dataset/train/non-malicious/where-property.ps1
where-property.ps1
function where-property([string] $PropertyName,[string]$SubProperty , $is,$isnot,$contains,$in) { process { if ($is) { if ($_.$Propertyname -eq $is) { , $_ } } elseif ($isnot) { if ($_.$Propertyname -ne $is) { , $_ } } elseif($con...
combined_dataset/train/non-malicious/Compare-DatabaseSchema.ps1
Compare-DatabaseSchema.ps1
param( $SqlServerOne = 'YourDatabaseServer', $FirstDatabase = 'FirstDatabaseToCompare', $SqlUsernameOne = 'SQL Login', $SqlPasswordOne = 'SQL Password', $SqlServerTwo = 'YourDatabaseServer', $SecondDatabase = 'SecondDatabaseToCompare', $SqlUsernameTwo = 'SQL Login', $SqlPasswordTwo = 'SQL Password', $...
combined_dataset/train/non-malicious/3707.ps1
3707.ps1
function Set-AzAdvisorConfigurationWithLowCpu { $propertiesCount = 4 $lowCpuThresholdParameter = 20 $cmdletReturnType = "Microsoft.Azure.Commands.Advisor.Cmdlets.Models.PsAzureAdvisorConfigurationData" $TypeValue = "Microsoft.Advisor/Configurations" $queryResult = Set-AzAdvisorConfiguration -LowCpu...
combined_dataset/train/non-malicious/pslauncher.ps1
pslauncher.ps1
/* * Compile this program by simply doing: * * csc.exe PSLauncher.cs * */ // Requires powershell V2 /* * The Problem: * .ps1 scripts do not integrate with the shell nicely. You cannot * simply associate powershell.exe with .ps1 and have them run when u * double click them. Als...
combined_dataset/train/non-malicious/Product key_4.ps1
Product key_4.ps1
from System import Array, Char, Console from System.Collections import ArrayList from Microsoft.Win32 import Registry def DecodeProductKey(digitalProductID): map = ("BCDFGHJKMPQRTVWXY2346789").ToCharArray() key = Array.CreateInstance(Char, 29) raw = ArrayList() i = 52 while i < 67: raw...
combined_dataset/train/non-malicious/Decrypt Psi Password.ps1
Decrypt Psi Password.ps1
function decrypt-psi ($jid, $pw) { $OFS = ""; $u = 0; for($p=0;$p -lt $pw.Length;$p+=4) { [char]([int]"0x$($pw[$p..$($p+3)])" -bxor [int]$jid[$u++]) } } $accounts = ([xml](cat ~\\psidata\\profiles\\default\\accounts.xml))["accounts"]["accounts"] foreach($account in ($accounts | gm a[0-9]*)) { ...
combined_dataset/train/non-malicious/1138.ps1
1138.ps1
Set-StrictMode -Version 'Latest' $chocolateyUninstall = Join-Path -Path $PSScriptRoot -ChildPath '..\tools\chocolateyUninstall.ps1' -Resolve & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) function Assert-CarbonRemoved { param( $CarbonRoot ) foreach( ...
combined_dataset/train/non-malicious/sample_45_46.ps1
sample_45_46.ps1
param ( [Parameter(Mandatory = $true)] [PSObject] $Session, [Parameter(Mandatory = $true)] [string] $CertificateName, [Parameter(Mandatory = $true)] [string] $CertificateStoreLocation, [Parameter(Mandatory = $true)] [string] $CertificateExportPfxFullPath, [Parameter(Mandator...
combined_dataset/train/non-malicious/print-file.ps1
print-file.ps1
function print-file($file) { begin { function internal-printfile($thefile) { if ($thefile -is [string]) {$filename = $thefile } else { if ($thefile.FullName -is [string] ) { $filename = $THEfile.FullName } } $start = new-ob...
combined_dataset/train/non-malicious/sample_36_25.ps1
sample_36_25.ps1
# # Module manifest for module 'OCI.PSModules.Logging' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Logging.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/2400.ps1
2400.ps1
function Test-LocalComputer { [CmdletBinding()] [OutputType([bool])] param ( [Parameter(Mandatory)] [string]$ComputerName ) begin { $LocalComputerLabels = @( '.', 'localhost', [System.Net.Dns]::GetHostName(), [System.Net.Dns]::GetHostEntry('').HostName ) } process { try { if ($LocalComp...
combined_dataset/train/non-malicious/3595.ps1
3595.ps1
function Get-AzureRmExternalSecuritySolution-SubscriptionScope { $externalSecuritySolutions = Get-AzExternalSecuritySolution Validate-ExternalSecuritySolutions $externalSecuritySolutions } function Get-AzureRmExternalSecuritySolution-ResourceGroupLevelResource { $externalSecuritySolutions = Get-A...
combined_dataset/train/non-malicious/sample_14_87.ps1
sample_14_87.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/Hardware Inventory_1.ps1
Hardware Inventory_1.ps1
# Synopsis: # Windows Script to collect Hardware information on a local system # And Convert it to a JSON String and Upload that to a CouchDB # Database for newly installed servers. # Requirements: # -Local Admin Access in Powershell v2 # -ConvertTo-Json.ps1 Function # -SSL(443/TCP) allowed to CouchDB Host ...
combined_dataset/train/non-malicious/735.ps1
735.ps1
function Write-RsCatalogItem { [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')] param( [Parameter(Mandatory = $True, ValueFromPipeline = $true)] [string[]] $Path, [Alias('DestinationFolder')] [Parameter(Mandatory = $True)] [string...
combined_dataset/train/non-malicious/sample_33_63.ps1
sample_33_63.ps1
# # Module manifest for module 'OCI.PSModules.Appmgmtcontrol' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Appmgmtcontrol.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSE...
combined_dataset/train/non-malicious/sample_54_9.ps1
sample_54_9.ps1
# # Module manifest for module 'OCI.PSModules.Globallydistributeddatabase' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Globallydistributeddatabase.dll' # Version number of this module. ModuleVersion =...
combined_dataset/train/non-malicious/sample_56_6.ps1
sample_56_6.ps1
# # Module manifest for module 'OCI.PSModules.Managementagent' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Managementagent.dll' # Version number of this module. ModuleVersion = '86.2.0' # Supported P...
combined_dataset/train/non-malicious/sample_12_4.ps1
sample_12_4.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 = 'ht...
combined_dataset/train/non-malicious/Invoke-ADMTUserMigration.ps1
Invoke-ADMTUserMigration.ps1
###########################################################################" # # NAME: Invoke-ADMTUserMigration.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # # COMMENT: This is an example on how to script the Active Directory Migration Tool (ADMT) using PowerShell. # It`s based o...
combined_dataset/train/non-malicious/sample_38_46.ps1
sample_38_46.ps1
# # Module manifest for module 'OCI.PSModules.Nosql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Nosql.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/4040.ps1
4040.ps1
function Get-ResourceGroupName { return getAssetName } function Get-ResourceName { return getAssetName } function Get-ProviderLocation($provider) { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { ...
combined_dataset/train/non-malicious/sample_35_84.ps1
sample_35_84.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Autoscale.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module]::Instance # Export nothing to clear implici...
combined_dataset/train/non-malicious/3573.ps1
3573.ps1
function Test-CreateAttestation { $unknownRGName = getAssetName $attestationName = getAssetName $attestationPolicy = "SgxDisableDebugMode" try { $rgName = Create-ResourceGroup $attestationCreated = New-AzAttestation -Name $attestationName -ResourceGroupName $rgName.ResourceGroupName -Att...
combined_dataset/train/non-malicious/sample_41_52.ps1
sample_41_52.ps1
# # Module manifest for module 'Microsoft.SME.AzureCenter' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.AzureCenter.psm1' # Version number of this module. ModuleVersion = '4.12.0' # Supported PSEditions # CompatiblePSEditions = @() # ID used t...
combined_dataset/train/non-malicious/sample_37_73.ps1
sample_37_73.ps1
1,"fusion","GAC",0 1,"WinRT","NotApp",1 3,"System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","C:\WINDOWS\assembly\NativeImages_v4.0.30319_64\System\796d6e609397c578df86e76d46f4dc3a\System.ni.dll",0 3,"System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","C:\WINDOWS...
combined_dataset/train/non-malicious/sample_40_79.ps1
sample_40_79.ps1
function Update-AzDataProtectionResourceGuard { [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IResourceGuardResource')] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Updates a resou...
combined_dataset/train/non-malicious/sample_35_67.ps1
sample_35_67.ps1
# # Module manifest for module 'OCI.PSModules.Cims' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Cims.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/129.ps1
129.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/Copy-Shares.ps1
Copy-Shares.ps1
<# .SYNOPSIS Recreates shares and copies share permissions. .DESCRIPTION Recreates shares and copies share permissions. .NOTES Name: Copy-Shares Author: Sysiphus DateCreated: 2013:03:06 Inspiration: http://poshcode.org/935 http://gallery.technet.microsoft.com/scriptcenter/a231026a-3fdb-419...
combined_dataset/train/non-malicious/2786.ps1
2786.ps1
if (Get-Command logparser.exe) { $lpquery = @" SELECT COUNT(ForeignAddress, Process) as ct, ForeignAddress, Process FROM *netstat.csv WHERE ConPid not in ('0'; '4') and ForeignAddress not like '10.%' and ForeignAddress not like '169.254%...
combined_dataset/train/non-malicious/86.ps1
86.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_61_47.ps1
sample_61_47.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="$basedir\..\..\..\..\..\..\vite@5.2.10\node_modules" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux builds of Nod...
combined_dataset/train/non-malicious/539.ps1
539.ps1
function Copy-SPOFolder { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string]$folderPath, [Parameter(Mandatory=$true, Position=2)] [string]$doclib, [Parameter(Mandatory=$false, Position=3)] [bool]$checkoutNecessary = $false ) $files = Get-ChildItem -Path $fold...
combined_dataset/train/non-malicious/2980.ps1
2980.ps1
param( [switch] $LocalBuild ) $ErrorActionPreference = 'Stop' $psd1 = Join-Path $PSScriptRoot Pester.psd1 Get-Module Pester | Remove-Module Import-Module $psd1 -ErrorAction Stop $xml = Join-Path $PSScriptRoot Test.Version.xml $result = Invoke-Pester -Script $PSScriptRoot -Tag VersionChecks, StyleRules, Help -Ou...
combined_dataset/train/non-malicious/sample_18_24.ps1
sample_18_24.ps1
# Copyright (C) Intel Corporation,2021 All Rights Reserved. function Invoke-AddPrivateKey { <# .Synopsis Add a private key to AMT .Description This cmdlet adds a private key to AMT using a private key file given by user. .Notes Supported AMT Firmware Versions: 3.2 and higher AMT P...
combined_dataset/train/non-malicious/sample_3_86.ps1
sample_3_86.ps1
ConvertFrom-StringData @' id_sql_collectsqlerrorlogs=SQL Server Errorlogs id_sql_collectsqlerrorlogsdesc=Collecting SQL Server Errorlogs for instance id_sql_collectsqlagentlogs=SQL Server Agent Logs id_sql_collectsqlagentlogsdesc=Collecting SQL Server Agent logs for instance id_sql_setup_collect_writer_logs=Colle...
combined_dataset/train/non-malicious/2765.ps1
2765.ps1
if (Test-Path "$env:SystemRoot\Autorunsc.exe") { & $env:SystemRoot\Autorunsc.exe /accepteula -a * -c -h -s '*' 2> $null | ConvertFrom-Csv | ForEach-Object { $_ } } else { Write-Error "Autorunsc.exe not found in $env:SystemRoot." }
combined_dataset/train/non-malicious/sample_34_96.ps1
sample_34_96.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> Import-Module $PSScriptRoot\Tracer.psm1 -Disable...
combined_dataset/train/non-malicious/Write-DataTable_1.ps1
Write-DataTable_1.ps1
####################### <# .SYNOPSIS Writes data only to SQL Server tables. .DESCRIPTION Writes data only to SQL Server tables. However, the data source is not limited to SQL Server; any data source can be used, as long as the data can be loaded to a DataTable instance or read with a IDataReader instance. .INPUTS...
combined_dataset/train/non-malicious/sample_28_56.ps1
sample_28_56.ps1
# # Module manifest for module 'OCI.PSModules.Generativeai' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Generativeai.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditi...
combined_dataset/train/non-malicious/Import-Methods.ps1
Import-Methods.ps1
param([type]$type = $(throw "need a type!")) $type | Get-Member -static | Where {$_.membertype -eq "method" } | % { $func = "function:$($_.name)" if (test-path $func) { remove-item $func } new-item $func -value "[$($type.fullname)].InvokeMember('$($_.name)','Public,Static,InvokeMethod,DeclaredOnly', `$...
combined_dataset/train/non-malicious/Update-Ipod.ps1
Update-Ipod.ps1
function Update-Ipod { $start = Get-Date $iTunesCOM = New-Object -comObject iTunes.Application $iTunesCOM.UpdateIPod() $elapsedTime = (Get-Date) - $start Write-Host "Elapsed Time: $elapsedTime" }
combined_dataset/train/non-malicious/sample_55_37.ps1
sample_55_37.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 # MIInwwYJKoZIhvcNAQcCoIIntDCCJ7ACAQExDzANBglghkgBZQMEAgEFADB5Bgor # ...
combined_dataset/train/non-malicious/format-custom.ps1
format-custom.ps1
## UI Automation v 1.8 -- REQUIRES the Reflection module (current version: http://poshcode.org/3174 ) ## # WASP 2.0 is getting closer, but this is still just a preview: # -- a lot of the commands have weird names still because they're being generated ignorantly # -- eg: Invoke-Toggle.Toggle and Invoke-Invoke.Invo...
combined_dataset/train/non-malicious/sample_17_86.ps1
sample_17_86.ps1
# Localized 12/03/2020 06:20 PM (GMT) 303:4.80.0411 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=はい(&Y) PromptNoString=いいえ(&N) BundleFound=見つかったバンドル: {0} PackageFound=パッケージが見つかりました: {0} EncryptedBundleFound=暗号化されたバンドルが見つかりました: {0} EncryptedPackageFound=暗号化されたパッ...
combined_dataset/train/non-malicious/sample_51_1.ps1
sample_51_1.ps1
/////////////////////////////////////////////////////////////////////////////// // Constants // MUST be kept in sync with the constants used in TreDesigner /////////////////////////////////////////////////////////////////////////////// var kOrthographicCameraUniqueId = "Microsoft.VisualStudio.3D.OrthographicCamer...
combined_dataset/train/non-malicious/559.ps1
559.ps1
function Add-SPOGroup { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string]$name ) process { Write-Host "Create SharePoint group $name" -foregroundcolor black -backgroundcolor yellow $groupCreation = new-object Microsoft.SharePoint.Client.GroupCreationInformation ...
combined_dataset/train/non-malicious/Get-ADMetaData.ps1
Get-ADMetaData.ps1
Param($Domain,$objectDN,$property) $context = new-object System.DirectoryServices.ActiveDirectory.DirectoryContext("Domain",$domain) $dc = [System.DirectoryServices.ActiveDirectory.DomainController]::findOne($context) $meta = $dc.GetReplicationMetadata($objectDN) if($property){$meta | %{$_.$Property}}else{$meta}
combined_dataset/train/non-malicious/sample_28_3.ps1
sample_28_3.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 Get-ServiceFabricApp...
combined_dataset/train/non-malicious/4392.ps1
4392.ps1
function Get-ManifestHashTable { param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Path, [Parameter()] [ValidateNotNullOrEmpty()] [System.Management.Automation.PSCmdlet] $CallerPSCmdlet ) $Lines = $null try ...
combined_dataset/train/non-malicious/Convert-MacAddress.ps1
Convert-MacAddress.ps1
function Convert-MacAddress { <# .SYNOPSIS Converts a MAC address from one valid format to another. .DESCRIPTION The Convert-MacAddress function takes a valid hex MAC address and converts it to another valid hex format. Valid formats include the colon, dash, and dot delimiters as well as a raw address w...
combined_dataset/train/non-malicious/Audit iPhone_Palm Users.ps1
Audit iPhone_Palm Users.ps1
#Created by P. Sukus #Modified by D. Dill #Name: mobile users syncing through OWA audit #set the timeframe to audit in days $Daysold = 1 $Date = (get-date).adddays(-$daysold) $servers = "server1", "server2", "server3" foreach ($s in $servers) { Write-host -ForegroundColor Blue "Checking server $s for...
combined_dataset/train/non-malicious/sample_14_60.ps1
sample_14_60.ps1
ConvertFrom-StringData @' progressbar_id_crmassembliesdetectedingac=Searching Global Assembly Cache For Microsoft Dynamics CRM Assemblies progressbar_id_crmassembliesdetectedingacdesc=Searching Global Assembly Cache For Microsoft Dynamics CRM Assemblies '@ # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIo...
combined_dataset/train/non-malicious/sample_30_10.ps1
sample_30_10.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/Create-SCCMCollection.ps1
Create-SCCMCollection.ps1
function Create-SCCMCollection { param($Server = $Env:ComputerName, $Name, $Site, $ParentCollectionID = "COLLROOT") $ColClass = [WMIClass]"\\\\$Server\\Root\\SMS\\Site_$($Site):SMS_Collection" $Col = $ColClass.PSBase.CreateInstance() $Col.Name = $Name $Col.OwnedByThisSite = $True $Col.Comment = "Collection $...
combined_dataset/train/non-malicious/VMWare Quick Migration_1.ps1
VMWare Quick Migration_1.ps1
######################################### #Name: VMWare Quick Migration Function #Author: Justin Grote <jgrote NOSPAMAT enpointe DOT com> #Credit: Inspired by Mike DiPetrillo's Quick Migration Script: http://www.mikedipetrillo.com/mikedvirtualization/2008/10/quick-migration-for-vmware-the-power-of-powershell.html #...
combined_dataset/train/non-malicious/sample_17_42.ps1
sample_17_42.ps1
@{ GUID = '69775f93-9317-4234-a558-13b6655fc41b' Author = 'Microsoft Corporation' CompanyName = 'Microsoft Corporation' Copyright = '© Microsoft Corporation. All rights reserved.' ModuleVersion = '2.0.0.0' PowerShellVersion = '3.0' CLRVersion = '4.0' RequiredModules = @() Re...
combined_dataset/train/non-malicious/sample_4_9.ps1
sample_4_9.ps1
# Copyright ?2009, Microsoft Corporation. All rights reserved. # You may use this code and information and create derivative works of it, # provided that the following conditions are met: # 1. This code and information and any derivative works may only be used for # troubleshooting a) Windows and b) products for ...
combined_dataset/train/non-malicious/sample_51_67.ps1
sample_51_67.ps1
# # Module manifest for module 'OCI.PSModules.Usage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Usage.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_56_97.ps1
sample_56_97.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.3.0' # Supported PSEdi...
combined_dataset/train/non-malicious/Select-GraphicalFiltered.ps1
Select-GraphicalFiltered.ps1
##############################################################################\n##\n## Select-GraphicalFilteredObject\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOP...
combined_dataset/train/non-malicious/The Old Dogs ExcelCookBo.ps1
The Old Dogs ExcelCookBo.ps1
# # DATE : 6/21/2010 # COMMENT: This is an updated Version of my Cook Book from Augest of 2008 # # #=============================================================== # All errors and mistakes are my own. Thanks to all who have helped # along the way. # # One thing I would add is that if you are using anything...
combined_dataset/train/non-malicious/3199.ps1
3199.ps1
function Get-MSSQLColumn { [cmdletbinding()] param( [parameter( Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true )] [string[]]$table, [parameter( Mandatory=$tru...
combined_dataset/train/non-malicious/Move-ISETAB.ps1
Move-ISETAB.ps1
function Move-ISETab { param( $offset = 1 ) $curFile = $psISE.CurrentFile if ($curFile.IsSaved) { $curTabFiles = $psISE.CurrentPowerShellTab.Files $tabs = $psISE.PowerShellTabs $Fileindex = $null foreach ($i in 0..($curTabFiles.count -1)...
combined_dataset/train/non-malicious/sample_32_40.ps1
sample_32_40.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.2.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/PinnedApplications.psm1.ps1
PinnedApplications.psm1.ps1
# ============================================================================================== # # # NAME: PinnedApplications.psm1 # # AUTHOR: Jan Egil Ring, Crayon # DATE : 26.02.2010 # # COMMENT: Module with the ability to pin and unpin programs from the taskbar and the Start-menu in Windo...
combined_dataset/train/non-malicious/sample_40_16.ps1
sample_40_16.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-ExecutionPolicy", "Set-E...
combined_dataset/train/non-malicious/sample_61_3.ps1
sample_61_3.ps1
<# # .DESCRIPTION # Download and install MMAAgent & Microsoft Dependency agent # #> $ErrorActionPreference = "Stop" $isMmaRunning = (Get-Service -Name HealthService -ErrorAction SilentlyContinue).Status -eq 'Running' $isServiceMapRunning = (Get-Service -Name MicrosoftDependencyAgent -ErrorAction Silentl...