Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Get a credential - only required if not in same domain and no trust or user doesn't have permission. Note -message for anti-phishing as that will appear in the credential prompt
- $cred = Get-Credential -Message wert3q245352er
- ## Create a remote PS session so our clock difference measurement doesn't also measure session establishment. Don't necessarily need credentials
- $sesh = New-PSSession -Credential $cred -ComputerName glxa19pvs301.guyrleech.local
- ## Get the difference between remote and local clocks 10 times and show average. There will be a small delay as run sequentially not in parallel
- 1..10 |ForEach-Object { (Invoke-Command -Session $sesh -ScriptBlock {Get-Date}) - (Get-Date) } | Measure-Object -Property TotalMilliseconds -Average | Select-Object -Property Average
- ## Close the remote session
- Remove-PSSession -Session $sesh
- $sesh = $null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement