How to write PowerShell script using TSQL

Sometimes we are not able to connect the server to execute a power shell script that time we can run the same power shell command using TSQL statement, To enable CMD Shell To get process list on server To get disk space from server To get performance counter