# encoding: ascii
# api: powershell
# title: Get-UNCPath
# description: Simple function that returns the UNC path (administrative share) of a local path.
# version: 0.1
# type: function
# author: dragonmc77
# license: CC0
# function: Get-UNCPath
# x-poshcode-id: 5657
# x-archived: 2015-11-24T08:27:33
# x-published: 2015-12-30T18:53:00
#
#
function Get-UNCPath {param(	[string]$HostName,
				[string]$LocalPath)
	$NewPath = $LocalPath -replace(":","$")
	#delete the trailing \, if found
	if ($NewPath.EndsWith("\")) {
		$NewPath = [Text.RegularExpressions.Regex]::Replace($NewPath, "\\$", "")
	}
	"\\$HostName\$NewPath"
}
