1

I have a Visual Studio 2019 project that I want to locally deploy to a network folder.
\\api\c$\inetpub\wwwroot The path requires a user name and password. Which The default visual studio publish does not prompt I simply get this error.

Severity Code Description Project File Line Suppression State Suppression State Error Unable to create directory "\\api\c$\inetpub\wwwroot\API\v1\". The user name or password is incorrect. API.Web.NET 0

  • What I am thinking is a power shell script that I could include in the project.
  • I could publish locally then copy to the network.
  • I want the user name and password to prompt so nothing is hard coded.

Any ideas or links would help

user1730289
  • 273
  • 4
  • 15

1 Answers1

0

You can use Get-Credential to prompt for both username and password.

$credential = Get-Credential
Copy-Item $yourlocalpublishpath $yourdestinationpath -Credential $credential