Powershell-Sessions


How to create Windows PowerShell session?
Why any would require powershell session? when working with remote computer, you would need to create the session object and using that session object
you can do multiple tasks on that computer like deployment.
Step 1: First we need create credential, which required for session

Example

$cred = Get-Credential -Credential Domain\administrator

Copy and Try it


Step 2:Get-PSSession cmdlet

Example

Enter-PSSession -ComputerName myComp -Credential $cred

Copy and Try it


Step 3: Remove-PSSession cmdlet removes unused PSSessions frees up resource.