This module can be used to get and set the new PSModulePath Config Setting in PowerShell 7, which allows you to set your PSModulePath default directory. This is useful for targeting modules outside of OneDrive.
Please note that PSGet/PSResourceGet do not have native support for this new directory, and you will need to use Save-Module/Save-PSResource instead of Install-Module/Install-PSResource. As an alternative, consider ModuleFast which has native support and detection for powershell.config.json.
#Returns nothing if your powershell.config.json has not been configured yet
Get-ModulePathConfig
#Preview setting the module path to this, optionally creating it if it doesn't exist.
Set-ModulePathConfig -Path '%LOCALAPPDATA%\powershell\Modules' -Whatif
#Apply the setting. Optionally specify -AllUsers to specify it at the PowerShell level (usually requires admin rights unless powershell is locally installed into your users directory)
Set-ModulePathConfig -Path '%LOCALAPPDATA%\powershell\Modules' # Sets the module path for the user
#Gets your current active primary PSModulePath. Note that a restart of PowerShell is required for the above to take effect.
Get-ModulePath
Get-ModulePath -AllUsers