Powershell Profile For Test and Preview Modules

celsoglima 371 Reputation points
2021-06-22T16:25:38.093+00:00

I thought about something yesterday, and I was wondering if some of you guys with a lot of experience with PowerShell might be able shed to some light on what I would like to do.

Could I use PowerShell profiles under a single user and the same version of PowerShell to have different modules and/or versions of modules installed? One possible use for what I am trying to do would be to check out a preview versions of modules, for example.

Has anybody done that already? Any suggestions on what I should or shouldn't do?

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,362 questions
0 comments No comments
{count} votes

Accepted answer
  1. celsoglima 371 Reputation points
    2021-06-22T19:34:56.193+00:00

    I am aware Powershell profiles are just scripts. To be honest I might be making this more complicated than it should. Thus I am going to set the path environment variable and force my sessions to use different sets of %WindowsPowershell% folders depending on what I am trying to do. That is what I would have done on a Linux system anyway.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Rich Matheisen 44,776 Reputation points
    2021-06-22T18:33:09.03+00:00

    Profiles are just PowerShell scripts. You can just load the one you want, say, from the PowerShell prompt.

    I know this says "PowerShell 7" but it isn't specific to just that version: loading-different-powershell-profiles-on-startup-powershell-7

    0 comments No comments