verify resource context before running cmdlet