Powershell Nuget 推送命令 URL 包含 space

Powershell Nuget push command URL contains space

在发布 nuget 数据包时出现错误:

指定的来源“\\fileserver\IT 用户 Data\Nuget”无效。请提供有效来源。

问题一定与源 URL 中的空格有关。有解题经验吗?

谢谢

将 URL 保存在变量中,例如$SitePath,然后使用 [uri]::EscapaeDataString() 方法。

[uri]::EscapeDataString($SitePath)