I tried all solution i saw online.
on the VM i dd "Enable-PSRemoting -Force"
then when i use "Get-Service winrm" i get the service is running.
i also used winrm s winrm/config/client '@{TrustedHosts="$local machine"}' at the VM and "Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force"
on the local machine i use the command "Enter-PSSession -ComputerName $RemoteComputer -Credential $Creds"
and get:
Enter-PSSession : Connecting to remote server VM01 failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
At line:8 char:1
+ Enter-PSSession -ComputerName $RemoteComputer -Credential $Creds
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (VM01:String) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed