Pass by reference an object type

Welcome Forums General PowerShell Q&A Pass by reference an object type

Viewing 0 reply threads
  • Author
    Posts
    • #221103
      Participant
      Topics: 3
      Replies: 4
      Points: 27
      Rank: Member

      For parameter if I am passing an object, is it possible to pass it as reference For example

      param(
      [Parameter(Mandatory=$true)]
      [Object]$vmDetail,
      [Parameter(Mandatory=$true)]
      [Object]$VM
      )

      Here if I want to do, will it hold good in case parameter is object

      param(
      [Parameter(Mandatory=$true)]
      [ref]$vmDetail,
      [Parameter(Mandatory=$true)]
      [ref]$VM
      )

Viewing 0 reply threads
  • You must be logged in to reply to this topic.