protected override void ExecuteCmdlet()
        {
            var results      = SiteCollection.AliasExistsAsync(ClientContext, Alias);
            var returnedBool = results.GetAwaiter().GetResult();

            WriteObject(returnedBool);
        }
        /// <summary>
        /// Checks if an alias is already used for an office 365 group or not
        /// </summary>
        /// <param name="clientContext">ClientContext of the site to operate against</param>
        /// <param name="alias">Alias to verify</param>
        /// <returns>True if in use, false otherwise</returns>
        public static async Task <bool> AliasExistsAsync(this ClientContext clientContext, string alias)
        {
            await new SynchronizationContextRemover();

            return(await SiteCollection.AliasExistsAsync(clientContext, alias));
        }
Beispiel #3
0
 /// <summary>
 /// Checks if an alias is already used for an office 365 group or not
 /// </summary>
 /// <param name="clientContext">ClientContext of the site to operate against</param>
 /// <param name="alias">Alias to verify</param>
 /// <returns>True if in use, false otherwise</returns>
 public static async Task <bool> AliasExistsAsync(this ClientContext clientContext, string alias)
 {
     return(await SiteCollection.AliasExistsAsync(clientContext, alias));
 }