Watching the last 20 lines of the last (log?) file in a directory:
(gci)[-1] | gc | select-object -last 20Finding where .Net is installed:
(get-itemproperty HKLM:\software\microsoft\.netframework).InstallRootPinging a URL [1]:
$temp = (new-object net.webclient).DownloadString($url)Getting the DNS suffix for a machine:
if ($?) { write-host Passed -foregroundcolor "green" }
(Get-WmiObject -class "Win32_ComputerSystem").Domain
[1] Ok, that one's not a one-liner.
1 comment:
[2] But it could be :
[PoSH]> if ((new-object net.webclient).DownloadString($url)) {write-host Passed -foregroundcolor "green
"}
Passed
Greetings /\/\o\/\/
Post a Comment