Reputation: 97
I want to copy the file to a network drive using build agent (powershell or cmd (Build Steps)).
P:
# or
cd P:\foolder\
# ...
But the commands don't work. Build log: "Disk P not found". The disk is connected via windows. When running from windows, the commands work. I assume java/BuildAgent doesn't have rights. But my user has rights. And java, and BuildAgent runs under my user.
Please, do not offer FTP
Upvotes: 1
Views: 727
Reputation: 576
Obviously with the Powershell Build Runner you cannot access premade network shares, but you have the rights to make new network shares. Running the command :
New-PSDrive –Name "P" -PSProvider FileSystem -Root "\\[server name]\[root folder]" ErrorAction Stop
Will make a drive on the letter "P" for whichever network share you are using. This drive letter is only valid for current Powershell session.
Thanks to Serhiy Pikho from teamcity-support.jetbrains.com
Upvotes: 1
Reputation: 989
Open command prompt as Administrator
bind your drive again using below command
net use x: \\10.1.2.3\Share
again do the same in Command prompt without administrator (if its not bounded)
Upvotes: 0