How do I pass multiple string parameters to a PowerShell script?

后端 未结 3 446
不思量自难忘°
不思量自难忘° 2021-02-01 14:41

I am trying to do some string concatenation/formatting, but it\'s putting all the parameters into the first placeholder.

Code

function C         


        
3条回答
  •  悲&欢浪女
    2021-02-01 15:13

    Lose the parentheses and commas.

    Calling your function as:

    $s = CreateAppPoolScript "name" "user" "pass"
    

    gives:

    cscript adsutil.vbs CREATE "w3svc/AppPools/name" IIsApplicationPool
    cscript adsutil.vbs SET "w3svc/AppPools/name/WamUserName" "user"
    cscript adsutil.vbs SET "w3svc/AppPools/name/WamUserPass" "pass"
    cscript adsutil.vbs SET "w3svc/AppPools/name/AppPoolIdentityType" 3
    

提交回复
热议问题