I am trying to build a Powershell script that allows you to perform various system administration level tasks from a Powershell session. However, outside of the network, I am having issues resolving the hostname and possibly with authentication. The DNS records are okay at the Domain Controller level and even entered DNS entries in \drivers\etc\host file and still coming up with one of two errors, either if using fqdn, it fails to resolve or if using an IP address it states you can only use this method with HTTPS enabled. This is what I've tried so far below:
$rcreds = Get-Credential -credential test.user@test.com
$rcomp = Read-Host "Enter FQDN of remote computer"
$rdir = Read-Host "Enter directory"
Invoke-Command -ComputerName $rcomp -ScriptBlock -Credential $rcreds {
Get-ChildItem c$\$rdir
}