we need to know if the target path is a policy or not so we try and get the object. getting an object causes an error if it doesn't exist, but since the target object may not exist, which is expected, we need to handle the error.
also backing out the use of join-path which causes \ to change to / on non-windows systems and causes errors.
we need to know if the target path is a policy or not so we try and get the object. getting an object causes an error if it doesn't exist, but since the target object may not exist, which is expected, we need to handle the error.
also backing out the use of join-path which causes \ to change to / on non-windows systems and causes errors.