Skip to main content
12 events
when toggle format what by license comment
S Dec 28, 2019 at 20:41 history edited Michael West CC BY-SA 4.0
Fixed spelling and grammar
S Dec 28, 2019 at 20:41 history suggested Ercan Polat CC BY-SA 4.0
Fixed spelling and grammar
Dec 28, 2019 at 19:47 review Suggested edits
S Dec 28, 2019 at 20:41
Mar 1, 2017 at 22:54 history edited Michael West CC BY-SA 3.0
added 278 characters in body
Nov 29, 2016 at 21:03 history edited Michael West CC BY-SA 3.0
Added example.
Nov 29, 2016 at 14:31 comment added Dan Sinclair Thanks! You should be able to run the code from my question in a remote session as-is to see the exact issue I described. (You'll need to create some content items below /sitecore/content/data/tempdata so there's something to delete.)
Nov 29, 2016 at 14:21 comment added Michael West I completely agree and understand Dan. If I can come up with some additional examples to help out I'll update the answer. Feel free to share more barebones examples of what kind of message you need trapped and I'll see if it's possible.
Nov 29, 2016 at 14:18 comment added Dan Sinclair Sure, that makes sense. I guess my underlying question is more about making sure that all the errors get returned to the remote session, more than this specific case (obviously, I'll fix this one :) ). My concern is if some new error occurs, but in the remote session everything looks OK. I wouldn't know it had failed.
Nov 29, 2016 at 14:03 comment added Michael West Oops, I see your updated question now. The errors that are bubbled up include those that have syntax issues. If you ran for example Get-Item on a path that does not exist, the error doesn't stop the script from running. It's also more of a warning that the path doesn't exist. You could try using Test-Path in more places and Write-Output to return result messages back.
Nov 29, 2016 at 14:01 comment added Michael West The current version 4.2 really optimizes the authoring experience from within the Sitecore interface. I would encourage you to consider authoring more complex scripts there and then applying to the remoting script when ready.
Nov 29, 2016 at 13:59 comment added Dan Sinclair Unfortunately, the error that is thrown by Remove-Item if the path is not found does not get bubbled up to be caught when it's executed from a remoting session. When I run your code from your second example, I see the right result. However, if I remove the -ParameterDoesNotActuallyExist parameter and instead allow it to use an incorrect path, it fails silently. Are there multiple categories of errors that I need to handle differently?
Nov 29, 2016 at 2:31 history answered Michael West CC BY-SA 3.0