public static async Task <string[]> GetWindowsAccountsListAsync()
        {
            try
            {
                var output = await ProcessLauncherUtil.RunCommandLineAsync(@"c:\windows\system32\iotsettings.exe -list account");

                if (output != null && output.Output != null)
                {
                    ServiceUtil.LogService.Write(output.ToString());
                    return(output.Output?.Split(" ", StringSplitOptions.RemoveEmptyEntries).Where(x => x.Contains("@")).ToArray());
                }
            }
            catch (Exception ex)
            {
                ServiceUtil.LogService.WriteException(ex);
            }

            return(null);
        }
        public static async Task <bool> ClearWindowsAccountAsync(string username)
        {
            try
            {
                var accounts = await GetWindowsAccountsListAsync();

                var output = await ProcessLauncherUtil.RunCommandLineAsync(@"c:\windows\system32\iotsettings.exe" + $" -del account {username}");

                if (output != null)
                {
                    ServiceUtil.LogService.Write(output.ToString());
                    return(output.Result.ExitCode == 0);
                }
            }
            catch (Exception e)
            {
                ServiceUtil.LogService.Write(e.Message, LoggingLevel.Error);
            }

            return(false);
        }
        public async Task <bool> SetUpVM()
        {
            IoTHubService = AppService?.GetRegisteredService <IIoTHubService>();

            NetworkInformation.NetworkStatusChanged += NetworkInformation_NetworkStatusChanged;
            try
            {
                UpdateBoardInfo();
                await UpdateNetworkInfo();

                UpdateConnectedDevices();
                MakerImageBannerVisible = await ProcessLauncherUtil.GetIsMakerImageAsync();

                return(true);
            }
            catch (Exception ex)
            {
                App.LogService.Write(ex.ToString(), Windows.Foundation.Diagnostics.LoggingLevel.Error);
                return(false);
            }
        }