Şöyle yaparız
Enter-PSSession -ComputerName COMPUTER -Credential USER
ÖrnekThis simple command tests whether the WinRM service is running on the remote PC. If it completes successfully, you’ll see information about the remote computer’s WinRM service in the window—signifying that WinRM is enabled and your PC can communicate. If the command fails, you’ll see an error message instead.
Test-WsMan COMPUTER
WinRM (Windows Remote Management) is Microsoft's implementation of WS-Management in Windows which allows systems to access or exchange management information across a common network
This command starts the WinRM service, sets it to start automatically with your system, and creates a firewall rule that allows incoming connections. The -Force part of the cmdlet tells PowerShell to perform these actions without prompting you for each step.If your PCs are part of a domain, that’s all the setup you have to do. You can skip on ahead to testing your connection. If your computers are part of a workgroup—which they probably are on a home or small business network—you have a bit more setup work to do.
Enable-PSRemoting -Force
Set-Item wsman:\localhost\client\trustedhosts *
Next, you need to configure the TrustedHosts setting on both the PC to which you want to connect and the PC (or PCs) you want to connect from, so the computers will trust each other. You can do this in one of two ways.If you’re on a home network where you want to go ahead and trust any PC to connect remotely, you can type the following cmdlet in PowerShell (again, you’ll need to run it as Administrator).Set-Item wsman:\localhost\client\trustedhosts *The asterisk is a wildcard symbol for all PCs. If instead you want to restrict computers that can connect, you can replace the asterisk with a comma-separated list of IP addresses or computer names for approved PCs.
Restart-Service WinRM
After running that command, you’ll need to restart the WinRM service so your new settings take effect.
Bunun Türkçesi şöyle... WinRM firewall exception will not work since one of the network connection types on this machine is set to Public. Change the network connection type to either Domain or Private and try again. ...
... Bu makinedeki ağ bağlantısı türlerinden biri Ortak olarak ayarlandığından winRM güvenlik duvarı özel durumu çalışmayacak. Ağ bağlantısı türünü Etki Alanı ya da Özel olarak değiştirin veya yeniden deneyin ...Bu seçenek ile Network Profile yani ağ tipi kontrolü yapılmaz
powershell.exe "(get-physicaldisk).MediaType"
powershell.exe -ExecutionPolicy Bypass -File myscript.ps
/f Force running applications to close without forewarning users.
Generally shutdown /s does not send any "close" messages. It call one of few Win32 API functions for shutting down Windows system.These functions in turn notify aplications about shutdown/restart event via WM_QUERYENDSESSION and WM_ENDSESSION messages.Programs can then agree or try to prevent pending shutdown by responsing properly to WM_QUERYENDSESSION, eg. for stopping cleanly, etc.So, in theory after issue shutdown /s command, there is some "close" messages send to all programs and you don't need doing anything special for that.
/t xxx Set the time-out period before shutdown to xxx seconds. The valid range is 0-315360000 (10 years), with a default of 30. If the timeout period is greater than 0, the /f parameter is implied.
If you want applications to be able to cancel the shutdown, you need to use shutdown /s /t 0 instead.
BUT if you specify any timeout period greater than 0, or leave the timeout unspecified (as in shutdown /s on its own), Windows will actually kill your processes without offering you the chance to intervene. Incredible as it sounds, this is true, and is even by design, as shown by the usage output from shutdown /?.