How do I create a credential parameter for a custom PowerShell 5 DSC-Resource

This topic contains 1 reply, has 1 voice, and was last updated by Profile photo of Bjørn Roalkvam Bjørn Roalkvam 3 months, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #41995
    Profile photo of Bjørn Roalkvam
    Bjørn Roalkvam
    Participant

    Hi
    Background: I have written 8-10 custom PowerShell class 5 Dsc Resources up to now. Mostly checking configurations in sql and SharePoint and installation of SharePoint prerequisites (without the prerequisiteinstaller.exe :-))

    I now want to create a Installation DSCresource that finds its binary-files on a network share. To do this I will need a "Credential" parameter that is used to access the network share. How would I go about defining this parameter in my DSCresource?

    I'm thinking i can create a normal parameter of type PSCredential, then somehow make my DSCresource use this credential to access the share..
    Any tips or pointers are welcome!

    brgs

    Bjørn

    #42002
    Profile photo of Bjørn Roalkvam
    Bjørn Roalkvam
    Participant

    I noticed that i could probably use the :
    New-PSDrive -Name P -PSProvider FileSystem -Root \\Server01\Public -Credential user\domain -Persist

    It always helps shouting it out loud :f

    brgs

    bJørn

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.