PoshCode Archive  Artifact [4face9b458]

Artifact 4face9b4588af5c9593e9a20b441157653ddca39ad15419fe2bfaa089c0b84eb:

  • File VerifyCategoryRule.ps1 — part of check-in [a59144cb6e] at 2018-06-10 13:14:05 on branch trunk — From Windows PowerShell Cookbook (O’Reilly) by Lee Holmes (user: Lee Holmes size: 634)

# encoding: ascii
# api: powershell
# title: VerifyCategoryRule.ps1
# description: From Windows PowerShell Cookbook (O’Reilly) by Lee Holmes
# version: 0.1
# author: Lee Holmes
# license: CC0
# x-poshcode-id: 2672
# x-derived-from-id: 2693
# x-archived: 2016-03-19T02:55:08
# x-published: 2012-05-12T10:23:00
#
#
## From Windows PowerShell Cookbook (O'Reilly)
## by Lee Holmes (http://www.leeholmes.com/guide)

Set-StrictMode -Version Latest

if($message.Body -match "book")
{
    [Console]::WriteLine("This is a message about the book.")
}
else
{
    [Console]::WriteLine("This is an unknown message.")
}