My first question here, sorry if something is wrong in the way I posted.
Well, I'm new in developing graphic things in Powershell, and I needed to make a simple script to configure hostname, IP, etc and make it simple to end users (ugh).
I'm developing a simple graphic interface in PowerGUI, I'm on it for a couple of days, testing it exclusively inside PowerGUI, and it was not looking bad, but when I finally ran the script outside PowerGUI, just running it in Powershell, the graphics looks quite different than in PowerGUI, like positioning, borders, themes, etc. I was disappointing. I'll post screenshots and a bit of the code.
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
Get-Variable -Exclude PWD,*Preference | Remove-Variable -EA 0
ipconfig -all | Out-File $env:SYSTEMDRIVE"\old_network.txt"
#INICIO Fontes da aplicação
$font = New-Object System.Drawing.Font("Segoe UI",8.5,[System.Drawing.FontStyle]::Regular)
$font_btn_concluir = New-Object System.Drawing.Font("Segoe UI",15,[System.Drawing.FontStyle]::Regular)
$font_l_instru = New-Object System.Drawing.Font("Segoe UI",12,[System.Drawing.FontStyle]::Regular)
$font_i_n_sala = New-Object System.Drawing.Font("Segoe UI",20,[System.Drawing.FontStyle]::Regular)
#FIM Fontes da aplicação
$form = New-Object Windows.Forms.Form
$form.Size = New-Object Drawing.Size @(800,600)
$form.StartPosition = "CenterScreen"
$form.Font = $font
#$form.ControlBox = $false
$form.MaximizeBox = $false
$form.MinimizeBox = $false
$form.Text = "Configuração Telesalas - UNIASSELVI"
$form.Icon = $icon
$form.FormBorderStyle = "FixedDialog
So, anyone have any clue why this happens?
Its Because of the version of your forms. powergui automatically call v4.0** form my system but powershell consol calls v2. you can test it by yourself after compiling check the consols.