< Back
Test-Parseable
Post
NAME Test-Parseable
SYNOPSIS
Returns a boolean indicating whether the file can be parsed as the specified encoding.
SYNTAX
Test-Parseable [-Path] <String> [-Encoding] <String> [<CommonParameters>]
DESCRIPTION
Reads the file and ensures each character conforms to the specified encoding
PARAMETERS
-Path <String>
The path to the file to test
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Encoding <String>
The name of the encoding to validate
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
NOTES
General notes
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>if (-not (Test-Parseable ".\\myfile.txt", "ascii")) { throw "Invalid Encoding" }
RELATED LINKS
SYNOPSIS
Returns a boolean indicating whether the file can be parsed as the specified encoding.
SYNTAX
Test-Parseable [-Path] <String> [-Encoding] <String> [<CommonParameters>]
DESCRIPTION
Reads the file and ensures each character conforms to the specified encoding
PARAMETERS
-Path <String>
The path to the file to test
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Encoding <String>
The name of the encoding to validate
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
NOTES
General notes
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>if (-not (Test-Parseable ".\\myfile.txt", "ascii")) { throw "Invalid Encoding" }
RELATED LINKS