Skip to content
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

Remove-PSFConfig fails for a simple test #373

Closed
Splaxi opened this issue Aug 5, 2019 · 2 comments
Closed

Remove-PSFConfig fails for a simple test #373

Splaxi opened this issue Aug 5, 2019 · 2 comments

Comments

@Splaxi
Copy link
Contributor

Splaxi commented Aug 5, 2019

Expected behavior:

This should delete the newly created configuration.

Set-PSFConfig -FullName "test.test.test" -Value "Test" -AllowDelete
Remove-PSFConfig -FullName "test.test.test"

But it fails with an internal error:

Write-PSFMessage : Value cannot be null.
Parameter name: args
At C:\Users\motz\OneDrive - Essence Solutions P S\Documents\WindowsPowerShell\Modules\PSFramework\1.0.19\PSFramework.ps
m1:2250 char:21
+ ... ($result) { Write-PSFMessage -Level InternalComment -String Configura ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-PSFMessage], ArgumentNullException
    + FullyQualifiedErrorId : System.ArgumentNullException,PSFramework.Commands.WritePSFMessageCommand

Digging into the module, it seems like inside the Remove-PSFConfig function there is an issue with this line:

if ($result) { Write-PSFMessage -Level InternalComment -String Configuration.Remove-PSFConfig.DeleteSuccessful -StringValues $item.FullName }

More specifically with the -StringValues $item.FullName part.

Changing it to -StringValues @($item.FullName) seems to fix the issue.

I'll create a PR with the suggested fix and then you can have a look at it.

Splaxi added a commit to Splaxi/psframework that referenced this issue Aug 5, 2019
@Splaxi Splaxi mentioned this issue Aug 5, 2019
@FriedrichWeinmann
Copy link
Member

Bug found and fixed, will be resolved in the next release

@FriedrichWeinmann
Copy link
Member

Resolved since 1.0.33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants