tobania / VSTS.Extension.SqlReportingServices

VSTS Extension for uploading SSRS Reports
MIT License
14 stars 20 forks source link

$ssrs.CreateFolder, folder exists in server with another language than english #48

Open deoliveirathiago opened 5 years ago

deoliveirathiago commented 5 years ago

In the folder create ($ssrs.CreateFolder) we have a try{} catch{} block and if in the error message the text "already exists" is present a message is shown (Folder $folderName already exists, Skipping!), but if we use a server in another language, throw is executed.

Suggestion, use the exception namespace:

if($_.Exception.Message.ToLower().Contains("itemalreadyexistsexception")){
    Verbose-WriteLine "Folder $folderName already exists, Skipping!" 
}else{
    throw;
}