Im using azure devops release pipeline. Im planning to map the azure Fileshare to all VMS in deployment groups. I have the script from the portal to map fileshare in local. Replacing the passkey value in that script I'm passing as variable. Tried to check and the value is getting. But in results it shows mapped with the drive letter. When I opened the file explorer it shows disconnected and unable to eject the sharepath shows "This network connection does not exist" Also it is not even mapped. If any issue in getting keys from variable means it should throw error without showing drive create status.
Looking for help is any step or mistake happened in the pipeline? Or in script?
Note: in local i can able to run the script successful and drive mapped successful as well.
Script:
cmd.exe /C "cmdkey /add:"storageaccount.file.core.windows.net
" /user:"localhost\storageaccount
" /pass:"accesskeyforstorageaccount
"
New-PSDrive -Name Z -PSProvider Filesystem -Root "\storageaccount.file.core.windows.net\fileshare-name" -Persist