Working Version: # Initialize with defaults$credFileExists=$False# This function is a workaround to the issue of…