Skip to content

Instantly share code, notes, and snippets.

@PrateekKumarSingh
Created January 26, 2021 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PrateekKumarSingh/ff0e693f3c459a6829e840f5d99f300a to your computer and use it in GitHub Desktop.
Save PrateekKumarSingh/ff0e693f3c459a6829e840f5d99f300a to your computer and use it in GitHub Desktop.
# value type variable
$valueVar = 0
# reference type variable
$referenceVar = [ref]0
function increment {
$valueVar++ # increment value type variable
$referenceVar.Value++ # increment reference type variable
}
increment # function call
# output
$valueVar # result: 0
$referenceVar # result: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment