import-module sqlps CD SQLSERVER:\SQL\$env:computername $sql = (get-item .).ManagedComputer # This command stops MSSQL$instanceName, SQLSERVERAGENT, SQLAGENT$instanceName,…