Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
deoliveirathiago opened this issue Nov 6, 2018 · 0 comments

Comments

@deoliveirathiago
Copy link

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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant