Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function main() {
  2.     [CmdletBinding()]
  3.     param(
  4.         [Parameter(Mandatory = $true)]
  5.         [string]$Name,
  6.         [Parameter(Mandatory = $true)]
  7.         [string]$CsrPath
  8.     )
  9.     Test-Func $Name $CsrPath
  10. }
  11.  
  12. function Test-Func($name, $path) {
  13.     Write-Host $name
  14.     Write-Host $path
  15. }
  16.  
  17. main
  18.  
  19. pwsh> powershell .\paramTest.ps1 -Name "myname" -CsrPath "this/isa/path"
  20.  
  21. cmdlet main at command pipeline position 1
  22. Supply values for the following parameters:
  23. Name: whyisitprompting?  
  24. CsrPath: theparametershavebeensupplied
  25. whyisitprompting?
  26. theparametershavebeensupplied
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement