-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot add plugin, Path is null, PSProfile doesn't import anymore #42
Comments
hello @avezinaATastus ! Thanks for opening this issue up! Can you elaborate on what commands you used (assuming You should be able to pull up the configuration file @ I'm going to consider this as a bug for the PluginPaths section so it handles failures a bit better (e.g. log that something failed but no block the overall module import), but I'd also like to make sure that you're using the correct section of PSProfile depending on what the ultimate goal is with that file you're adding to your configuration 😃 |
I have one repo/folder that has a folder named Plugins. This folder hosts ps1 files, and they have one function each (Might put multiple functions per file if there is nothing against it). It is just a function I want available in my powershell session. Add-PSProfilePluginPath -Path C:\Users\avezina\gitrepos\My.PSProfile\Plugins -Save
Add-PSProfilePlugin -Name Start-WindowsSandbox -Save The file Start-WindowsSandbox.ps1 contains this : Function Start-WindowsSandbox {
[cmdletbinding(DefaultParameterSetName = "config")]
[alias("wsb")]
Param(
[Parameter(ParameterSetName = "config")]
[ValidateScript( { Test-Path $_ })]
[string]$Configuration = "C:\Sandbox\WinSandBox.wsb",
[Parameter(ParameterSetName = "normal")]
[switch]$NoSetup
)
Write-Verbose "Starting $($myinvocation.mycommand)"
if ($NoSetup) {
Write-Verbose "Launching default WindowsSandbox.exe"
c:\windows\system32\WindowsSandbox.exe
}
else {
Write-Verbose "Launching WindowsSandbox using configuration file $Configuration"
Invoke-Item $Configuration
}
Write-Verbose "Ending $($myinvocation.mycommand)"
} After doing the two commands (add-*pluginpath and add-*plugin) opening a new powershell session/console won't be able to load PSProfile. Removing (with |
Oohh, could it be because of the |
Hi,
I have a function in a ps1 file in a Plugins folder.
I added this folder in the pluginspath configuration, and the function/file is auto-completed when I do add-psprofileplugin.
but when I restart the powershell session, Importing the psprofile module returns me an exception that the path is null.
The text was updated successfully, but these errors were encountered: