Dialog Form not displaying IP Address information in Label

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
dca2rr
Posts: 11
Joined: Thu Aug 15, 2019 9:25 am

Re: Dialog Form not displaying IP Address information in Label

Post by dca2rr » Fri Aug 23, 2019 4:59 am

dca2rr wrote:
Mon Aug 19, 2019 12:29 pm
jvierra wrote:
Mon Aug 19, 2019 12:21 pm
Simple.

$label1.Text = (Get-CimInstance Win32_OperatingSystem).version
That worked perfect! thanks a million man
One more for you 😊

Is there a way to exclude the 169.254 addresses? Also how do I get the actual Windows Version no the build number? Please see the image below


Here is my script


$formComputerSupportInfor_Load = {
#TODO: Initialize Form Controls here
$env:computername
$label1.Text = "$env:COMPUTERNAME"
$label2.Text = 'Your Computer name is:'
$info = Get-NetIPAddress -AddressFamily ipv4
$label3.Text = "$($info.IPAddress)"
$label4.Text = 'IPV4 Information'
$os = (Get-CimInstance Win32_OperatingSystem).version
$label6.Text = (Get-CimInstance Win32_OperatingSystem).version
$label5.Text = 'Your Windows 10 Build is:'

Get-CimInstance

}
$label1_Click = {
#TODO: Place custom script here

}

$label3_Click={
#TODO: Place custom script here

}

Image[/img]img]
Attachments
3.png
3.png (7.97 KiB) Viewed 442 times

User avatar
jvierra
Posts: 13732
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Dialog Form not displaying IP Address information in Label

Post by jvierra » Fri Aug 23, 2019 5:23 am

Get-ItemPropertyValue 'hklm:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name ReleaseId

dca2rr
Posts: 11
Joined: Thu Aug 15, 2019 9:25 am

Re: Dialog Form not displaying IP Address information in Label

Post by dca2rr » Fri Aug 23, 2019 8:15 am

jvierra wrote:
Fri Aug 23, 2019 5:23 am
Get-ItemPropertyValue 'hklm:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name ReleaseId
You are awesome jvierra. How about excluding those IP's?
Attachments
1.gif
1.gif (77.32 KiB) Viewed 428 times

Post Reply