How do I fix error: Test-NetConnection : A positional parameter cannot be found that accepts argument ‘if’
I am trying to mount a File share using the Active Directory or Microsoft Entra auth method. I have the method enabled, I have the PC that I am trying to mount the file share to is enrolled to Intune and the user logged in under their Microsoft Entra ID, and am using the PowerShell script generated by the “Connect” window. Here is the script I am using (with the file share info redacted):