implement watch function in profile.ps1

master
lub 2 years ago
parent c31e42a1c7
commit a5a5fe2138

@ -91,6 +91,22 @@ function fsh {
Enter-PSSession @PSBoundParameters @args
}
function watch {
param (
[int]$n = 2,
[Parameter(Mandatory,
Position = 0)]
$ScriptBlock
)
while ($true) {
$o = Invoke-Command -ScriptBlock $ScriptBlock
Clear-Host
$o
Start-Sleep -Seconds $n
}
}
#check for old version
if($PSVersionTable.PSVersion.Major -le 5){

Loading…
Cancel
Save