Dialog Form not displaying IP Address information in Label

Ask your 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.
This topic is 4 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
dca2rr
Posts: 11
Last visit: Fri Sep 06, 2019 9:50 am

Re: Dialog Form not displaying IP Address information in Label

Post by dca2rr »

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 2504 times
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Dialog Form not displaying IP Address information in Label

Post by jvierra »

Get-ItemPropertyValue 'hklm:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name ReleaseId
dca2rr
Posts: 11
Last visit: Fri Sep 06, 2019 9:50 am

Re: Dialog Form not displaying IP Address information in Label

Post by dca2rr »

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 2490 times
This topic is 4 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked