Public/Fun/Set-PowerShellWindowTitle.ps1

# Module: Orbit
# Function: Helper
# Author: Francois-Xavier Cat
# Updated: 31-MAY-2021
# Status: Live




function Set-PowerShellWindowTitle {
  <#
    .SYNOPSIS
      Function to set the title of the PowerShell Window
    .DESCRIPTION
      Function to set the title of the PowerShell Window
    .PARAMETER Title
      Specifies the Title of the PowerShell Window
    .EXAMPLE
      Set-PowerShellWindowTitle -Title LazyWinAdmin.com
 
      Sets the Window Title to "LazyWinAdmin.com"
    .NOTES
      Francois-Xavier Cat
      lazywinadmin.com
      @lazywinadmin
    .LINK
      https://github.com/DEberhardt/Orbit/tree/main/docs/Orbit.Tools/Set-PowerShellWindowTitle.md
    .LINK
      https://github.com/DEberhardt/Orbit/tree/main/docs/about/about_Supporting_Functions.md
    .LINK
      https://github.com/DEberhardt/Orbit/tree/main/docs/
  #>

  [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Justification = 'Window title is a miniscule change')]
  [CmdletBinding()]
  PARAM($Title)
  #Show-OrbitFunctionStatus -Level Live
  #Write-Verbose -Message "[PROCESS] $($MyInvocation.MyCommand)"

  try {
    $Host.UI.RawUI.WindowTitle = $Title
  }
  catch {
    $PSCmdlet.ThrowTerminatingError($_)
  }
}