PowerShell is Microsoft's scripting language/shell that comes with Windows server and desktop per-installed nowadays. It has tight integration with the operating system and Microsoft's various server products. For automating tasks on Windows, it is a pretty compelling choice because of this bundling.
PowerShell runs on Windows only, so it is not a good choice in doing cross-platform metrics data gathering and scripting.
Below are scripts that should be scheduled as SQL Server Agent job steps to gather Windows server and SQL Server related metrics data.