document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. $BlogPostInfo = New-Module -AsCustomObject  -ScriptBlock {
  2.     [string] $AuthorName = $args[0]
  3.     [string] $ScreenName = $args[1]
  4.     [string] $WebSite    = $args[2]
  5.     [string] $BlogTitle  = $args[3]
  6.  
  7.     [bool] $IsPublished = $false
  8.  
  9.     function Get-PublishingStatus {
  10.         [CmdletBinding(PositionalBinding)]
  11.         Param (
  12.             [Parameter(Position=0, HelpMessage=\'Return $true if posst is published otherwise $false\')]
  13.             [switch]
  14.             $AsBool
  15.         )
  16.  
  17.         PROCESS {
  18.             if($AsBool) {
  19.                 return $This.IsPublished
  20.             }
  21.             else {
  22.                 if($This.IsPublished) {
  23.                     return \'Published\'
  24.                 }
  25.                 else {
  26.                     return \'NotPublished\'
  27.                 }
  28.             }
  29.         }
  30.     }
  31.  
  32.     #Export Public Members
  33.     Export-ModuleMember -Variable \'AuthorName\', \'ScreenName\', \'WebSite\', \'BlogTitle\' -Function \'Get-PublishingStatus\'
  34.  
  35. } -ArgumentList \'Paul H Cassidy\', \'qawarrior\', \'blog.qawarrior.com\', \'PowerShell Objects: New-Modlule Cmdlet\'
');