# Replace the placeholder information for the following variables: $ipaddr = '<Nano Server IP address>' $credential = Get-Credential # <An Administrator account on the system> $zipfile = 'PowerShell-7.4.4-win-x64.zip' # Connect to the built-in instance of Windows PowerShell $session = New-PSSession -ComputerName $ipaddr -Credential $credential # Copy the file to the Nano Server instance Copy-Item $zipfile c:\ -ToSession $session # Enter the interactive remote session Enter-PSSession $session # Extract the ZIP file Expand-Archive -Path C:\PowerShell-7.4.4-win-x64.zip -DestinationPath 'C:\Program Files\PowerShell 7'