winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

PSApplyConfigurationUnitResult.cs (1820B)


      1 // -----------------------------------------------------------------------------
      2 // <copyright file="PSApplyConfigurationUnitResult.cs" company="Microsoft Corporation">
      3 //     Copyright (c) Microsoft Corporation. Licensed under the MIT License.
      4 // </copyright>
      5 // -----------------------------------------------------------------------------
      6 
      7 namespace Microsoft.WinGet.Configuration.Engine.PSObjects
      8 {
      9     using Microsoft.Management.Configuration;
     10     using Microsoft.WinGet.Configuration.Engine.Helpers;
     11 
     12     /// <summary>
     13     /// The apply result of a configuration unit.
     14     /// </summary>
     15     public class PSApplyConfigurationUnitResult : PSUnitResult
     16     {
     17         /// <summary>
     18         /// Initializes a new instance of the <see cref="PSApplyConfigurationUnitResult"/> class.
     19         /// </summary>
     20         /// <param name="unitResult">Apply unit result.</param>
     21         internal PSApplyConfigurationUnitResult(ApplyConfigurationUnitResult unitResult)
     22             : base(unitResult.Unit, unitResult.ResultInformation)
     23         {
     24             this.State = Utilities.ToPSConfigurationUnitState(unitResult.State);
     25             this.PreviouslyInDesiredState = unitResult.PreviouslyInDesiredState;
     26         }
     27 
     28         /// <summary>
     29         /// Gets the unit state.
     30         /// </summary>
     31         public PSConfigurationUnitState State { get; private init; }
     32 
     33         /// <summary>
     34         /// Gets a value indicating whether the unit was in a previous desired state.
     35         /// </summary>
     36         public bool PreviouslyInDesiredState { get; private init; }
     37 
     38         /// <summary>
     39         /// Gets a value indicating whether a reboot is required after the configuration unit was applied.
     40         /// </summary>
     41         public bool RebootRequired { get; private init; }
     42     }
     43 }