Skip to content

Resource not working if no user is logged on the remote machine #7

@Francois-Rousseau

Description

@Francois-Rousseau

When I use this resource, there's a problem if no user is logged on the client machine, because the resource is trying to reach HKCU that does not exists.

Verbose log:
Cannot find path 'HKCU:\Control Panel\Desktop\MuiCached' because it does not exist.
+ CategoryInfo : ObjectNotFound: (HKCU:\Control Panel\Desktop\MuiCached:) [], CimException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyValueCommand
+ PSComputerName : CM9

Cannot index into a null array.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NullArray
+ PSComputerName : CM9

You cannot call a method on a null-valued expression.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : InvokeMethodOnNull
+ PSComputerName : CM9

Maybe resource should check if the key exists before trying to reach it?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions