Describe the bug
Copy-FileToRemoteComputer and Copy-FileFromRemoteComputer currently do not pass the $Credential variable to the SMB file copy method. In scenarios where -Credential is required, we hit an "Access Denied" and fallback to WinRM.
To improve the experience, we need to add support for -Credential when copying files. Copy-Item does not natively support -Credential so we will need to ensure we leverage New-PSDrive to fill this gap. Additional logic needed to detect if already exists.
To Reproduce
Steps to reproduce the behavior:
- Enter into remote session and then attempt to Install-SdnDiagnostics to fabric nodes, while passing -Credential.
- Observe the SMB copy operation fails due to
Access Denied and fallback to WinRM proceeds to copy the file.
Expected behavior
We should support credential when performing SMB file copy operation.
Describe the bug
Copy-FileToRemoteComputerandCopy-FileFromRemoteComputercurrently do not pass the$Credentialvariable to the SMB file copy method. In scenarios where -Credential is required, we hit an "Access Denied" and fallback to WinRM.To improve the experience, we need to add support for
-Credentialwhen copying files. Copy-Item does not natively support-Credentialso we will need to ensure we leverageNew-PSDriveto fill this gap. Additional logic needed to detect if already exists.To Reproduce
Steps to reproduce the behavior:
Access Deniedand fallback to WinRM proceeds to copy the file.Expected behavior
We should support credential when performing SMB file copy operation.