Skip to content

Function File

Mark Wragg edited this page Jun 17, 2019 · 2 revisions

File

SYNOPSIS

Test a File.

DESCRIPTION

Test the existence or contents of a file.

PARAMETERS

Target [String]

[Parameter(
  Mandatory = $true,
  Position = 2,
  ParameterSetName = 'Set 1')]

Should [ScriptBlock]

[Parameter(
  Mandatory = $true,
  Position = 3,
  ParameterSetName = 'Set 1')]

Assertions

-Exist and -FileContentMatch

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

File C:\inetpub\wwwroot\iisstart.htm { Should -Exist }

-------------------------- EXAMPLE 2 --------------------------

File C:\inetpub\wwwroot\iisstart.htm { Should -FileContentMatch 'text-align:center' }