Simple Module Example

suggest change
function Add {
  [CmdletBinding()]
  param (
    [int] $x
  , [int] $y
  )

  return $x + $y
}

Export-ModuleMember -Function Add

This is a simple PowerShell script module. Save it as MyCoolModule.psm1. A module manifest (.psd1) can point at that file. Export-ModuleMember chooses which functions callers can see. Leave internal functions out of that call.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents