protected override void ExecuteCmdlet() { if (!string.IsNullOrEmpty(DesignPackageId)) { if (Guid.TryParse(DesignPackageId, out Guid designPackageIdGuid)) { SiteCollection.EnableCommunicationSite(ClientContext, designPackageIdGuid).GetAwaiter().GetResult(); } else { throw new Exception($"The provided design package id {DesignPackageId} is not a valid guid."); } } else { SiteCollection.EnableCommunicationSite(ClientContext).GetAwaiter().GetResult(); } }