• Powershell

    Author
    Topic
    #2545297

    A couple of issues here.

    I was looking for where to post and in the parts of the forum I was in it said, if you don’t know where to post, post in ‘questions’ My first question is where is Questions?

    My second is I always seem to have problems with power shell. On my newer computer I updated a few months ago to 7.3.2 but I am missing the nice interface option and can only find the terminal option. Where is it?? And I thought I still had the older version but do not see it. What the heck is going on??

    I tried to run the script from another thread

    $GCIArgs = @{NameSpace = "root\cimv2\security\microsofttpm"
    Class = "Win32_tpm"
    }
    
    Get-CIMInstance @GCIArgs |
    Select SpecVersion, IsEnabled_InitialValue,
    IsActivated_InitialValue, ManufacturerVersionInfo |
    FL

    but get errors. Arrg indeed!

    🍻

    Just because you don't know where you are going doesn't mean any road will get you there.
    Viewing 10 reply threads
    Author
    Replies
    • #2545308

      https://www.askwoody.com/forums/forum/askwoody-central/ Generally speaking that’s the place to start with the basics.

      Are you running with admin rights on that powershell?

      Susan Bradley Patch Lady

    • #2545352

      I am missing the nice interface option and can only find the terminal option. Where is it??

      Do you mean the (deprecated) PowerShell ISE?

      ps_ISE_Admin

      That works with PowerShell 5.1 and older but not PowerShell 6 and upwards. Microsoft advice is to use Visual Studio Code with PowerShell extensions.

      $GCIArgs = @{NameSpace = “root\cimv2\security\microsofttpm” Class = “Win32_tpm” } Get-CIMInstance @GCIArgs | Select SpecVersion, IsEnabled_InitialValue, IsActivated_InitialValue, ManufacturerVersionInfo | FL

      In an elevated PowerShell console the first error you will get is about the unknown token named Class. Use ClassName.

      Try this for a simpler one-liner to get the specific information you were looking for:

      Get-CimInstance -Namespace 'root/cimv2/Security/MicrosoftTpm' -ClassName 'Win32_TPM' | Select SpecVersion, IsEnabled_InitialValue, IsActivated_InitialValue, ManufacturerVersionInfo | FL

      Note: I’ve only tested this using Win 10’s built-in PowerShell 5.1:

      ps_tpm

      To see all the available methods, use this:

      (Get-CimInstance -Namespace root/cimv2/Security/MicrosoftTpm -ClassName Win32_Tpm).CimClass.CimClassMethods

      ps_get-tpm_methods

      I just use Get-TPM if all I want to know is whether TPM is activated:

      ps_get-tpm

      PowerShell 7.x installs alongside Windows 10’s built-in PowerShell 5.1. Use $PSVersionTable to see whether 5.1 is available to you:

      ps_versiontable

      This is immediately after I installed PowerShell 7.3.3, showing PowerShell 5.1 is still available.

      Hope this helps…

      1 user thanked author for this post.
    • #2545358

      Wavy,

      Rick has posted some good info!

      My only addition would be for the common WINDOWS user just keep using Powershell_ISE.exe to get the Integrated Environment. You can also use PowerShell.exe which will just give your the command environment, useful when running already developed and debugged scripts. This is a WINDOWS ONLY version

      Stay away from Power Shell Core 6+ unless you need the specific features it provides.
      Mostly this is for professionals (Network Admins) and those using PowerShell on platforms other than Windows.

      Just my 2 ¢.

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      1 user thanked author for this post.
    • #2545521

      Thanks to both of you!
      I see a start shortcut still loads 5.1.19041.2673. However the list of programs only yields 7x the ver 5 links were wiped when I installed 7.

      🍻

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

      I see a start shortcut still loads 5.1.19041.2673. However the list of programs only yields 7x the ver 5 links were wiped when I installed 7.

      I’ve never heard of the installation of PowerShell 7.x wiping out Start menu entries for PowerShell 5.1

      In the Start menu’s alphabetical listing, PowerShell 7.x should be found under ‘P’, whilst PowerShell 5.1 (and its ISE) should be found under ‘W’ (for Windows PowerShell). As such, there’s no reason for the new install to overwrite the older version as they are named differently and quite happily co-exist on the same machine.

      Hope this helps…

      1 user thanked author for this post.
    • #2545552

      In the Start menu’s alphabetical listing, PowerShell 7.x should be found under ‘P’, whilst PowerShell 5.1 (and its ISE) should be found under ‘W’ (for Windows PowerShell).

      Did they do that just to annoy us… 😣
      It is still there as you said. 😮

      🍻

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

      It is still there as you said.

      And just because it’s deprecated doesn’t mean to say that the Windows PowerShell ISE suddenly stopped working. I still use it nearly every day for testing PowerShell 5.1 code/scripts. 🙂

      Hope this helps…

      1 user thanked author for this post.
    • #2545559

      You should be aware of the differences between Windows Powershell 5.1 and Powershell 7.x. See Differences between Windows PowerShell 5.1 and PowerShell 7.x – PowerShell | Microsoft Learn. If you are unsure of which Powershell version will be used to execute a script, stick to Powershell 7.x commands, cmdlets, etc.

      --Joe

      1 user thanked author for this post.
    • #2545567

      I will be using the ISE mostly but have not used PS much, as my old computer, PS crashed on access. Never found out why.

      🍻

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

      I will be using the ISE mostly but have not used PS much, as my old computer, PS crashed on access. Never found out why.

      Perhaps have a look in Event Viewer? It has two specific categories – PowerShell Core > Operational which AFAIK keeps an eye on how the PowerShell 5.1 console behaves and Windows PowerShell which AFAIK keeps an eye on how PowerShell 5.1 interacts with the environment around it (filesystem, registry, networking inc. remoting, etc.)

      That’s the first place I would look for issues with PowerShell 5.1 crashing on access. (I installed PowerShell 7 when it first came out and upgraded to 7.3.3 yesterday but, to be honest, I only ever use 5.1.)

      Hope this helps…

      1 user thanked author for this post.
    • #2545581

      At this point I only use the older box for Quicken as I’m not sure if I could get Quicken 2013 working on my newer box??

      🍻

      Just because you don't know where you are going doesn't mean any road will get you there.
    Viewing 10 reply threads
    Reply To: Powershell

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

    Your information: