• Latest Version! – PowerShell PC Information Program

    Home » Forums » Developers, developers, developers » DevOps Lounge » Latest Version! – PowerShell PC Information Program

    Author
    Topic
    #503668

    Hey Y’all,

    Tried to reply to this thread but got the older than 91 days msg!

    Here’s the latest build which adds a Write to File button so you can save all the info and kill some trees if you are so inclined. You’ll notice that when you press the button it disappears and the location of the file is displayed on the status line.

    CMsPCInfo-FormVersion.ps1: 42958-CMsPCInfo-FormVersion

    Enjoy! :cheers:

    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!
    Computer Specs

    Viewing 86 reply threads
    Author
    Replies
    • #1542464

      RG, the link is invalid……

      Eliminate spare time: start programming PowerShell

    • #1542508

      Access,

      Thanks! It must have gotten [off-track] when I copied the post to a new thread when it wouldn’t let me post to the old one. I’ve fixed it in the OP.

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1542510

      +1 still ng

      ๐Ÿป

      Just because you don't know where you are going doesn't mean any road will get you there.
    • #1542512

      David,

      I just successfully downloaded it! You might do a refresh of the page. :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1542516

      +1, David you’re just too quick!

      Eliminate spare time: start programming PowerShell

    • #1543062

      got it!:cheers:

      ๐Ÿป

      Just because you don't know where you are going doesn't mean any road will get you there.
    • #1543063

      Can anyone explain this anomaly?

      In both cases below the Storage Tab is highlighted

      PowerShell CMD 64 Bit:
      42985-PSCMDVer

      PowerShell ISE 64 Bit:
      42986-PSISEVer

      It has me baffled why when run in the CMD window the tab is not highlighted but it is when run from the ISE and yes it is the exact same code.

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1543171

        Can anyone explain this anomaly?

        In both cases below the Storage Tab is highlighted

        It has me baffled why when run in the CMD window the tab is not highlighted but it is when run from the ISE and yes it is the exact same code.

        :cheers:

        Man RG you are really delving deep into the mysteries of the Universe! :o:

        :cheers:

        ๐Ÿป

        Just because you don't know where you are going doesn't mean any road will get you there.
    • #1543124

      Couldn’t we have a description of the purpose of this program and for whom it’s intended? And then a proper thread title? I couldn’t even figure it out from the original thread.

    • #1543203

      Bruce,

      Ok. I’ve changed the title on the OP. The program is intended for anyone who wants to know what is in their computer and/or wants to learn a little about PowerShell. Of course you can do the same thing with Speccy or Belarc Advisor, etc. I programmed this as a tool to help me learn PowerShell and keep “improving” it as I learn more.

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1553800

      Ok Y’all,

      The program is now up to version 12.2.

      New Features:

        [*]Reports the Status of Trim for those of you with SSDs.
        [*]Reports the Alignment status of all disk partitions on all attached disks.
        [*]Releases variables as the program progresses to cut down on the memory foot print.

      CMsPCInfo.ps1: 43725-CMsPCInfo

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1557775

      Hey Y’all,

      Ok, we’re up to Version 14.00 now. I’ve added a lot of new information including a Battery tab that will only show up if you have a laptop.

      I’ve also completely reorganized the code as I’ve put the code for each tab into it’s own Function. This wasn’t necessary but It does allow me to take advantage of some of the features of the PowerShell ISE, e.g. code expansion/compression. It’s really neat when you compress a Function by clicking on the – sign next to the function name you can then easily highlight that one line and copy the entire Function w/o having to highlight the thing line by line.

      CMsPCInfo Ver 14.00: 44045-CMsPCInfo

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1562010

      Hey Y’all,

      Version 15 Hot off the keyboard!

      CMsPCInfo.ps1 Ver 15: 44356-CMsPCInfo

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1562131

      RG, I am having trouble running your script. I am running Win 7 Pro x64 SP1 and Powershell claims it is v1.0 (from folder name).

      On first run I got errors about missing “]” on about 5 lines. I examined the code and combined it with the following line to eliminate the error.

      Now it will run to the point of showing your form, but powershell is reporting a ton of runtime errors.

      Is this script supposed to run on this system and version of powershell?

    • #1562133

      JC,

      Sorry but the script requires Win 8.1+.

      It has a check in there so I’m surprised that you’re getting the following error message.
      44368-PCInfoWrongVersion

      That I get when I run it on my Win 7 HP Laptop. BTW 6.3 = Win 8.1!
      Here’s a Windows Version List.

      BTW: The V1.0 in the path name has never changed even though with W10 it’s now at version 5 of PowerShell!

      To find your version type $PSVersionTable in the PS command window.

      Example:

      Code:
      PS> $psversiontable
      
      Name                           Value                                           
      ----                           -----                                           
      PSVersion                      5.0.10586.122                                   
      PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                         
      BuildVersion                   10.0.10586.122                                  
      CLRVersion                     4.0.30319.42000                                 
      WSManStackVersion              3.0                                             
      PSRemotingProtocolVersion      2.3                                             
      SerializationVersion           1.1.0.1   
      

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1562134

      Thanks for the clarification about Win 8.1+

      BTW, my powershell version is

      Code:
      
      Name                           Value
      —-                           —–
      CLRVersion                     2.0.50727.5485
      BuildVersion                   6.1.7601.17514
      PSVersion                      2.0
      WSManStackVersion              2.0
      PSCompatibleVersions           {1.0, 2.0}
      SerializationVersion           1.1.0.1
      PSRemotingProtocolVersion      2.1
      
      
    • #1562135

      JC,

      You might want to upgrade to Version 4.0.

      Here’s the MS Page on doing so.

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1562236

      I upgraded to version 4.0 as you suggested and now I get the Error Popup you described in Post #16 above.

      So I will continue learning on Win 7 with what I have.

    • #1562241

      I have Windows 10 on my Laptop, so I decided to try your script there. It has PowerShell version 5.0.

      It worked like a champ, except there was a pair of (“)’s missing on line 1030. I added them and no errors.

      Great job developing this example.

    • #1562313

      JC,

      Thanks!

      Oddly enough PS doesn’t seem to care about those as it works with or without them and throws no errors either way?
      But, for consistency sake they should be there IMHO thanks.

      I’ve already changed the Error message, per your input, when the program is run on a machine with Windows older than 8.1 so it reports the actual version of the OS, e.g. 7.0 or Vista vs the NT version 6.0 & 6.1 respectively.

      Most of the code does work on Win7 so I may use code to just skip those sections that require a newer Windows version and allow it to run on 7 since it still provides a lot of useful information. Still mulling that one over but will probably do it sooner or later.

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1562439

        I too tried the script on a Win7 system and did receive the “You must be running Windows 6.3 or higher” message. Must admit I did so rather without thinking of the version requirements.

        So I have 2 requests:

        1). I believe it would be valuable to add Win7 support. This is a widely used version, it’s still supported by MS, and so forth. Win7 support makes sense to me anyway;

        2). The versioning messages themselves could be clearer. I recognized what you did as being technically correct. The problem is, even tech people routinely refer to “Windows 7” rather than “Windows version 6.1”. The error messages could therefore use the common names for the various Windows versions, without changing the version checking code. The result would be a better product and my suggestion is to do just that;

        Other than that this is great stuff; keep up the good work!

        • #1562440

          So I have 2 requests:

          1). I believe it would be valuable to add Win7 support. This is a widely used version, it’s still supported by MS, and so forth. Win7 support makes sense to me anyway;

          Working on it!

          2). The versioning messages themselves could be clearer. I recognized what you did as being technically correct. The problem is, even tech people routinely refer to “Windows 7” rather than “Windows version 6.1”. The error messages could therefore use the common names for the various Windows versions, without changing the version checking code. The result would be a better product and my suggestion is to do just that

          Already done see post #21.

          :cheers:

          May the Forces of good computing be with you!

          RG

          PowerShell & VBA Rule!
          Computer Specs

          • #1562605

            I’ve done some research on this interesting help formatting. It’s an interesting notion to combine internal help documentation with an external (user) help interface but I wanted to know how it worked before commenting further.

            Now I’ve learned that the formatting keywords are part of a reserved keyword list and are not self-defining. That defines the capability landscape.

            With that I feel more confident in making a further enhancement request. You see when I read your comments, they are great as far as they go. To me though, they miss some information I’d expect to see. Stuff I routinely put in all my code. Here’s what I’d really like to see added:

            1). Basic author information. Authors get credit, that’s my rule.

            2). An originating date would be nice, though you do have a changelog in there. The changelog can provide that (though if it contained no entries then it could not);

            3). An authoritative source for the code. In the internet age this typically means a URL and a link to this very thread would be appropriate. If you have some other links those would be fine too (personal web pages, Github links, SourceForge, StackOverflow, whatever). This is for new versions, support requests, and anyone who has authentication concerns about the code. Just a suggestion but I note that PowerShell supports a .LINK keyword;

            4). If you want to get fancy, put in a license governing the code. This is a very FOSS-y idea. Might I suggest the MIT license? It basically says you own the code, but anyone can take it and do anything they want with it. They have to provide attribution back to you but that’s it.

            Otherwise, once again, great job.

            • #1562786

              Here’s what I’d really like to see added:

              1). Basic author information. Authors get credit, that’s my rule.

              Not looking for credit. I started this project as a tool to learn Powershell.

              3). An authoritative source for the code. In the internet age this typically means a URL and a link to this very thread would be appropriate. If you have some other links those would be fine too (personal web pages, Github links, SourceForge, StackOverflow, whatever). This is for new versions, support requests, and anyone who has authentication concerns about the code. Just a suggestion but I note that PowerShell supports a .LINK keyword;

              .Link added

              4). If you want to get fancy, put in a license governing the code. This is a very FOSS-y idea. Might I suggest the MIT license? It basically says you own the code, but anyone can take it and do anything they want with it. They have to provide attribution back to you but that’s it.

              Sorry, but I wouldn’t feel right about putting any sort of license on this code as I have been helped tremendously by others here on the Lounge as well as The Scripting Guy Blog and other net sources.

              Per your suggestions:

                [*]The program now supports Win 7 but you MUST have PowerShell Version 4 (free upgrade from MS). Note: the items displayed for Win 7 are not as comprehensive as later versions.
                [*]The error message for Windows version has been changed to reflect normal version numbering (Vista, 7, 8.0, 8.1, 10)
                [*]Added an error message if machine is running Win 7 but not PS version 4.
                [*]

              So here’s Version 16: 44397-CMsPCInfo

              HTH :cheers:

              May the Forces of good computing be with you!

              RG

              PowerShell & VBA Rule!
              Computer Specs

    • #1562800

      Re: “Not looking for credit.”

      OK then, think of it this way. As a user of this program, I want to know “who” wrote it. It could be a person, a corporation, a not for profit entity, or whatever. With this information I have attribution, a possible source for updates and support. It also serves to give credibility to the program in an environment where there is a lot of malware and hostile actors. A ‘threat environment’ to use the security term.

      When the originators of code are willing to be associated with that code it provides reassurance that said code won’t damage the systems we might use it on. It provides reputational reassurance.

      Now at present, I know who wrote it. However I feel compelled to add this information to the program because the program lacks it. And that doesn’t work well in the long run because it’s your code and presumably you may continue updating it. Thus I would have to repeatedly merge my enhanced comments with your material. Or I would have to stop updating the program from you. Or I would have to accept that my comments get overwritten and my code branch dies.

      Instead I chose to go back to the author and get him to add this information. Then the information I’d like to see is part of the main code branch and doesn’t have any of the above problems.

      However you are a volunteer in this situation and I cannot impose upon you.

      • #1562803

        Re: “Not looking for credit.”

        OK then, think of it this way. As a user of this program, I want to know “who” wrote it. It could be a person, a corporation, a not for profit entity, or whatever. With this information I have attribution, a possible source for updates and support. It also serves to give credibility to the program in an environment where there is a lot of malware and hostile actors…

        All good points, methinks. ๐Ÿ™‚

    • #1563293

      Just a thought if you are looking for some privacy and don’t want to reveal your name. Attribution to the Windows Secrets handle “RetiredGeek” would be sufficient.

      A real name is better from the user perspective. However any name is better than none at all. And I would note that in the book authoring community, there is a long and distinguished history of authors writing under a nom de plume. There are all sorts of reasons for choosing to publish this way.

    • #1563304

      B.H.,

      Ok next version will show:

      .NOTES
      Computer Mentors System Information Dialog V16.00
      Programmed by : RetiredGeek @ Windows Secrets Lounge (WSL)
      Code adapted from:
      Powershell PC Info Script V1.0b
      Coded By:Trenton Ivey(kno)
      hackyeah.com
      Incorporated Coding changes recommed by Cafed00d @ WSL
      [/code]

      BTW: Have you tried the changes under Win 7? How did they work for you?

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1563366

      Cool.

      Yeah, I’ve tried running v16, the PS windows flashes on and then closes again. I’m using the ‘Run With PS’ option. Do I have to open PS first and then load the script?

    • #1563382

      B.H.,

      It should work just fine with the Run with PowerShell option. I just tested this in Win 10 Pro & Win 7 HP.

      The flashing of the PS window is normal as the program closes (minimizes) the PS window (should still show in the Taskbar) while it does its thing then it will popup with the information tabbed window.

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1563648

      I believe the original problem was that PS was flashing an error and then closing the window. And I believe the original error was about unsigned code, which I have now allowed.

      Now I’m getting a different error. The message is:

      Add-Member : Cannot add a member with the name “IPv4” because a member with that name already exists. To overwrite the member anyway, add the Force parameter to your command.
      At C:[path…]CMsPCInfo.ps1:946 char:28
      + $AdptrObj | Add-Member @AMArgs
      + ~~~~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidOperation: (@{Index=7; NICN…=10.29.180.
      100}:PSObject) [Add-Member], InvalidOperationException
      + FullyQualifiedErrorId : MemberAlreadyExists,Microsoft.PowerShell.Command
      s.AddMemberCommand

      Do I want to run this with the Force option?

    • #1563657

      B.H.,

      Interesting :confused:

      I don’t get that error on my Dual Boot 64 Bit (Win10/Win7) Laptop using either the PowerShell ISE or the Run With PowerShell option from file explorer. I even tried running it with 32-bit Powershell and it worked as designed.

      Are you running 32 or 64 bit windows 7? Could you post the data from $PSVersionTable?

      BTW: I just noticed where you live! I hope everything is OK with you and your family. I take it that you escaped most of the mayhem as you’re posting here. Take care.

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1563931

        Windows 7 Enterprise, 64-bit. SP1.

        $PSVersionTable:

        Name Value
        —- —–
        PSVersion 4.0
        WSManStackVersion 3.0
        SerializationVersion 1.1.0.1
        CLRVersion 4.0.30319.18444
        BuildVersion 6.3.9600.16406
        PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
        PSRemotingProtocolVersion 2.2

        Thanks for asking on the personal front, yes I am fine. Evacuating was stressful and took a very long time. In those situations you are carried along by events; really you have little control.

    • #1563665

      B.H.,

      Been over the code with fine tooth comb…well I did look! ๐Ÿ˜†

      I found a logic error with the checking for Windows Version and fixed it.
      I also added a feature to detect UEFI firmware on Win 8.0+ machines.
      Fixed some minor formatting issues.

      I tested this on:

        [*]Win 7 HP
        [*]Win 8.1 UEFI/Secure Boot
        [*]Win 10 Pro UEFI/Secure Boot
        [*]Win 10 Home BIOS
        [*]Win 10 Insider Edition latest update BIOS.

      CMsPCInfo Vers 16.10: 44465-CMsPCInfo

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1563955

      B.H.,

      I’m showing CLRVersion 4.0.30319.42000 ?

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1563973

      @RG,

      Here’s mine from Win10 Pro Insider Preview build 14342

      Name Value
      —- —–
      PSVersion 5.1.14342.1000
      PSEdition Desktop
      PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
      CLRVersion 4.0.30319.42000
      BuildVersion 10.0.14342.1000
      WSManStackVersion 3.0
      PSRemotingProtocolVersion 2.3
      SerializationVersion 1.1.0.1

      Depends on the build installed.

      --Joe

    • #1563992

      Joe,

      That’s interesting because I get the SAME CLR version on my Win 7 setup w/PS 4

      PS> $CurOS = Get-CimInstance -Class Win32_OperatingSystem

      PS> $CurOS.Name
      Microsoft Windows 7 Home Premium |C:Windows|DeviceHarddisk0Partition3

      PS> $PSVersionTable

      Name Value
      —- —–
      PSVersion 4.0
      WSManStackVersion 3.0
      SerializationVersion 1.1.0.1
      CLRVersion 4.0.30319.42000
      BuildVersion 6.3.9600.16406
      PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
      PSRemotingProtocolVersion 2.2

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1564949

        RG, having just mange to run this script (incompetence on my part :p), I find that it says my C drive isn’t an SSD – but it is. My problem or yours? I have your latest script.

        Win 10 Pro

        PS C:WINDOWSsystem32> $PSVersionTable

        Name Value
        —- —–
        PSVersion 5.0.10586.122
        PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
        BuildVersion 10.0.10586.122
        CLRVersion 4.0.30319.42000
        WSManStackVersion 3.0
        PSRemotingProtocolVersion 2.3
        SerializationVersion 1.1.0.1

        PS C:WINDOWSsystem32>

        Eliminate spare time: start programming PowerShell

    • #1564962

      Access,

      Most likely mine. There is no direct determination of SSDs I have to glean it from the description provided and if the manufacturer doesn’t include SSD in that description I can’t catch it.

      Code:
      PS> $PhyDiskInfo = Get-Disk  | Where-Object {$_.size -gt 0 } | 
                                   Sort-Object -Property DiskNumber
      
      PS> $PhyDiskInfo.model
      SanDisk SD[COLOR="#0000FF"]SSD[/COLOR]XPS240G
      WDC WD5000HHTZ-04N21V1
      ST1000DM003-1CH162
      

      You can try the two code lines above and see what you get for your machine. I’d be very interested in the response.

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1564963

      Here ye be RG (hey that rhymes!). No mention of the Kingston being an SSD though…

      PS C:WINDOWSsystem32> $PhyDiskInfo = Get-Disk | Where-Object {$_.size -gt 0 } | Sort-Object -Property DiskNumber
      PS C:WINDOWSsystem32> $PhyDiskInfo.model
      KINGSTON SV300S37A240G
      WDC WD20EZRX-22D8PB0
      Elements 107C
      PS C:WINDOWSsystem32>

      Eliminate spare time: start programming PowerShell

    • #1564977

      Access,

      While having my car serviced today I did a little googling on my phone, Love OK Google!, and came across some roundabout ways to determine if you have an SSD. I’ll be giving them a whirl and will get back to your for testing! Yes, believe it or not you did volunteer! :evilgrin:

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1565001

      Access,

      Ok, here’s a new version that incorporates a rather involved function to determining is one of the physical disks is a SSD.

      It works on all 4 of my machines but then so did the other routine. Let me know how it goes for you:

      My Desktop: Win 10 Pro

      Code:
      ---      Storage      ---
      
      Physical Disk Information:
      
      Drive                              Disk Size Parti GPT       Data
       No.  Name                   SSD        / GB tions MBR Boot  Bus 
      ----- -----                  ----  --------- ----- --- ----- ----
        0   SanDisk SDSSDXPS240G   Yes      223.57     5 GPT True  SATA
        1   WDC WD5000HHTZ-04N21V1 No       465.76     2 GPT False SATA
        2   ST1000DM003-1CH162     No       931.51     1 GPT False SATA
        7   2500BEV External       No       232.89     2 MBR False USB 
      
      

      Dell 1564 Laptop: W10 Home

      Code:
      ---      Storage      ---
      
      Physical Disk Information:
      
      Drive                      Disk Size Parti GPT       Data
       No.  Name           SSD        / GB tions MBR Boot  Bus 
      ----- -----          ----  --------- ----- --- ----- ----
        0   M4-CT256M4SSD2 Yes      238.47     5 MBR True  SATA
      

      Dell XPS14z Laptop: Win 10 Insider Ed.

      Code:
      ---      Storage      ---
      
      Physical Disk Information:
      
      Drive                      Disk Size Parti GPT       Data
       No.  Name           SSD        / GB tions MBR Boot  Bus 
      ----- -----          ----  --------- ----- --- ----- ----
        0   M4-CT128M4SSD2 Yes      119.24     5 MBR True  SATA
      

      Dell XPS 137000 Laptop: Win 8.1 Home

      Code:
      ---      Storage      ---
      
      Physical Disk Information:
      
      Drive                                 Disk Size Parti GPT       Data
       No.  Name                      SSD        / GB tions MBR Boot  Bus 
      ----- -----                     ----  --------- ----- --- ----- ----
        0   Samsung SSD 850 EVO 250GB Yes      232.89     7 GPT True  SATA
      

      So test away!

      CMsPCInfo.psv Ver 16.20: 44574-CMsPCInfo

      HTH :cheers:

      [/code]

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1565111

      RG, yup it worked. I have an SSD!

      Chhers

      Pressed Volunteer

      Eliminate spare time: start programming PowerShell

    • #1565116

      Yay!

      Code:
      Physical Disk Information:
      
      Drive                               Disk Size Parti GPT       Data
       No.  Name                    SSD        / GB tions MBR Boot  Bus 
      —– —–                   —-  ——— —– — —– —-
        0   Samsung SSD 850 EVO 1TB Yes      931.51     6 MBR True  SATA
        1   SAMSUNG HD502HJ         No       465.76     6 MBR False SATA
      
      
    • #1565167

      RG, can I ask for one tiny amendment please? A couple of times, I right-click on the script and nothing much appears to happen, so I cancel the PS window because I think I’ve not started the script right. I now know that it takes a short while for the answer to come up, so I need to be patient. Could the script put something up straight away saying words to the effect ‘Working on it, be patient goldfish’.

      Eliminate spare time: start programming PowerShell

    • #1565234

      Access,

      “You Asked for it!” Old TV Show!

      Here’s a zip file with two versions.

      CMsPCInfo-Dev.ps1 uses BalloonTips in the notification area. Problem with this approach is timing as the TimeOut parameter was depreciated in Vista and now relies on system settings (I don’t really understand this but suffice it to say they stay up longer than desired).

      CMsPCInfo-Dev2.ps1 uses Windows Shell Popups. With this method I get less code and I can control the timing! However there is the distraction of an OK button. Doesn’t really affect the functionality as they time out at the interval I specify the OK would just dismiss them sooner.

      Give them a try and let me know which you like better.

      Zip File: 44596-CMsPCInfo-Dev

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1565247

      On my Win10 system I much prefer the notification area tip. It seems to fit in better.

      --Joe

    • #1565248

      Thanks RG, that’s great – like Joe I prefer the notification area tips.

      Eliminate spare time: start programming PowerShell

    • #1566556

      Hey Y’all,

      Ok, here’s version 17 for your testing and comments.

      New in this version.

        [*]Full support for networked (Workgroup) PCs. See this WSL Post for instructions on setting the machines up properly to do this.
        [*]Notification Area Tip that program is running. (does disappear before the main window appears though on faster machines but may linger after main window appears on slower machines.)
        [*]Limited Win 7 HP support:

        [*]The program when run on a Win 7 computer will report that computers information correctly, though not the same as newer windows versions.
        [*]When a Win 7 computer as the Server and using a Win 8.1+ as the Client (computer running this program) it will report the same information as if it were run directly on the Win 7 computer.
        [*]When a Win 7 computer is used as the Client and a Win 8.1+ machine as the Server it will not provide full information!
        [*]

      [*]Win 8.1+ support:

        [*]Full as Client support. (Not tested on 8.0).
        [*]Full as Server support. (Supposedly you need a Pro+ SKU for this to work but it works for me with just Standard Win 8.1 & Win 10 Home!)

        44690-Win10HomeServer
        [*]

      [/LIST]

      Usage:
      To run against local computer just run the program.
      To run against a networked computer add the -CompName parameter ex:
      CMsPCInfo.ps1 -CompName “your computer name here”

      As always you testing and comments are appreciated!

      Zipped Program File: 44688-CMsPCInfo

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1566566

      Tried to run on my Win10 Pro PC with no arguments…

      44691-cmerr

    • #1566570

      Browni,

      Oops My Bad!

      I stripped all the local code to simplify maintenance which means you have to run the setup program in the linked post since at least half the data is gathered via Invoke-Command which requires PS-Remoting to be enabled. I didn’t think about that when I did it after I noticed I didn’t need it, of course I’d run the setup program on my machines! This is exactly why I asked for testers.

      Give it a try and let me know if it fixes the problem. I’m pretty sure it will. If it does I’ll incorporate that setup code into the program for the local machine use.

      Thanks for Testing :clapping:

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1566573

      It worked after running the setup code :bananas:

      44692-cmnoerr

    • #1567101

      I continue to be impressed by this RG!

    • #1567210

      Hey Y’all,

      Ok here’s another iteration version 17.50.

      Changes:

        [*]When you try to use it against a computer that is not in the TrustedHosts list it will add the computer to the list.
        [*]There now are a couple of Balloon Tips to show progress.
        [*]Fixed some bugs where the reporting of Compacted OS in Win 10 was incorrect and also the status of UEFI & Secure boot for win 8.0+ systems. I’ve also fixed it so those two items do NOT show for Win 7 systems.
        [*]When you call the program w/o an argument it will default to the local computer. If you do not like this behavior you can change the $CompName parameter’s Mandatory setting to $True so you will always be prompted for a computer name.
      Code:
      Param (
        [Parameter(Mandatory=[COLOR="#0000FF"]$True[/COLOR])]
          [String] $CompName = "$Env:COMPUTERNAME"
      )
      

      Version 17:50 44720-CMsPCInfo17-50

      Thanks for all who have contributed to the testing. :thewave:


      @BHarder
      , thanks for the kind words.

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1567292

        Hey Y’all,

        Ok here’s another iteration version 17.50.

        :cheers:

        I get

        PS C:Windowssystem32> H:INFOWindows CL and stuffCMsPCInfo17-50CMsPCInfo.ps1
        Missing ] at end of type token.
        At H:INFOWindows CL and stuffCMsPCInfo17-50CMsPCInfo.ps1:629 char:41
        + $citable.rows[$VideoTabStartCnt..$( <<<<
        + CategoryInfo : ParserError: ($VideoTabStartCnt..$(:String) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : EndSquareBracketExpectedAtEndOfType

        ____________________________________________________________________________

        W7 U as admin
        ๐Ÿ™

        ๐Ÿป

        Just because you don't know where you are going doesn't mean any road will get you there.
    • #1567219

      RG,

      Compacted OS status shows as Unknown on my Surface Pro 3 running insider preview build 14361. Results of compact /CompactOS:query command – “The system is in the Compact state. It will remain in this state unless an administrator changes it.”

      --Joe

    • #1567252

      Joe,

      Did you use the latest version?

      It reports correctly on both of my laptops run both Locally & Remotely:

      Laptop w/Win 10 Pro Insider Build 14352 – I’ll upgrade today and recheck.

      Code:
      ---      Windows      ---    
      
      Item                      Value                                                
      ------                    -----                                                
      OS Name                   Microsoft Windows 10 Pro Insider Preview             
         Version                10.0.14352                                           
         Bit-Width              64-bit                                               
         Key                    XXXXX-XXXXX-XXXXX-XXXXX-HCFC6                        
         Registered Owner       Bruce                                                
         Registered Org                                                              
         System Root            C:WINDOWS                                           
         Install Date           05/28/2016 18:29:30                                  
         Date/Time              06/11/2016 10:39:48                                  
         Last Boot              06/10/2016 20:45:37                                  
         Up Time                13:54:11                                             
         OS Compacted           True                                                 
      

      Laptop w/Win 10 Home

      Code:
      ---      Windows      ---    
      
      Item                      Value                                                
      ------                    -----                                                
      OS Name                   Microsoft Windows 10 Home                            
         Version                10.0.10586                                           
         Bit-Width              64-bit                                               
         Key                    XXXXX-XXXXX-XXXXX-XXXXX-MY47H                        
         Registered Owner       Bruce                                                
         Registered Org                                                              
         System Root            C:WINDOWS                                           
         Install Date           11/14/2015 10:26:13                                  
         Date/Time              06/11/2016 10:41:12                                  
         Last Boot              06/11/2016 10:35:38                                  
         Up Time                00:05:34                                             
         OS Compacted           True                                                 
      

      Did you run it local (on the S3) or remote (over the network)?

      Thanks for testing.

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1567267

      HI RG, I have the same problem as Browni, but I’m not sure where the setup code is…:p

      p.s. the error box in Browni’s post has a typo – it should be “as its operating”, rather than “as it’s operating”. The latter actually means “as it is operating”.

      Eliminate spare time: start programming PowerShell

    • #1567279

      Access,

      Here’s the setup code which needs to be run on each remote (server) computer.

      Set-Remote WMI.ps1 44728-Set-Remote-WMI

      Yep We’ve been UPGRADED!

      Code:
      ---      Windows      ---    
      
      Item                      Value                                                
      ------                    -----                                                
      OS Name                   Microsoft Windows 10 Pro Insider Preview             
         Version                10.0.14361                                           
         Bit-Width              64-bit                                               
         Key                    XXXXX-XXXXX-XXXXX-XXXXX-HCFC6                        
         Registered Owner       Bruce                                                
         Registered Org                                                              
         System Root            C:WINDOWS                                           
         Install Date           06/11/2016 11:47:26                                  
         Date/Time              06/11/2016 12:11:54                                  
         Last Boot              06/11/2016 11:41:22                                  
         Up Time                00:30:32                                             
         OS Compacted           Unknown                                              
      

      Off to give blood will investigate when I return.

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1567493

        Off to give blood will investigate when I return.

        OK, just slightly alarmed now! Do you have to sacrifice to the PowerShell gods in order to get the code to work? I know I have often used the phrase “sweating blood” when I’m working hard, but I swear I mean it metaphorically!

        I’ll give a little blood donation a pass, but if they ask for organs you need to draw a line!

        :o:

    • #1567283

      Still “unknown” for me on PC & tablet.

      Check your PMs RG, I pointed out why it was failing on my tablet.

    • #1567295

      RG – I’ve run that script but it’s still giving me the same error message as in Browni’s in #51. I have W10 Pro. So what am I doing wrong? I’ve tried running it in the ISE but it won’t let it run. Running by right clicking and choosing run with powershell, puts up a PS window but shuts it down before I can read much – but I think there’s something about an exception. I wish I wasn’t such a noob about PS:unsure:

      Hope the blood letting went well!

      Eliminate spare time: start programming PowerShell

    • #1567298

      OK, I set execution policy to unrestricted for currentuser and both scripts now work. Now what was it I had to check – oh yes, my OS is not compacted (I’d never heard of this before this thread – you learn something every day!)

      Eliminate spare time: start programming PowerShell

    • #1567300

      Wavy,

      How did you run the file? Did you copy it into powershell or did you uncompress the file and load it into powershell.

      You should not get that from the copy posted unless you accidentally edited the file. I downloaded the zip file and tested that copy on my Win 7 Home system and it has no syntax errors. I tested this both with the PS CMD and PS ISE.

      Please retry and report back.

      Brownie & Wavy,

      Ok, I found the problem I didn’t add the new Insider Version Number to my decode table. I’ve also fixed the Firewall detection code to eliminate the local/remote computer code like I have elsewhere.

      Here’s the next version: 44732-CMsPCInfo-V17-75

      This testing on 4 Machines, 5 OS Versions, both Local and Remote is starting to get to me! :flee:

      Here’s hoping I have the bugs squashed :crossfingers: so I can start to work on some new features. Did I really say that? Must be dizzy from the loss of blood…

      Thanks y’all for testing! :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1567323

      RG,

      My system now shows the correct CompactOS status.

      --Joe

    • #1567677

      RG,

      I’m running build 14366 and now the CompactOS status shows “Unknown”.

      --Joe

    • #1567732

      Joe,

      You need to add it to the table near the end of the code. I’m working on a better subroutine to do the version validation so this will no longer be necessary. Been busy fixing a friends machine that got all fowled up. HTH :cheers:

      Code:
      
      
      $PGMVersion = 17.75   #--- Remember to Update! ----
      
      $WinVersionTable = @{
         "6.1.7601"   = "7.0"
         "6.2.9200"   = "8.0"
         "6.3.9600"   = "8.1"
         "10.0.10586" = "10"
         "10.0.14352" = "10"
         "10.0.14361" = "10"
       [COLOR="#0000FF"]  "10.0.14366" = "10"[/COLOR]
      }  
      

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1567779

      Joe, et al!

      Here’s version 17.80 which fixes the problem of constantly changing version numbers on Win 10. No longer necessary to adjust the table above when a new version comes out in Production or Insider.

      CMsPCInfo V17-80: 44769-CMsPCInfo-V17-80

      Again thanks for testing Joe! :clapping:

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1567786

      Couple of initial observations from my tablet

      1) Still need to run the seperate initialisation code, thought that was going to be integrated?
      2) It finally detects my O/S as compacted :bananas:

      • #1567791

        Couple of initial observations from my tablet

        1) Still need to run the seperate initialisation code, thought that was going to be integrated?
        2) It finally detects my O/S as compacted :bananas:

        Brownie,

        The part of initialization for adding the Server Machines to the Trusted Hosts list is integrated into the base code. However, the enabling of PowerShell Remoting MUST be accomplished on each machine to be contacted…If you can’t remote to a machine how can you talk to it?

        HTH :cheers:

        May the Forces of good computing be with you!

        RG

        PowerShell & VBA Rule!
        Computer Specs

        • #1567793

          Brownie,

          The part of initialization for adding the Server Machines to the Trusted Hosts list is integrated into the base code. However, the enabling of PowerShell Remoting MUST be accomplished on each machine to be contacted…If you can’t remote to a machine how can you talk to it?

          HTH :cheers:

          I thought it would run stand alone?

          • #1567798

            I thought it would run stand alone?

            OOPS! When I removed the code for the local machine and did it all by Invoke-Command I forgot that it would require the Local Machine to have Remoting Enabled to work. As I’d set my Development machine to that state while testing the code to do such I’d forgotten that is how the environment was setup.

            Back to the drawing board to test to see if the Server Machine and the Client Machine (Local) are one and the same and then check to see if Remoting is enabled. Stay Tuned… Same Bat Time , Same Bat Channel! 44771-Batmobile ๐Ÿ˜†

            :cheers:

            May the Forces of good computing be with you!

            RG

            PowerShell & VBA Rule!
            Computer Specs

    • #1567790

      Ok for me now. Thanks RG.

      --Joe

    • #1567819

      Browni,

      Thanks for Testing! :clapping:

      Ok, here’s a revised version that will check the local machine (if it is the one being queried) to see if PSRemoting is enabled and it will Enable it if need be. Note it does not turn on any services or create firewall rules like those needed on server (remote) machines.

      I tried to make sure I had everything turned off that the setup program (used on server machines) turned on and it tested out OK. YMMV but I hope NOT!

      CMsPCInfo V17-85.zip: 44774-CMsPCInfo-V17-85

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1567848

      Different error this time

      44778-newerror

      Ian-W10 is the name of the PC where it was ran.

    • #1567855

      Browni,

      I just discovered that if the WinRM service is not running, and it has to be running early in the program, you get a message to start it. This works but I’m working on a fix to start it automatically, of course that requires Admin Privileges so I have a bit of checking and logic to rearrange at the start of the program.

      Two questions:

        [*]Were you running PowerShell as Admin?
        [*]Did you try it after running the setup program?

      Thanks again for testing. :thewave:

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1568168

      Hey Y’all,

      Ok we’re back after a heap load of bug busting and feature adding we’re up to version 18.10!

      New Features:
      [List]
      [*]Should work on local machine w/o running setup? Testers Please!
      [*]Will now accept an array of computer names and work through the list.
      [*]Addition of a Quiet switch which will suppress screen output directly writing the information to files in your documents directory. Sending error messages to a .log file also in your documents folder. This does not include Terminating Messages when the Local Computer (Client) is checked for suitability.
      [*]Addition of a ClearLog switch to clear the log before processing the computer list.
      [*]Errors written to the .log file are date/time stampped. Sample file:

      Code:
      06/20/16 18:16:05 A Computer named: bruceslt1564 can not be found on this network.
      
      Please make sure the machine is powered up,  the name is spelled correctly and try again.
      
      
      06/20/16 18:16:05 A Computer named: NonExistComp can not be found on this network.
      
      Please make sure the machine is powered up,  the name is spelled correctly and try again.
      
      
      06/20/16 18:16:05 A Computer named: Dellxps1800 can not be found on this network.
      
      Please make sure the machine is powered up,  the name is spelled correctly and try again.
      

      [*]Lots of code streamlining and new tricks for those who are interest in the internals.
      [*]Updated comment based help section.
      Use: get-help d:pathCMsPCInfo.ps1 -full
      [/List]

      Known Issues:
      [List]
      [*]Network Adapter speed settings are messed up and I can’t find the reason AFAICT the Get-NetAdapter CMDLET does not report the correct information. It seems to report the first speed found for all adapters on the same card, e.g. my main computer reports a Giga-Bit speed for the Wi-Fi and I DON’T THINK SO!
      [*]Does not find the USB 3.0 Giga-Bit ethernet adapter on my Wife’s laptop.
      [/List]
      CMsPCInfoV18.10 Zip File: 44800-CMsPCInfoV18-10

      The Zip also contains the Setup-file for machines to be accessed remotely. You may also need it on a local machine but I hope not! In any case it only needs to be run ONCE per machine.

      I’ve tested it, as both Client & Server, against Win10 Pro, Win10 Pro Insider, Win 8.1, and Win 7 HP (Note: Win 7 machines do not produce as detailed output as win 8+ machines!).

      Have at it guys!

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1568201

      Here you go!

      Windows 10 Pro Insider 14637 running locally w/o setup

      Hardware tab says secure boot UEFI off when it’s on

      Video tab doesn’t show any adaptors (I’ve got 2!)

      Network tab Wifi shows correct speed for me

      Everything else looks OK!

      • #1568205

        Browni,

        Windows 10 Pro Insider 14637 running locally w/o setup YEAH!

        Hardware tab says secure boot UEFI off when it’s on
        Got me stumped there! Works on both Win 8.1 Machine & Win 10 With UEFI/Secure Boot here and properly reports on two non BIOS machines?

        Video tab doesn’t show any adaptors (I’ve got 2!)
        Don’t have a dual display adapter machine to test on. Could you run the following code and let me know what you get?

        Code:
          $WMIArgs = @{Class = 'Win32_VideoController'
                       ComputerName = $env:COMPUTERNAME}
          $Video = Get-WmiObject @WMIArgs
          $Video.Name  #This should list the names of your adapters.
          $Video.Count  #This should cause error but just checking!
        

        Thanks for Testing! :thewave:

        :cheers:

        May the Forces of good computing be with you!

        RG

        PowerShell & VBA Rule!
        Computer Specs

    • #1568221

      voila!

      Code:
      Windows PowerShell
      Copyright (C) 2016 Microsoft Corporation. All rights reserved.
      
      PS C:WINDOWSsystem32> $WMIArgs = @{Class = ‘Win32_VideoController’
      >>                ComputerName = $env:COMPUTERNAME}
      PS C:WINDOWSsystem32>   $Video = Get-WmiObject @WMIArgs
      PS C:WINDOWSsystem32>   $Video.Name  #This should list the names of your adapters.
      AMD Radeon(TM) R7 Graphics
      AMD Radeon R7 Graphics + R7 200 Dual Graphics
      PS C:WINDOWSsystem32>   $Video.Count  #This should cause error but just checking!
      2
      PS C:WINDOWSsystem32>
    • #1568250

      Browni,

      Thanks!

      Here’s a version that I hope will work (it does on my single video card machines so hopefully it will pickup your 2nd card).
      Program Zip: 44806-CMsPCInfo-MultiMachine-Dev

      Try the following code and let me know what it returns:

      Code:
      Function Get-BiosType {
      
      
      
      [OutputType([UInt32])]
      Param(
         [Parameter(Mandatory=$True)]
           [String] $CompName)
      
       If ($LocalMachine) {
           
         $ATArgs = @{Language       = 'CSharp'
                     ErrorAction    = 'SilentlyContinue' 
                     TypeDefinition = @'
            
          using System;
          using System.Runtime.InteropServices;
      
          public class FirmwareType
          {
           [DllImport("kernel32.dll")]
           static extern bool GetFirmwareType(ref uint FirmwareType);
      
           public static uint GetFirmwareType()
           {
               uint firmwaretype = 0;
               if (GetFirmwareType(ref firmwaretype))
                   return firmwaretype;
               else
                   return 0;   // API call failed, just return 'unknown'
           }
          }
      '@
          } #End $ATArgs
      
          $ErrorActionPreference = 'Stop'
          Try {
            If (-not [System.Management.Automation.PSTypeName][FirmwareType]) {
            }
          }
          Catch {  #Type does not Exist Create it!
            Add-Type @ATArgs
          }
          $ErrorActionPreference = 'SilentlyContinue'
      
          [FirmwareType]::GetFirmwareType()
        }
        Else {
            $ICArgs = @{ComputerName = "$CompName"
                        ScriptBlock  = {
             Add-Type -Language CSharp -TypeDefinition @'
         
             using System;
             using System.Runtime.InteropServices;
         
             public class FirmwareType
             {
                 [DllImport("kernel32.dll")]
                 static extern bool GetFirmwareType(ref uint FirmwareType);
         
                 public static uint GetFirmwareType()
                 {
                     uint firmwaretype = 0;
                     if (GetFirmwareType(ref firmwaretype))
                         return firmwaretype;
                     else
                         return 0;   // API call failed, just return 'unknown'
                 }
             }
      '@
             [FirmwareType]::GetFirmwareType()
         
         }}  #End $ICArgs
         
          Invoke-Command @ICArgs
      
       } #End Else
      
      }  #End  ---------------Function Get-BIOSTYPE ----------------
      
      $CompName = $env:COMPUTERNAME
      $LocalMachine = $CompName
      Get-BiosType
      

      Load the above into the Powershell ISE for easier execution than the CMD line version.

      Once again thanks for testing! :clapping: :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1568255

      Graphics cards are now recognised :clapping: and the code returns 2.

      hth

    • #1568257

      Browni,

      Gald the graphic card are showing up correctly.

      If you are getting a return code of 2 the program should show that you have UEFI (see the comments in the function). I’m not sure why it is not in your case. Could you post a screen shot of the Hardware Tab or use the write to file button and then post the hardware section (preferable).

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1568261

      It does show UEFI, it’s picking up the secure boot status wrongly!

      Code:
      Computer Mentors System Information – Version 18.15
      
      —     Hardware      —    
      
      Item                 Value                                                     
      ——               —–                                                     
      Manufacturer         System manufacturer                                       
      Model                System Product Name                                       
      System Type          x64-based PC                                              
      Enclosure            Desktop                                                   
                                                                                     
      BIOS Serial No       System Serial Number                                      
           Name            2903                                                      
           Version         2903                                                      
           Date            20160310                                                  
           Manufacturer    American Megatrends Inc.                                  
           Creator         American Megatrends                                       
                                                                                     
      Firmware Type        UEFI                                                      
      Secure Boot UEFI     OFF                                                       
                                                                                     
      Processor Name       AMD A10-7890K Radeon R7, 12 Compute Cores 4C+8G           
        Info               AMD64 Family 21 Model 56 Stepping 1                       
        Maker              AuthenticAMD                                              
        ID                 178BFBFF00630F81                                          
        Physical Cores     2                                                         
        Logical  Cores     4                                                         
        Address Width      64                                                        
        HyperThreading     Enabled                                                   
        VM Firmware        Enabled                                                   
      
      
      Memory Information:
      
       MB       Bank        Data  Size                            
      Slot Bank Pos  Speed Width  / GB Manufacturer     Serial No.
      —- —- —- —– —– —– ————-    ———-
      _A1  1…  0    1600    64  8.00 A1_Manufacturer1 A1_SerNum1
      _B1  1…  0    1600    64  8.00 Kingston         0E39F34B  
      
    • #1568267

      Browni,

      Try this code snippit:

      Code:
             $ICArgs = @{ComputerName = "DellXPS14z"
                          ScriptBlock = 
                 {Confirm-SecureBootUEFI -ErrorAction "SilentlyContinue"}}
             $UEFISB = Invoke-Command @ICArgs
             "$UEFISB"
      

      Thanks! :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1568269

      After changing the computer name it returned true!

    • #1568272

      Browni,

      Sorry about that! ๐Ÿ˜†

      Well that is what it should return! And it should show that Secure Boot is Enabled. You’ll see in the direct copy of the code from the program that the only way to get an “OFF” value would be for $UEFISB to = False!

      Code:
          If ($FT -eq 'UEFI') {
            If ($AdminPriv) {
              $ICArgs = @{ComputerName = "$CompName"
                          ScriptBlock = 
                 {Confirm-SecureBootUEFI -ErrorAction "SilentlyContinue"}}
              $UEFISB = Invoke-Command @ICArgs
          
              If (Test-Path variable:UEFISB ){
              [COLOR="#0000FF"]  If ($UEFISB) {$UEFIStatus="On"} Else {$UEFIStatus="OFF"}[/COLOR]
                Add-Row -ARIN 'Secure Boot UEFI'  -ARIV $UEFIStatus
              }
              Else {
                   Add-Row -ARIN 'Secure Boot UEFI' -ARIV "Not Supported"
              }
            }   #End If ($AdminPriv)
          
            Else {
                   $ARArgs = @{ARIN = 'Secure Boot UEFI' 
                               ARIV = "Requires Admin Access to verify!"}
                   Add-Row @ARArgs
            } 
      
          } #End If ($FT -eq 'UEFI')
      

      I don’t know how to debug that one with out being at your machine and running the debugger. Sorry.

      Maybe one of the PS Gurus will see something I’m missing and pipe in….please!

      Thanks again for testing! :thewave: :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1568273

      I’ve just ran it again and…

      44814-uefiw10

      :confused:

    • #1568277

      Browni,

      Cue the music from the Twilight Zone!

      Here’s Version 18-15 for the rest of you: 44818-CMsPCInfoV18-15

      BTW: How’d you get all those funky values in the screen shot?

      Thanks again! :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1568285

      Funky values?

      I just used the snipping tool to grab a window screenshot.

    • #1568288

      Browni,

      Yeah, things like System Manufacturer and System Product Name?

      I get things like: Dell Inc. and Inspiron 7348 respectively.

      BTW: Isn’t it time for you to get your Beauty Sleep being on the other side of the pond and all?

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1568291

      Ah, I see what you mean.

      I think it’s like that because it’s a home build. The mobo was bought from ebuyer.com here in the UK.

      As for my beauty sleep, I’m already in bed listening to local radio!

    • #1572056

      Hey Y’all,

      Ok another version. Version 20 has been completely reworked using CimInstance (replacing WMIObject) calls and a CimSession. This change results in a 50% savings in runtime! This also cleaned up some of the logic in the process. Live and learn.

      My Timing Data:

      Code:
      Non-CS
      
      Days              : 0
      Hours             : 0
      Minutes           : 1
      Seconds           : 8
      Milliseconds      : 84
      Ticks             : 680847183
      TotalDays         : 0.000788017572916667
      TotalHours        : 0.01891242175
      TotalMinutes      : 1.134745305
      TotalSeconds      : 68.0847183
      TotalMilliseconds : 68084.7183
      
      CimSession
      
      Days              : 0
      Hours             : 0
      Minutes           : 1
      Seconds           : 29
      Milliseconds      : 119
      Ticks             : 891196174
      TotalDays         : 0.00103147705324074
      TotalHours        : 0.0247554492777778
      TotalMinutes      : 1.48532695666667
      TotalSeconds      : 89.1196174
      TotalMilliseconds : 89119.6174
      

      Code used to test:

      Code:
      $Start1 = Date
      .CMsPCInfo-MultiMachine-Dev.ps1 -Quiet -ClearLog -AutoList
      $End = Date
      "Non-CS"              >> "G:BEKDocsTimingData.txt"
      $End.Subtract($Start1) >> "G:BEKDocsTimingData.txt"
      
      $Start2 = Date
      .CMsPCInfo-MultiMachine-CSDev.ps1 -Quiet -AutoLIst
      $End = Date
      "CimSession"          >> "G:BEKDocsTimingData.txt"
      $End.Subtract($Start2) >> "G:BEKDocsTimingData.txt"
      

      Strangely there were some WMIObject calls I couldn’t find an associated CimInstance Class for to make the call.

      CMsPCInfo V-20: 45103-CMsPCInfoV20-00

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1572058
      Code:
      Non-CS
      
      
      Days              : 0
      Hours             : 0
      Minutes           : 0
      Seconds           : 20
      Milliseconds      : 201
      Ticks             : 202014132
      TotalDays         : 0.000233812652777778
      TotalHours        : 0.00561150366666667
      TotalMinutes      : 0.33669022
      TotalSeconds      : 20.2014132
      TotalMilliseconds : 20201.4132
      
      CimSession
      
      
      Days              : 0
      Hours             : 0
      Minutes           : 0
      Seconds           : 11
      Milliseconds      : 348
      Ticks             : 113481512
      TotalDays         : 0.000131344342592593
      TotalHours        : 0.00315226422222222
      TotalMinutes      : 0.189135853333333
      TotalSeconds      : 11.3481512
      TotalMilliseconds : 11348.1512

      Code used:

      Code:
      $Start1 = Date
      .CMsPCInfo.ps1 -Quiet -ClearLog -AutoList
      $End = Date
      “Non-CS”              >> “d:downloadsrg.txt”
      $End.Subtract($Start1) >> “d:downloadsrg.txt”
      
      $Start2 = Date
      .CMsPCInfo.ps1 -Quiet -AutoLIst
      $End = Date
      “CimSession”          >> “d:downloadsrg.txt”
      $End.Subtract($Start2) >> “d:downloadsrg.txt”
    • #1572059

      Browni,

      So what versions did you use to get those results? The first one looks right but the second one sure doesn’t. :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1572060

      I’ve edited my post, does it look any better now?

    • #1572061

      Browni,

      You’re running the same version in both runs. The idea was to run an old version (using WMI calls) and a new version (using CimInstance calls). I surely can’t understand why the 2nd run would be slower using the same version?

      How many computers are in your network? (-AutoList gets them all)

      Were you doing anything else while the second one was running?

      Thanks for testing! :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1572293

        I may as well chime in here: I am confused by your post #93 which shows the Non-CS vn taking 68s, and the CimSession vn taking 89, but which you report as a 50% saving?

        Secondly, Browni shows 20s and 11s resrectively, which is the decrease we were expecting, but you are surprised by it? What is more odd, he apparently ran the same (unindentified) vn each time!

        I have just tried several vns, made tricky by not knowing which are which once unzipped. With the following script

        Code:
        # 29/7/16 copied from Windows secrets by MNG to test Retiredgeek scripts
        $Start = Date
        .CMsPCInfo-v18.ps1 -Quiet -ClearLog
        $End = Date
        $out = “v18: “+($end-$start).totalseconds+” s”
        $out >> “compare.txt”
        $Start = Date
        .CMsPCInfo-v20.ps1 -Quiet
        $End = Date
        $out = “v20: “+($end-$start).totalseconds+” s”
        $out >> “compare.txt”
        

        I get this:
        v18: 17.3076216 s
        v20: 9.9088774 s

        which is a reduction in time, but I am not sure if the code has run, as the -quiet switch leaves me in the dark. Should I be seeing the summary at the end?

        To further complicate it, when run ‘stand alone’ I haven’t got a results screen since v15 – vns 18 & 20 which I have tried produce this error: 45119-comp-error where ACER-W10TP is the local machine! I turned off the Autolist parameter to try to prevent network computer detection, to no avail. The script appears to find the locale machine, then look for it on the network & fail. So I’m afraid my v18 & 20 results are almost certainly meaningless. What’s the easiest way to restrict the script to the LM only?

        I’d like to help you develop this if I can do so. Thanks for all the efforts so far, which have inspired me to learn a bit about Powershell myself (not that MS make it easy).

    • #1572309

      Ok twice I’ve lost the content of this post so I’m just going to give the short version.

      Here’s a zip with all the files needed to test with the exception of the testing file posted below: 45123-CMsPCInfoTestBundle

      Simplified testing file:

      Code:
      
      $Start1 = Date
      .CMsPCInfoCMsPCInfoV18-70.ps1 -Quiet -ClearLog -AutoList
      $End = Date
      $ET1 = ($End.Subtract($Start1)).TotalSeconds
      "Non-CS:     $ET1 Seconds Elapsed" >> "G:BEKDocsTimingData.txt"
      
      $Start2 = Date
      .CMSPCInfoCMsPCInfoV20-00.ps1 -Quiet -AutoLIst
      $End = Date
      $ET2 = ($End.Subtract($Start2)).TotalSeconds
      "CimSession: $ET2 Seconds Elapsed"  >> "G:BEKDocsTimingData.txt"
      NotePad "G:BEKDocsTimingData.txt"
      

      Note: Don’t forget to adjust the path in the above script, the file names are the ones in the .zip file. Also don’t forget to run the setup program on ALL machines, also found in the .zip.

      Sample run using 4 machines on lan:

      Code:
      Non-CS:     117.055109 Seconds Elapsed
      CimSession: 65.3566563 Seconds Elapsed
      

      Check out the help file for what the switches do!

      Learning resourceMS Virtual Academy.

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1572311

      Running the setup file gives this

      45124-rg

      Set-WSManQuickConfig : WinRM firewall exception will not work since one of the network
      connection types on this machine is set to Public. Change the network connection type to either Domain or Private and
      try again.
      At line:116 char:17
      + Set-WSManQuickConfig -force
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidOperation: (:) [Set-WSManQuickConfig], InvalidOperationException
      + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.SetWSManQuickConfigCommand

      What are you trying to do to my firewall?

    • #1572316

      Browni,

      Are you using something other than Windows Firewall?

      From what I read for Remoting to work properly there needs to be a rule in the firewall to allow it through and that is what the code does. I haven’t had a problem with it before. Of course as the message said one of your networks is marked Public, and why would that be?

      Does CMsPCInfo program run even with that error in setup?

      Thanks for testing. :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1572540

        OK, the results are in (but you’re not going to like them!):
        -quiet noisy (not quiet)
        v18: 18.6 21.0 sec
        v20: 29.2 26.8 sec

        The RPC server error was fixed once I ran the ‘setup’ script, but the Get-NetworkComputers call never returned a result, so I had to suppress that error by commenting out the ‘continue’ statement. I don’t know what this check is/was for, or why you felt the need to prevent further processing after the error, because other stuff worked. I am attaching (if I remember) my v20 output file for your interest (?). Note that v18 shows all 3 of the drives in my PC as SSDs (with zero rotation speed), but v20 shows none as SSD (in fact, drive 0 is an SSD). I guess that stuff is hard to make work for unknown PCs. Otherwise I can’t immediately see anything else that is wrong.

        I must congratulate you for persevering with Powershell – it seems an inordinately awkward scripting engine to use:
        * the view of variables after a break is atrocious (mostly doesn’t work) – but I eventually discovered one can type them at the command line
        * the ISE window hides when a script is launched, but doesn’t restore when a break-pt is reached
        * Error messages in the command window are a horrid, unreadable red on black (perhaps I can change that)
        * No obvious way to set script command line parameters
        * No obvious distinction between in-built commands and user functions (both in blue)
        * F11 to single step? What happened to F8 (since Quick Basic in the 80’s)
        * etc etc

        Hopefully the poor results with the CimSession vn (20) are down to my 10-year old hardware. Keep up the good work!

        • #1572752

          the Get-NetworkComputers call never returned a result, so I had to suppress that error by commenting out the ‘continue’ statement. [/Quote]

          Which Continue statement would that be I sure can’t find one related to that.

          Note that v18 shows all 3 of the drives in my PC as SSDs (with zero rotation speed), but v20 shows none as SSD (in fact, drive 0 is an SSD). I guess that stuff is hard to make work for unknown PCs.

          Just what brands are your drives. The results you posted looked “strange”.

          Powershell – it seems an inordinately awkward scripting engine to use:
          * the view of variables after a break is atrocious – did you try just floating the cursor over the variable in the code?
          * the ISE window hides when a script is launched – My code does that it isn’t PS’s fault!
          * Error messages in the command window are a horrid, unreadable red on black (perhaps I can change that) – Yes it can be changed in your profile.

          Code:
          $colors = $host.PrivateData
          $colors.VerboseForegroundColor = "white"
          $colors.VerboseBackgroundColor = "blue"
          $colors.WarningForegroundColor = "red"
          $colors.WarningBackgroundColor = "white"
          $colors.ErrorForegroundColor = "white"
          $colors.ErrorBackgroundColor = "red"
          

          * No obvious way to set script command line parameters – Just type the – and it gives you a list.
          * No obvious distinction between in-built commands and user functions (both in blue) - that’s because they are all cmd-lets.
          * F11 to single step? What happened to F8 (since Quick Basic in the 80’s) – Agreed that is really funky and I get confused all the time since I do a lot of VBA where F8 rules!

          Thanks for testing! :clapping:
          :cheers:

          May the Forces of good computing be with you!

          RG

          PowerShell & VBA Rule!
          Computer Specs

          • #1572777

            Which Continue statement would that be I sure can’t find one related to that.

            Well, in v18 from line 3195 (I think, I’m looking at it in PFE with line numbers shown):

            Code:
              If (-Not((Get-NetworkComputers) -contains “$CompName”)) {
                $Message = “A Computer named: $CompName ” +
                           “can not be found on this network.`n`n” + 
                           “Please make sure the machine is powered up, ” +
                           ” the name is spelled correctly and try again.”
                If ($IsQuiet) {
                  “$(Get-Date -f “MM/dd/yy HH:mm:ss”)” +
                  ” $Message`n`n” >> “$StatusFile”
                }
                Else { & $InfoMsg } 
                Continue     #Move to next computer in list!     
              }
            

            Just what brands are your drives. The results you posted looked “strange”.

            From Speccy (to save my typing it all by hand):[INDENT]233GB Crucial CT250BX100SSD1 (SSD)
            932GB Seagate ST1000DM003-1ER162 (SATA)
            149GB Seagate ST3160815AS (SATA)

            [/INDENT]

            (Quotes getting too tricky here)
            Powershell – it seems an inordinately awkward scripting engine to use:
            * the view of variables after a break is atrocious – did you try just floating the cursor over the variable in the code? Oh yes – and sometimes something pops up, but not often, certainly not always. Very flaky
            * the ISE window hides when a script is launched – My code does that it isn’t PS’s fault! OK
            * Error messages in the command window are a horrid, unreadable red on black (perhaps I can change that) – Yes it can be changed in your profile. Thanks – will try.
            * No obvious way to set script command line parameters – Just type the – and it gives you a list. I was running with the little green arrow from within the ISE (or with F5). I could run from the command line, I suppose – I guess I have to then type the file name?
            * No obvious distinction between in-built commands and user functions (both in blue) - that’s because they are all cmd-lets. Understood (now) but its a steep learning curve…
            * F11 to single step? What happened to F8 (since Quick Basic in the 80’s) – Agreed that is really funky and I get confused all the time since I do a lot of VBA where F8 rules!

            Carry on the good work!

    • #1572784

      Sorry I missed this one!

      Code:
        Try {
           $GCIArgs = @{Computer    = "$CompName"
                        ClassName   = 'Win32_OperatingSystem'
                        ErrorAction = 'Stop'}
          $ServerOS = Get-CimInstance @GCIArgs
        }
        Catch  {
          $Message = 
            "Sorry the Target: $CompName (Server)`n" +
            "can NOT be contacted via RPC Server`n`n" + 
            "The program requires the Target: $CompName (Server)`n" +
            "be running Windows 7+ and PRO or better " +
            "SKU as it's operating system.`n`nYou must"+
            " also have both the Target: $CompName (Server)`n" +
            "and this machine: $Env:COMPUTERNAME (Client)`n" +
            "properly configured for PowerShell Remoting!"
          If ($IsQuiet) {
            "$(Get-Date -f "MM/dd/yy HH:mm:ss")" + 
            " $Message`n`n" >> "$StatusFile"
          }
          Else { & $InfoMsg }
      
          Continue     #Move to next computer in list!
        }
      

      That error trap is to catch misspelled computer names and/or ones that don’t have remoting setup.

      The Continue is to move on to the Next Computer in the list, of course if you’re doing only one computer then it will just wind up exiting the loop.

      The only effect commenting it out would have would be to stop the program there.

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1572785

        The only effect commenting it out would have would be to stop the program there.

        Well, I think it will just continue as if the error had not occurred (but I’m on XP at the mo so can’t test it), but that really was the point of my original observation: just because a computer can’t be seen on a network, or communicate via RPC, why would one want to abandon the process? By commenting out the ‘continue’, I get to see the program output, which is what i am after. The errors may mean some info is lost, but the rest is still usefull.

        As it is, I can’t see what is added to the output when the RPC error check succeeds: a Computer Information Table is created, but I have never seen where (or whether) this appears in the output screen.

    Viewing 86 reply threads
    Reply To: Reply #1567848 in Latest Version! – PowerShell PC Information Program

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel