How to use a config file (ini, conf,…) with a PowerShell Script?Elevated Powershell scriptPowershell help: have a “disk space” script link…but how do I use it?Powershell script to create folders from CSV list of usersHow can I run an elevated powershell script as part of VMWare Customization Specification?Powershell - Windows forms - script calling another script, 2nd script modifying form elementsUsing Powershell to Create Exchange Contacts from a .CSV filePowershell script scheduled task will not endRunning Exchange Powershell script from a batch file: command doesn't work. What's wrong with my syntax?Read file with parameters as parameter in powershell scriptCopy files to network drive with powershell script and task schedule

How to laser-level close to a surface

Cycling to work - 30mile return

How do we explain the use of a software on a math paper?

Who is frowning in the sentence "Daisy looked at Tom frowning"?

pwaS eht tirsf dna tasl setterl fo hace dorw

Combining two Lorentz boosts

Why does string strummed with finger sound different from the one strummed with pick?

Windows reverting changes made by Linux to FAT32 partion

Does the US Supreme Court vote using secret ballots?

How can I monitor the bulk API limit?

Why would company (decision makers) wait for someone to retire, rather than lay them off, when their role is no longer needed?

Former Employer just sent me an IP Agreement

Bookshelves: the intruder

Why does a table with a defined constant in its index compute 10X slower?

How many Dothraki are left as of Game of Thrones S8E5?

Why using a variable as index of a list-item does not retrieve that item with clist_item:Nn?

How was the blinking terminal cursor invented?

Should I twist DC power and ground wires from a power supply?

FIFO data structure in pure C

How do I balance a campaign consisting of four kobold PCs?

Why does the U.S military use mercenaries?

How to get all possible paths in 0/1 matrix better way?

on the truth quest vs in the quest for truth

Divisor Rich and Poor Numbers



How to use a config file (ini, conf,…) with a PowerShell Script?


Elevated Powershell scriptPowershell help: have a “disk space” script link…but how do I use it?Powershell script to create folders from CSV list of usersHow can I run an elevated powershell script as part of VMWare Customization Specification?Powershell - Windows forms - script calling another script, 2nd script modifying form elementsUsing Powershell to Create Exchange Contacts from a .CSV filePowershell script scheduled task will not endRunning Exchange Powershell script from a batch file: command doesn't work. What's wrong with my syntax?Read file with parameters as parameter in powershell scriptCopy files to network drive with powershell script and task schedule






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








14















Is it possible to use a configuration file with a PowerShell script?



For example, the configuration file:



#links
link1=http://www.google.com
link2=http://www.apple.com
link3=http://www.microsoft.com


And then call this information in the PS1 script:



start-process iexplore.exe $Link1









