@@ -700,15 +700,51 @@ public async Task<WinGetInfo> GetInfoAsync(CancellationToken cancellationToken =
700700 /// <exception cref="WGetNET.Exceptions.WinGetNotInstalledException">
701701 /// WinGet is not installed or not found on the system.
702702 /// </exception>
703+ /// <exception cref="System.ArgumentNullException">
704+ /// A provided argument is null.
705+ /// </exception>
703706 public WinGetResult ExecuteCustom ( WinGetArguments args )
704707 {
708+ ArgsHelper . ThrowIfObjectIsNull ( args , "args" ) ;
709+
705710 ThrowIfNotInstalled ( ) ;
706711
707712 WinGetResult result = new ( Execute ( args ) , args ) ;
708713
709714 return result ;
710715 }
711716
717+ /// <summary>
718+ /// Exectutes WinGet with the provided arguments.
719+ /// </summary>
720+ /// <param name="args">
721+ /// A <see cref="System.String"/> containing the arguments for the WinGet process.
722+ /// </param>
723+ /// <returns>
724+ /// A <see cref="WGetNET.WinGetResult"/> object.
725+ /// </returns>
726+ /// <exception cref="WGetNET.Exceptions.WinGetNotInstalledException">
727+ /// WinGet is not installed or not found on the system.
728+ /// </exception>
729+ /// <exception cref="System.ArgumentNullException">
730+ /// A provided argument is null.
731+ /// </exception>
732+ /// <exception cref="System.ArgumentException">
733+ /// A provided argument is empty.
734+ /// </exception>
735+ public WinGetResult ExecuteCustom ( string args )
736+ {
737+ ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( args , "args" ) ;
738+
739+ ThrowIfNotInstalled ( ) ;
740+
741+ WinGetArguments argsObj = WinGetArguments . CustomCmd ( args ) ;
742+
743+ WinGetResult result = new ( Execute ( argsObj ) , argsObj ) ;
744+
745+ return result ;
746+ }
747+
712748 /// <summary>
713749 /// Asynchronously exectutes WinGet with the provided arguments.
714750 /// </summary>
@@ -724,14 +760,53 @@ public WinGetResult ExecuteCustom(WinGetArguments args)
724760 /// <exception cref="WGetNET.Exceptions.WinGetNotInstalledException">
725761 /// WinGet is not installed or not found on the system.
726762 /// </exception>
763+ /// <exception cref="System.ArgumentNullException">
764+ /// A provided argument is null.
765+ /// </exception>
727766 public async Task < WinGetResult > ExecuteCustomAsync ( WinGetArguments args , CancellationToken cancellationToken = default )
728767 {
768+ ArgsHelper . ThrowIfObjectIsNull ( args , "args" ) ;
769+
729770 ThrowIfNotInstalled ( ) ;
730771
731772 WinGetResult result = new ( await ExecuteAsync ( args , false , cancellationToken ) , args ) ;
732773
733774 return result ;
734775 }
776+
777+ /// <summary>
778+ /// Asynchronously exectutes WinGet with the provided arguments.
779+ /// </summary>
780+ /// <param name="args">
781+ /// A <see cref="System.String"/> containing the arguments for the WinGet process.
782+ /// </param>
783+ /// <param name="cancellationToken">
784+ /// The <see cref="System.Threading.CancellationToken"/> for the <see cref="System.Threading.Tasks.Task"/>.
785+ /// </param>
786+ /// <returns>
787+ /// A <see cref="System.Threading.Tasks.Task"/> containing the <see cref="WGetNET.WinGetResult"/> object.
788+ /// </returns>
789+ /// <exception cref="WGetNET.Exceptions.WinGetNotInstalledException">
790+ /// WinGet is not installed or not found on the system.
791+ /// </exception>
792+ /// <exception cref="System.ArgumentNullException">
793+ /// A provided argument is null.
794+ /// </exception>
795+ /// <exception cref="System.ArgumentException">
796+ /// A provided argument is empty.
797+ /// </exception>
798+ public async Task < WinGetResult > ExecuteCustomAsync ( string args , CancellationToken cancellationToken = default )
799+ {
800+ ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( args , "args" ) ;
801+
802+ ThrowIfNotInstalled ( ) ;
803+
804+ WinGetArguments argsObj = WinGetArguments . CustomCmd ( args ) ;
805+
806+ WinGetResult result = new ( await ExecuteAsync ( argsObj , false , cancellationToken ) , argsObj ) ;
807+
808+ return result ;
809+ }
735810 //---------------------------------------------------------------------------------------------
736811
737812 //---Protected Functions-----------------------------------------------------------------------
0 commit comments