I'm trying to add C# type to PowerShell as follows:
Add-Type -Path (Join-Path $assemblyPath "WinSCPnet.dll")
And I get the following error:
Add-Type : Cannot bind parameter 'Path' to the target. Exception setting "Path":
"Cannot find path 'D:\Source\Repos\....\TestDataAccess\WinSCPnet.dll' because it
does not exist."
At D:\Source\Repos\....\TestDataAccess\WinSCPFiles.ps1:8 char:16
+ Add-Type -Path (Join-Path $assemblyPath "WinSCPnet.dll")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Add-Type], ParameterBindingException
+ FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.AddTypeCommand