share|improve this question






























    14















    Is it possible to use a configuration file with a PowerShell script?



    For example, the configuration file:



    #links
    link1=http://www.google.com
    link2=http://www.apple.com
    link3=http://www.microsoft.com


    And then call this information in the PS1 script:



    start-process iexplore.exe $Link1









    share|improve this question


























      14












      14








      14


      7






      Is it possible to use a configuration file with a PowerShell script?



      For example, the configuration file:



      #links
      link1=http://www.google.com
      link2=http://www.apple.com
      link3=http://www.microsoft.com


      And then call this information in the PS1 script:



      start-process iexplore.exe $Link1









      share|improve this question
















      Is it possible to use a configuration file with a PowerShell script?



      For example, the configuration file:



      #links
      link1=http://www.google.com
      link2=http://www.apple.com
      link3=http://www.microsoft.com


      And then call this information in the PS1 script:



      start-process iexplore.exe $Link1






      powershell scripting






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 5 '18 at 20:28









      Twisty Impersonator

      2,52861943




      2,52861943










      asked Sep 30 '10 at 0:04









      Xavier CXavier C

      3882411




      3882411




















          4 Answers
          4






          active

          oldest

          votes


















          17














          Thanks a lot for your help Dennis and Tim! Your answers put me on the good track and I found this



          SETTINGS.TXT



          #from http://tlingenf.spaces.live.com/blog/cns!B1B09F516B5BAEBF!213.entry
          #
          [General]
          MySetting1=value

          [Locations]
          InputFile="C:Users.txt"
          OutputFile="C:output.log"

          [Other]
          WaitForTime=20
          VerboseLogging=True


          POWERSHELL COMMAND



          #from http://tlingenf.spaces.live.com/blog/cns!B1B09F516B5BAEBF!213.entry
          #
          Get-Content "C:settings.txt" | foreach-object -begin $h=@ -process $k = [regex]::split($_,'='); if(($k[0].CompareTo("") -ne 0) -and ($k[0].StartsWith("[") -ne $True)) $h.Add($k[0], $k[1])


          then



          After executing the code snippet, a variable ($h) will contain the values in a HashTable.



          Name Value
          ---- -----
          MySetting1 value
          VerboseLogging True
          WaitForTime 20
          OutputFile "C:output.log"
          InputFile "C:Users.txt"


          *To retrieve an item from the table, use the command $h.Get_Item("MySetting1").*






          share|improve this answer




















          • 3





            You can also get the settings out by the much friendlier $h.MySetting1

            – Ryan Shillington
            Nov 13 '15 at 19:54











          • I get an array out of bounds exception in the regex parser line, despite using the exact same .txt file shown in this answer and the parser code (no changes) => Index was outside the bounds of the array. At C:testConfigreader.ps1:13 char:264 + ... -ne $True)) $h.Add($k[0], $k[1]) } + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], IndexOutOfRangeException + FullyQualifiedErrorId : System.IndexOutOfRangeException Does anyone have this working correctly?

            – Shiva
            Mar 9 '17 at 0:24



















          3














          There's a good thread here which shows this code (quoting from the linked thread):



          # from http://www.eggheadcafe.com/software/aspnet/30358576/powershell-and-ini-files.aspx
          param ($file)

          $ini = @
          switch -regex -file $file

          "^[(.+)]$"
          $section = $matches[1]
          $ini[$section] = @

          "(.+)=(.+)"
          $name,$value = $matches[1..2]
          $ini[$section][$name] = $value


          $ini


          Then you can do:



          PS> $links = import-ini links.ini
          PS> $links["search-engines"]["link1"]
          http://www.google.com
          PS> $links["vendors"]["link1"]
          http://www.apple.com


          Assuming an INI file that looks like this:



          [vendors]
          link1=http://www.apple.com
          [search-engines]
          link1=http://www.google.com


          Unfortunately the regexes are missing from the code at the link so you'll have to reproduce them, but there's a version that handles files without section headers and lines that are comments.






          share|improve this answer























          • You can handle comments easily by just adding another case to the switch with '^#' . Also you can access hashtable contents with a dot as well, so $links.vendors.link1 should work too which might be a little better to read.

            – Joey
            Oct 20 '10 at 7:20



















          2














          yes, the cmdlets you're looking for are get-content and select-string.



          $content=get-content C:links.txt
          start-process iexplore.exe $content[0]





          share|improve this answer






























            0














            For a more comprehensive approach, consider https://github.com/alekdavis/ConfigFile . This module supports config files in JSON format, as well as INI. It allows expanding variables and does a few neat tricks. The thing to remember is that the names of the key-value pairs in the INI file must match the names of the script parameters or variables.






            share|improve this answer























              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "2"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f186030%2fhow-to-use-a-config-file-ini-conf-with-a-powershell-script%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              17














              Thanks a lot for your help Dennis and Tim! Your answers put me on the good track and I found this



              SETTINGS.TXT



              #from http://tlingenf.spaces.live.com/blog/cns!B1B09F516B5BAEBF!213.entry
              #
              [General]
              MySetting1=value

              [Locations]
              InputFile="C:Users.txt"
              OutputFile="C:output.log"

              [Other]
              WaitForTime=20
              VerboseLogging=True


              POWERSHELL COMMAND



              #from http://tlingenf.spaces.live.com/blog/cns!B1B09F516B5BAEBF!213.entry
              #
              Get-Content "C:settings.txt" | foreach-object -begin $h=@ -process $k = [regex]::split($_,'='); if(($k[0].CompareTo("") -ne 0) -and ($k[0].StartsWith("[") -ne $True)) $h.Add($k[0], $k[1])


              then



              After executing the code snippet, a variable ($h) will contain the values in a HashTable.



              Name Value
              ---- -----
              MySetting1 value
              VerboseLogging True
              WaitForTime 20
              OutputFile "C:output.log"
              InputFile "C:Users.txt"


              *To retrieve an item from the table, use the command $h.Get_Item("MySetting1").*






              share|improve this answer




















              • 3





                You can also get the settings out by the much friendlier $h.MySetting1

                – Ryan Shillington
                Nov 13 '15 at 19:54











              • I get an array out of bounds exception in the regex parser line, despite using the exact same .txt file shown in this answer and the parser code (no changes) => Index was outside the bounds of the array. At C:testConfigreader.ps1:13 char:264 + ... -ne $True)) $h.Add($k[0], $k[1]) } + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], IndexOutOfRangeException + FullyQualifiedErrorId : System.IndexOutOfRangeException Does anyone have this working correctly?

                – Shiva
                Mar 9 '17 at 0:24
















              17














              Thanks a lot for your help Dennis and Tim! Your answers put me on the good track and I found this



              SETTINGS.TXT



              #from http://tlingenf.spaces.live.com/blog/cns!B1B09F516B5BAEBF!213.entry
              #
              [General]
              MySetting1=value

              [Locations]
              InputFile="C:Users.txt"
              OutputFile="C:output.log"

              [Other]
              WaitForTime=20
              VerboseLogging=True


              POWERSHELL COMMAND



              #from http://tlingenf.spaces.live.com/blog/cns!B1B09F516B5BAEBF!213.entry
              #
              Get-Content "C:settings.txt" | foreach-object -begin $h=@ -process $k = [regex]::split($_,'='); if(($k[0].CompareTo("") -ne 0) -and ($k[0].StartsWith("[") -ne $True)) $h.Add($k[0], $k[1])


              then



              After executing the code snippet, a variable ($h) will contain the values in a HashTable.



              Name Value
              ---- -----
              MySetting1 value
              VerboseLogging True
              WaitForTime 20
              OutputFile "C:output.log"
              InputFile "C:Users.txt"


              *To retrieve an item from the table, use the command $h.Get_Item("MySetting1").*






              share|improve this answer




















              • 3





                You can also get the settings out by the much friendlier $h.MySetting1

                – Ryan Shillington
                Nov 13 '15 at 19:54











              • I get an array out of bounds exception in the regex parser line, despite using the exact same .txt file shown in this answer and the parser code (no changes) => Index was outside the bounds of the array. At C:testConfigreader.ps1:13 char:264 + ... -ne $True)) $h.Add($k[0], $k[1]) } + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], IndexOutOfRangeException + FullyQualifiedErrorId : System.IndexOutOfRangeException Does anyone have this working correctly?

                – Shiva
                Mar 9 '17 at 0:24














              17












              17








              17







              Thanks a lot for your help Dennis and Tim! Your answers put me on the good track and I found this



              SETTINGS.TXT



              #from http://tlingenf.spaces.live.com/blog/cns!B1B09F516B5BAEBF!213.entry
              #
              [General]
              MySetting1=value

              [Locations]
              InputFile="C:Users.txt"
              OutputFile="C:output.log"

              [Other]
              WaitForTime=20
              VerboseLogging=True


              POWERSHELL COMMAND



              #from http://tlingenf.spaces.live.com/blog/cns!B1B09F516B5BAEBF!213.entry
              #
              Get-Content "C:settings.txt" | foreach-object -begin $h=@ -process $k = [regex]::split($_,'='); if(($k[0].CompareTo("") -ne 0) -and ($k[0].StartsWith("[") -ne $True)) $h.Add($k[0], $k[1])


              then



              After executing the code snippet, a variable ($h) will contain the values in a HashTable.



              Name Value
              ---- -----
              MySetting1 value
              VerboseLogging True
              WaitForTime 20
              OutputFile "C:output.log"
              InputFile "C:Users.txt"


              *To retrieve an item from the table, use the command $h.Get_Item("MySetting1").*






              share|improve this answer















              Thanks a lot for your help Dennis and Tim! Your answers put me on the good track and I found this



              SETTINGS.TXT



              #from http://tlingenf.spaces.live.com/blog/cns!B1B09F516B5BAEBF!213.entry
              #
              [General]
              MySetting1=value

              [Locations]
              InputFile="C:Users.txt"
              OutputFile="C:output.log"

              [Other]
              WaitForTime=20
              VerboseLogging=True


              POWERSHELL COMMAND



              #from http://tlingenf.spaces.live.com/blog/cns!B1B09F516B5BAEBF!213.entry
              #
              Get-Content "C:settings.txt" | foreach-object -begin $h=@ -process $k = [regex]::split($_,'='); if(($k[0].CompareTo("") -ne 0) -and ($k[0].StartsWith("[") -ne $True)) $h.Add($k[0], $k[1])


              then



              After executing the code snippet, a variable ($h) will contain the values in a HashTable.



              Name Value
              ---- -----
              MySetting1 value
              VerboseLogging True
              WaitForTime 20
              OutputFile "C:output.log"
              InputFile "C:Users.txt"


              *To retrieve an item from the table, use the command $h.Get_Item("MySetting1").*







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Mar 9 '17 at 0:46









              Shiva

              1034




              1034










              answered Sep 30 '10 at 18:51









              Xavier CXavier C

              3882411




              3882411







              • 3





                You can also get the settings out by the much friendlier $h.MySetting1

                – Ryan Shillington
                Nov 13 '15 at 19:54











              • I get an array out of bounds exception in the regex parser line, despite using the exact same .txt file shown in this answer and the parser code (no changes) => Index was outside the bounds of the array. At C:testConfigreader.ps1:13 char:264 + ... -ne $True)) $h.Add($k[0], $k[1]) } + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], IndexOutOfRangeException + FullyQualifiedErrorId : System.IndexOutOfRangeException Does anyone have this working correctly?

                – Shiva
                Mar 9 '17 at 0:24













              • 3





                You can also get the settings out by the much friendlier $h.MySetting1

                – Ryan Shillington
                Nov 13 '15 at 19:54











              • I get an array out of bounds exception in the regex parser line, despite using the exact same .txt file shown in this answer and the parser code (no changes) => Index was outside the bounds of the array. At C:testConfigreader.ps1:13 char:264 + ... -ne $True)) $h.Add($k[0], $k[1]) } + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], IndexOutOfRangeException + FullyQualifiedErrorId : System.IndexOutOfRangeException Does anyone have this working correctly?

                – Shiva
                Mar 9 '17 at 0:24








              3




              3





              You can also get the settings out by the much friendlier $h.MySetting1

              – Ryan Shillington
              Nov 13 '15 at 19:54





              You can also get the settings out by the much friendlier $h.MySetting1

              – Ryan Shillington
              Nov 13 '15 at 19:54













              I get an array out of bounds exception in the regex parser line, despite using the exact same .txt file shown in this answer and the parser code (no changes) => Index was outside the bounds of the array. At C:testConfigreader.ps1:13 char:264 + ... -ne $True)) $h.Add($k[0], $k[1]) } + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], IndexOutOfRangeException + FullyQualifiedErrorId : System.IndexOutOfRangeException Does anyone have this working correctly?

              – Shiva
              Mar 9 '17 at 0:24






              I get an array out of bounds exception in the regex parser line, despite using the exact same .txt file shown in this answer and the parser code (no changes) => Index was outside the bounds of the array. At C:testConfigreader.ps1:13 char:264 + ... -ne $True)) $h.Add($k[0], $k[1]) } + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], IndexOutOfRangeException + FullyQualifiedErrorId : System.IndexOutOfRangeException Does anyone have this working correctly?

              – Shiva
              Mar 9 '17 at 0:24














              3














              There's a good thread here which shows this code (quoting from the linked thread):



              # from http://www.eggheadcafe.com/software/aspnet/30358576/powershell-and-ini-files.aspx
              param ($file)

              $ini = @
              switch -regex -file $file

              "^[(.+)]$"
              $section = $matches[1]
              $ini[$section] = @

              "(.+)=(.+)"
              $name,$value = $matches[1..2]
              $ini[$section][$name] = $value


              $ini


              Then you can do:



              PS> $links = import-ini links.ini
              PS> $links["search-engines"]["link1"]
              http://www.google.com
              PS> $links["vendors"]["link1"]
              http://www.apple.com


              Assuming an INI file that looks like this:



              [vendors]
              link1=http://www.apple.com
              [search-engines]
              link1=http://www.google.com


              Unfortunately the regexes are missing from the code at the link so you'll have to reproduce them, but there's a version that handles files without section headers and lines that are comments.






              share|improve this answer























              • You can handle comments easily by just adding another case to the switch with '^#' . Also you can access hashtable contents with a dot as well, so $links.vendors.link1 should work too which might be a little better to read.

                – Joey
                Oct 20 '10 at 7:20
















              3














              There's a good thread here which shows this code (quoting from the linked thread):



              # from http://www.eggheadcafe.com/software/aspnet/30358576/powershell-and-ini-files.aspx
              param ($file)

              $ini = @
              switch -regex -file $file

              "^[(.+)]$"
              $section = $matches[1]
              $ini[$section] = @

              "(.+)=(.+)"
              $name,$value = $matches[1..2]
              $ini[$section][$name] = $value


              $ini


              Then you can do:



              PS> $links = import-ini links.ini
              PS> $links["search-engines"]["link1"]
              http://www.google.com
              PS> $links["vendors"]["link1"]
              http://www.apple.com


              Assuming an INI file that looks like this:



              [vendors]
              link1=http://www.apple.com
              [search-engines]
              link1=http://www.google.com


              Unfortunately the regexes are missing from the code at the link so you'll have to reproduce them, but there's a version that handles files without section headers and lines that are comments.






              share|improve this answer























              • You can handle comments easily by just adding another case to the switch with '^#' . Also you can access hashtable contents with a dot as well, so $links.vendors.link1 should work too which might be a little better to read.

                – Joey
                Oct 20 '10 at 7:20














              3












              3








              3







              There's a good thread here which shows this code (quoting from the linked thread):



              # from http://www.eggheadcafe.com/software/aspnet/30358576/powershell-and-ini-files.aspx
              param ($file)

              $ini = @
              switch -regex -file $file

              "^[(.+)]$"
              $section = $matches[1]
              $ini[$section] = @

              "(.+)=(.+)"
              $name,$value = $matches[1..2]
              $ini[$section][$name] = $value


              $ini


              Then you can do:



              PS> $links = import-ini links.ini
              PS> $links["search-engines"]["link1"]
              http://www.google.com
              PS> $links["vendors"]["link1"]
              http://www.apple.com


              Assuming an INI file that looks like this:



              [vendors]
              link1=http://www.apple.com
              [search-engines]
              link1=http://www.google.com


              Unfortunately the regexes are missing from the code at the link so you'll have to reproduce them, but there's a version that handles files without section headers and lines that are comments.






              share|improve this answer













              There's a good thread here which shows this code (quoting from the linked thread):



              # from http://www.eggheadcafe.com/software/aspnet/30358576/powershell-and-ini-files.aspx
              param ($file)

              $ini = @
              switch -regex -file $file

              "^[(.+)]$"
              $section = $matches[1]
              $ini[$section] = @

              "(.+)=(.+)"
              $name,$value = $matches[1..2]
              $ini[$section][$name] = $value


              $ini


              Then you can do:



              PS> $links = import-ini links.ini
              PS> $links["search-engines"]["link1"]
              http://www.google.com
              PS> $links["vendors"]["link1"]
              http://www.apple.com


              Assuming an INI file that looks like this:



              [vendors]
              link1=http://www.apple.com
              [search-engines]
              link1=http://www.google.com


              Unfortunately the regexes are missing from the code at the link so you'll have to reproduce them, but there's a version that handles files without section headers and lines that are comments.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Sep 30 '10 at 1:29









              Dennis WilliamsonDennis Williamson

              51.2k1193128




              51.2k1193128












              • You can handle comments easily by just adding another case to the switch with '^#' . Also you can access hashtable contents with a dot as well, so $links.vendors.link1 should work too which might be a little better to read.

                – Joey
                Oct 20 '10 at 7:20


















              • You can handle comments easily by just adding another case to the switch with '^#' . Also you can access hashtable contents with a dot as well, so $links.vendors.link1 should work too which might be a little better to read.

                – Joey
                Oct 20 '10 at 7:20

















              You can handle comments easily by just adding another case to the switch with '^#' . Also you can access hashtable contents with a dot as well, so $links.vendors.link1 should work too which might be a little better to read.

              – Joey
              Oct 20 '10 at 7:20






              You can handle comments easily by just adding another case to the switch with '^#' . Also you can access hashtable contents with a dot as well, so $links.vendors.link1 should work too which might be a little better to read.

              – Joey
              Oct 20 '10 at 7:20












              2














              yes, the cmdlets you're looking for are get-content and select-string.



              $content=get-content C:links.txt
              start-process iexplore.exe $content[0]





              share|improve this answer



























                2














                yes, the cmdlets you're looking for are get-content and select-string.



                $content=get-content C:links.txt
                start-process iexplore.exe $content[0]





                share|improve this answer

























                  2












                  2








                  2







                  yes, the cmdlets you're looking for are get-content and select-string.



                  $content=get-content C:links.txt
                  start-process iexplore.exe $content[0]





                  share|improve this answer













                  yes, the cmdlets you're looking for are get-content and select-string.



                  $content=get-content C:links.txt
                  start-process iexplore.exe $content[0]






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 30 '10 at 0:11









                  TimTim

                  21613




                  21613





















                      0














                      For a more comprehensive approach, consider https://github.com/alekdavis/ConfigFile . This module supports config files in JSON format, as well as INI. It allows expanding variables and does a few neat tricks. The thing to remember is that the names of the key-value pairs in the INI file must match the names of the script parameters or variables.






                      share|improve this answer



























                        0














                        For a more comprehensive approach, consider https://github.com/alekdavis/ConfigFile . This module supports config files in JSON format, as well as INI. It allows expanding variables and does a few neat tricks. The thing to remember is that the names of the key-value pairs in the INI file must match the names of the script parameters or variables.






                        share|improve this answer

























                          0












                          0








                          0







                          For a more comprehensive approach, consider https://github.com/alekdavis/ConfigFile . This module supports config files in JSON format, as well as INI. It allows expanding variables and does a few neat tricks. The thing to remember is that the names of the key-value pairs in the INI file must match the names of the script parameters or variables.






                          share|improve this answer













                          For a more comprehensive approach, consider https://github.com/alekdavis/ConfigFile . This module supports config files in JSON format, as well as INI. It allows expanding variables and does a few neat tricks. The thing to remember is that the names of the key-value pairs in the INI file must match the names of the script parameters or variables.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered May 6 at 6:23









                          Alek DavisAlek Davis

                          123115




                          123115



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Server Fault!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f186030%2fhow-to-use-a-config-file-ini-conf-with-a-powershell-script%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                              Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                              Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020