$BlogPostInfo = New-Module -AsCustomObject -ScriptBlock {
[string] $AuthorName = $args[0]
[string] $ScreenName = $args[1]
[string] $WebSite = $args[2]
[string] $BlogTitle = $args[3]
[bool] $IsPublished = $false
function Get-PublishingStatus {
[CmdletBinding(PositionalBinding)]
Param (
[Parameter(Position=0, HelpMessage=\'Return $true if posst is published otherwise $false\')]
[switch]
$AsBool
)
PROCESS {
if($AsBool) {
return $This.IsPublished
}
else {
if($This.IsPublished) {
return \'Published\'
}
else {
return \'NotPublished\'
}
}
}
}
#Export Public Members
Export-ModuleMember -Variable \'AuthorName\', \'ScreenName\', \'WebSite\', \'BlogTitle\' -Function \'Get-PublishingStatus\'
} -ArgumentList \'Paul H Cassidy\', \'qawarrior\', \'blog.qawarrior.com\', \'PowerShell Objects: New-Modlule Cmdlet\'