PowerShell 7 problem with command "powershell"

Hey guys, I am (almost) completely new to the topic of PowerShell. I’ve used PowerShell 5 this far and wanted to upgrade to PowerShell 7. But there are some problems I don’t think I should have.

First of all, I wanted to create a new profile for AllUsersAllHosts, but when I tried to open the profile with PowerShell_ISE I always get an error: ipmo - Module “ISE” not found. So I started PS 5 and did the same thing without any problem.
When using

powershell “& {Get-Module -ListAvailable}”

There is no result…

powershell "& {$env:PSModulePath}" output = ";"

So there is no modules for my powershell command when using PS 7. If I start PowerShell 5, all Modules are available, and also my PSModulePath are correct…
Even if I use the same commands with cmd, I get all modules as an result for Get-Module -ListAvailable and $env:PSModulePath, so it seems to be a problem only with PowerShell 7.

When I was looking for some help here in the forum, I found an interesting topic for problem with the Get-Service cmdlet which wasn’t solved. Problem was the cmdlet didn’t returned a System.ServiceProcess.ServiceController but a System.Service.ServiceController#StartupType. Should I get this type of object? Because it looks just wrong to me ^^.

Thank you guys already in advance,
Micha

Hello Michi,

There are too many fundamentals that you don’t really have, and if you want to continue using powershell, you will have to read and self learn by yourself, like we all did.

But I can bring some answers

Hi ZaMotH,

Yes sure I am about to learn PS all by myself, already got some books: PowerShell in Detph v2 and Learn PowerShell in a Month of Lunches v4. Also watched some YT-Videos with Mr. Snover and try to get as much information as possible.

But I am completly new to PowerShell or computing at all, just doing an education to learn and have to say: PowerShell rocks and I am really excited :smiley: .

If there are some more books, pages or video playlist you all could recommend feel free to share ^^

Best greetings,
Micha

powershell "& {Get-Module -ListAvailable}" This shouldn’t be required FWIW. While it technically works for PS5 I wouldn’t recommend running commands this way starting out. It’s hard to determine what your underlying goal is since you mentioned a few different things, so I’m going to stick to the command you mentioned.

the command PowerShell references the powershell 5 executable. PowerShell 7 is a different executable.

  1. Launch PowerShell 7 (I’m assuming you have a windows box since you mention PowerShell 5).
  2. It should be be searchable (search PowerShell 7) or look for the pwsh.exe executable in C:\Program Files\PowerShell\7.
  3. Then you should be able to run
    Get-Module -ListAvailable