< Back
Invoke-SpellCheck
Post
NAME Invoke-SpellCheck
SYNOPSIS
Identify and Rectify spelling mistakes in an input String
SYNTAX
Invoke-SpellCheck [-String] <String> [-ShowErrors] [-RemoveSpecialChars] [<CommonParameters>]
DESCRIPTION
Identify spelling mistakes and repeated token in a string and suggests possible combination of correct spellings,
able to identify Nouns in the string and converts first alphabet in Uppercase.
Cmdlet is Using Microsoft cognitive service's "Spell Check" API as a service to get the information needed by
making HTTP calls to the API
NOTE : You need to subscribe the "Spell Check API" before using the powershell script from the following link and
setup an environment variable like, $env:MS_SpellCheck_API_key = "YOUR API KEY"
API Subscription Page - https://www.microsoft.com/cognitive-ser ... scriptions
PARAMETERS
-String <String>
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-ShowErrors [<SwitchParameter>]
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-RemoveSpecialChars [<SwitchParameter>]
Required? false
Position? named
Default value False
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
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Hello world
-------------------------- EXAMPLE 2 --------------------------
PS D:\\>"owershell is is fun" | Invoke-SpellCheck -ShowErrors |ft -AutoSize
ErrorToken Type Suggestions
---------- ---- -----------
owershell UnknownToken powershell
is RepeatedToken
DESCRIPTION
-----------
When Invoke-SpellCheck function is used with -ShowErrors switch, it identifies unknown tokens (mistakes), repeated
token in the string and displays Suggestions.
-------------------------- EXAMPLE 3 --------------------------
PS D:\\>"thes is the the graet wall of china" |Invoke-SpellCheck
this is the great wall of China
the is the great wall of China
DESCRIPTION
-----------
Using the Suggestion function generates all possible combination of sentences.
-------------------------- EXAMPLE 4 --------------------------
PS D:\\>"b!ll g@tes" |Invoke-SpellCheck -RemoveSpecialChars
Bill Gates
DESCRIPTION
-----------
When Invoke-SpellCheck function is used with -RemoveSpecialChars switch, it removes all special character fomr the
input string and rectifies the spelling mistakes.
RELATED LINKS
SYNOPSIS
Identify and Rectify spelling mistakes in an input String
SYNTAX
Invoke-SpellCheck [-String] <String> [-ShowErrors] [-RemoveSpecialChars] [<CommonParameters>]
DESCRIPTION
Identify spelling mistakes and repeated token in a string and suggests possible combination of correct spellings,
able to identify Nouns in the string and converts first alphabet in Uppercase.
Cmdlet is Using Microsoft cognitive service's "Spell Check" API as a service to get the information needed by
making HTTP calls to the API
NOTE : You need to subscribe the "Spell Check API" before using the powershell script from the following link and
setup an environment variable like, $env:MS_SpellCheck_API_key = "YOUR API KEY"
API Subscription Page - https://www.microsoft.com/cognitive-ser ... scriptions
PARAMETERS
-String <String>
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-ShowErrors [<SwitchParameter>]
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-RemoveSpecialChars [<SwitchParameter>]
Required? false
Position? named
Default value False
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
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Hello world
-------------------------- EXAMPLE 2 --------------------------
PS D:\\>"owershell is is fun" | Invoke-SpellCheck -ShowErrors |ft -AutoSize
ErrorToken Type Suggestions
---------- ---- -----------
owershell UnknownToken powershell
is RepeatedToken
DESCRIPTION
-----------
When Invoke-SpellCheck function is used with -ShowErrors switch, it identifies unknown tokens (mistakes), repeated
token in the string and displays Suggestions.
-------------------------- EXAMPLE 3 --------------------------
PS D:\\>"thes is the the graet wall of china" |Invoke-SpellCheck
this is the great wall of China
the is the great wall of China
DESCRIPTION
-----------
Using the Suggestion function generates all possible combination of sentences.
-------------------------- EXAMPLE 4 --------------------------
PS D:\\>"b!ll g@tes" |Invoke-SpellCheck -RemoveSpecialChars
Bill Gates
DESCRIPTION
-----------
When Invoke-SpellCheck function is used with -RemoveSpecialChars switch, it removes all special character fomr the
input string and rectifies the spelling mistakes.
RELATED LINKS