8,330 questions
Just do an internet search, find one that's close too what you want, and modify it to suit your needs.
https://www.bing.com/search?q=powershell+check+server+status
Like this one.
https://www.powershellbros.com/use-powershell-function-to-check-if-servers-are-accessible/