- Function Get-SessionName([string]$SessionInit,[string]$Hostname=$null)
-
{
$currtime=Get-Date -UFormat "%s"
$currtime=
$currtime.substring(0,$currtime.indexof("."))
$SessionName=$SessionInit+"_"+$currtime+"_"+$Hostname
return $SessionName
}
in a lot of cases (different regional settings) this will lead to exception in ANY powershell query to monitored servers