### Run Invoke-PSTuiTools Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-PSTuiTools.md This example shows how to launch the PSTuiTools TUI to browse and execute module commands. ```powershell PS C:\> Invoke-PSTuiTools ``` -------------------------------- ### Install PSTuiTools Module Source: https://github.com/jdhitsolutions/pstuitools/blob/main/README.md Installs the PSTuiTools module from the PowerShell Gallery. This command requires PowerShell 7. ```powershell Install-PSResource PSTuiTools ``` -------------------------------- ### Launch TUI using Alias Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-HelloWorld.md Use the 'HelloWorld' alias to launch the TUI demo. This is the primary way to run the 'Hello World' example. ```powershell PS C:\> HelloWorld ``` -------------------------------- ### Display Service Information with Invoke-ServiceInfo Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-ServiceInfo.md This example shows the basic usage of the Invoke-ServiceInfo cmdlet to launch the TUI and retrieve service information from the local computer. After launching, users can interact with the TUI to specify filters and retrieve updated information. ```powershell PS C:\> Invoke-ServiceInfo ``` -------------------------------- ### Run the TUI Template Script Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-TuiTemplate.md This example demonstrates how to invoke the Invoke-TuiTemplate cmdlet to run the default TUI template script. No parameters are required for basic execution. ```powershell Invoke-TuiTemplate ``` -------------------------------- ### Get Command Syntax for Invoke-SystemStatus Source: https://github.com/jdhitsolutions/pstuitools/blob/main/README.md Displays the syntax for the Invoke-SystemStatus command, showing available parameters like Computername, Credential, and WindowColor. ```powershell PS C:\> Get-Command Invoke-SystemStatus -Syntax Invoke-SystemStatus [[-Computername] ] [-Credential ] [-WindowColor ] [] ``` -------------------------------- ### Get User Credentials with TUI Source: https://github.com/jdhitsolutions/pstuitools/blob/main/README.md Use Get-TuiCredential to prompt the user for a username and password, returning a PSCredential object. You can optionally provide a username as a parameter. ```powershell $cred = Get-TuiCredential ``` -------------------------------- ### Launch TuiTreeDemo with Default Values Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-TuiTreeDemo.md Launches the TreeView demo TUI using the default path ($HOME) and default depth (4). ```powershell PS C:\> Invoke-TuiTreeDemo ``` -------------------------------- ### Run TUI Color Demo Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-TuiColorDemo.md This command launches the TUI color demonstration. It has an alias of TuiColorDemo. ```powershell Invoke-TuiColorDemo ``` -------------------------------- ### Invoke-TuiMp3 Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-TuiMp3.md Launches a TUI MP3 player. You can specify the path to a .mp3 or .m4a file to load it into the player. Options are available to set a default library, customize background and foreground colors, and set the window title. ```APIDOC ## Invoke-TuiMp3 ### Description Launches a TUI MP3 player. You can specify the path to a .mp3 or .m4a file to load it into the player. Options are available to set a default library, customize background and foreground colors, and set the window title. ### Syntax ```powershell Invoke-TuiMp3 [[-FilePath] ] [-Title ] [-DefaultLibrary ] [-Background ] [-Foreground ] [] ``` ### Parameters #### -FilePath Specify the path to .mp3 or .m4a file. - **FilePath** (String) - Optional - Specify the path to .mp3 or .m4a file. #### -Title Specify the window title. - **Title** (String) - Optional - Specify the window title. Default value: PSMusic Player #### -DefaultLibrary Specify the default folder to open for .mp3 and .m4a files. You will have to manually select the appropriate extension from the drop down. UNC paths are supported. - **DefaultLibrary** (String) - Optional - Specify the default folder to open for .mp3 and .m4a files. #### -Background Specify the TUI background color. Use tab-completion to see all possible values. - **Background** (Color) - Optional - Specify the TUI background color. #### -Foreground Specify the TUI foreground color. Use tab-completion to see all possible values. - **Foreground** (Color) - Optional - Specify the TUI foreground color. ### Examples #### Example 1 ```powershell Invoke-TuiMp3 -FilePath "C:\Music\MySong.mp3" ``` Launch the TUI MP3 player and load the specified MP3 file. You will need to click the Play button. #### Example 2 ```powershell Invoke-TuiMp3 -DefaultLibrary "C:\Music" -Background Black -Foreground BrightGreen ``` Launch the TUI MP3 player and set the default library to the specified folder. You can then navigate to your MP3 files more easily. This parameter has an alias of Library. The example will also create a TUI with a black background and green text. ``` -------------------------------- ### Run TuiGraphDemo Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-TuiGraphDemo.md Launches a demonstration TUI graph. This command can also be invoked using the 'tuiGraph' alias. ```powershell PS C:\> Invoke-TuiGraphDemo ``` -------------------------------- ### Launch System Status Monitor for Local Computer Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-SystemStatus.md Use this command to launch the system status monitor for the local machine. No additional parameters are required. ```powershell PS C:\> Invoke-SystemStatus ``` -------------------------------- ### Launch TUI MP3 Player with Specific File Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-TuiMp3.md Launches the TUI MP3 player and loads a specified MP3 file. The user will need to manually initiate playback. ```powershell PS C:\> Invoke-TuiMp3 -FilePath "C:\Music\MySong.mp3" ``` -------------------------------- ### Launch TUI MP3 Player with Default Library and Custom Colors Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-TuiMp3.md Launches the TUI MP3 player, setting a default library folder for easier navigation and customizing the player's appearance with a black background and bright green text. The '-DefaultLibrary' parameter has an alias of '-Library'. ```powershell PS C:\> Invoke-TuiMp3 -DefaultLibrary "C:\Music" -Background Black -Foreground BrightGreen ``` -------------------------------- ### List Available PSTuiTools Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Get-PSTuiTools.md Use Get-PSTuiTools to display a list of all available TUI tools within the PSTuiTools module, including their names, aliases, and a brief synopsis. ```powershell PS C:\> Get-PSTuiTools Module: PSTuiTools [v0.6.0] Name Alias Synopsis ---- ----- -------- Get-PSTuiTools Get sample TUI tools. Get-TuiCredential tuicred Prompt for credentials in a TUI. Invoke-HelloWorld HelloWorld Run a "Hello World" demo. Invoke-ProcessPeeker ProcessPeeker A TUI process viewer. Invoke-PSTuiTools PSTuiTools Show module commands in a TUI Invoke-ServiceInfo ServiceInfo A TUI for displaying service information. Invoke-SystemStatus TuiStatus Run a system status TUI monitor. Invoke-TuiColorDemo TuiColorDemo Run the TUI color demo. Invoke-TuiGraphDemo tuiGraph Run a demo TUI graph. Invoke-TuiMp3 tuimp3 Launch a TUI MP3 player. Invoke-TuiTemplate TuiTemplate Run the TUI template script. Invoke-TuiTreeDemo tuiTree Run a TreeView demo TUI. Save-TuiAssembly Download Terminal.GUI and NStack assemblies. ``` -------------------------------- ### Launch TuiTreeDemo with Custom Path and Depth Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-TuiTreeDemo.md Opens the TreeView demo TUI, specifying a custom directory (C:\Scripts) and limiting the display depth to 2 levels. ```powershell PS C:\> tuiTree c:\scripts -depth 2 ``` -------------------------------- ### Download Terminal.Gui and NStack Assemblies Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Save-TuiAssembly.md Use this command to download and save the NStack and Terminal.Gui assemblies to a specified destination folder. The function automatically creates subfolders for each assembly. ```powershell PS C:\> Save-TuiAssembly -DestinationPath "C:\Tools\" ``` -------------------------------- ### Launch System Status Monitor for Remote Computer with Customizations Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-SystemStatus.md Launch the system status monitor for a remote computer, specifying alternate credentials and a custom window color. Ensure you have administrative rights on the target machine. ```powershell PS C:\> Invoke-SystemStatus -Computername SRV1 -credential administrator -color Cyan ``` -------------------------------- ### Invoke-SystemStatus Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-SystemStatus.md Launches a system status monitor TUI. You can specify a computer name, alternate credentials, and the TUI window color. The monitor includes features for manual and automatic refresh, and a quit option. ```APIDOC ## Invoke-SystemStatus ### Description Launches a system status monitor TUI. Enter a computer name and alternate credentials if necessary. Click the Refresh button or the Alt+R shortcut to manually refresh information. You can also set an automatic refresh interval. Click the Timer button to stop and start. If you change the computer, you should stop the timer first. Restart it after changing the computer name. Use the Quit button or Alt+Q to exit. ### Method Invoke (PowerShell Cmdlet) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **Computername** (String) - Optional - The name of the computer to monitor. You must have admin rights. - **Credential** (PSCredential) - Optional - Alternate credentials for a remote computer. - **WindowColor** (Color) - Optional - Specify the window foreground color. The background will be Black. Accepted values: Black, Blue, Green, Cyan, Red, Magenta, Brown, Gray, DarkGray, BrightBlue, BrightGreen, BrightCyan, BrightRed, BrightMagenta, BrightYellow, White. ### Request Example ```powershell Invoke-SystemStatus -Computername SRV1 -credential administrator -color Cyan ``` ### Response This cmdlet does not produce direct output to the console; it launches a TUI. #### Success Response None (Launches TUI) #### Response Example None ``` -------------------------------- ### Load TUI Assemblies Source: https://github.com/jdhitsolutions/pstuitools/blob/main/README.md Loads the Terminal.Gui and NStack assemblies into your project. Adjust the path to where the assemblies are saved. ```powershell Add-Type -path \Nstack.dll Add-Type -path \Terminal.Gui.dll ``` -------------------------------- ### Invoke-TuiTemplate Cmdlet Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-TuiTemplate.md The Invoke-TuiTemplate cmdlet runs the TUI template script, serving as a base for creating custom TUI applications. The script can be copied to the clipboard for customization. ```APIDOC ## Invoke-TuiTemplate ### Description Runs the TUI template script included in the PSTuiTools module. This script can be used as a foundation for developing custom TUI applications. ### Method Invoke (PowerShell Cmdlet) ### Syntax Invoke-TuiTemplate ### Parameters This cmdlet supports common PowerShell parameters such as -Debug, -ErrorAction, -Verbose, etc. For a full list, refer to about_CommonParameters. ### Examples #### Example 1 ```powershell Invoke-TuiTemplate ``` ``` -------------------------------- ### Launch ProcessPeeker TUI Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Invoke-ProcessPeeker.md Launches the TUI process viewer. This command has an alias of ProcessPeeker. ```powershell PS C:\> Invoke-ProcessPeeker ``` -------------------------------- ### Save-TuiAssembly Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Save-TuiAssembly.md Downloads the latest versions of Terminal.Gui and NStack assemblies from NuGet and saves them to a specified location. Users can optionally specify which assemblies to download. ```APIDOC ## Save-TuiAssembly ### Description Downloads Terminal.GUI and NStack assemblies from NuGet to a specified destination path. This function is used to obtain the necessary assemblies for creating TUI applications in PowerShell. ### Syntax ```powershell Save-TuiAssembly [[-Package] ] -DestinationPath [] ``` ### Parameters #### -Package Specifies the name of the assembly to download. Accepted values are 'Terminal.Gui' and 'NStack'. If omitted, both assemblies are downloaded. * **Type**: String[] * **Required**: False * **Position**: 0 #### -DestinationPath Specifies the top-level folder where the downloaded assemblies will be saved. The function will create subfolders for each assembly (e.g., 'Terminal.Gui', 'NStack') within this path. * **Type**: String * **Required**: True * **Position**: Named ### Examples #### Example 1: Download both assemblies ```powershell Save-TuiAssembly -DestinationPath "C:\Tools\" ``` This command downloads both NStack and Terminal.Gui assemblies and saves them into `C:\Tools\`, creating subfolders `C:\Tools\Terminal.Gui` and `C:\Tools\NStack`. ``` -------------------------------- ### Save TUI Assemblies Source: https://github.com/jdhitsolutions/pstuitools/blob/main/README.md Downloads the latest versions of Terminal.Gui and NStack assemblies to a local folder. Reference these assemblies in your project. ```powershell Save-TuiAssembly -DestinationPath "C:\Tools\" ``` -------------------------------- ### Define TUI Label with New() Source: https://github.com/jdhitsolutions/pstuitools/blob/main/README.md Creates a TUI Label element by instantiating the class and setting properties individually. This is another method for defining TUI elements. ```powershell $lblUsername = [Terminal.Gui.Label]::new() $lblUsername.Text = 'UserName' $lblUsername.X = 1 $lblUsername.Y = 1 ``` -------------------------------- ### Define TUI Label with Hashtable Source: https://github.com/jdhitsolutions/pstuitools/blob/main/README.md Creates a TUI Label element using a hashtable for properties. This is one method for defining TUI elements. ```powershell $lblUsername = [Terminal.Gui.Label] @{ Text = 'UserName' X = 1 Y = 1 } ``` -------------------------------- ### Prompt for Credentials in TUI Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Get-TuiCredential.md This snippet demonstrates how to invoke Get-TuiCredential without any parameters to initiate a TUI prompt for credentials. The resulting PSCredential object is stored in the $cred variable. ```powershell PS C:\> $cred = Get-TuiCredential ``` -------------------------------- ### Prompt for Specific User Credentials in TUI Source: https://github.com/jdhitsolutions/pstuitools/blob/main/docs/Get-TuiCredential.md This snippet shows how to use Get-TuiCredential with a username parameter to pre-fill the username field in the TUI prompt. The specified username is 'company\artd'. ```powershell PS C:\> $cred = Get-TuiCredential company\artd ``` -------------------------------- ### Define TUI Label with New-Object Source: https://github.com/jdhitsolutions/pstuitools/blob/main/README.md Creates a TUI Label element using the New-Object cmdlet. This is a third acceptable method for defining TUI elements. ```powershell $lblUsername = New-Object Terminal.Gui.Label ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.