Fonts
Starting with PowerShell 7, the default font size and family have changed and no longer match what was used with previous versions of Windows PowerShell. This is due to changes in the .NET framework used by PowerShell 7. In a ScriptoForm, this font has been changed back to the original font used in Windows PowerShell 5.1 by setting the
Font property of the Form object. This change was done for aesthetic reasons so that text fields continue to conform with the original layout of the default Form.Examples
Section titled “Examples”$FormMain.Font = New-Object -TypeName System.Drawing.Font("MS Sans Serif",8)Some child controls of the form may not inherit this property and will require the value to be set separately at the control level.
References
Section titled “References”Change the default font (What’s new in Windows Forms for .NET 6) | Microsoft Learn