* port win-say to use CSharpUtil AnsibleBasic and add warning when requested voice not found
* win_say: fixes following code review: use C# style properties consistently; prefix changelog fragments
* fix invalid yaml in change log fragment
* win_say: fixes following code review: use generic module parameter validation where possible
* remove redundant setting of Result.changed to false, simplified some logic for readability.
* fix serialisation issue when message text is drawn from a file; allows tests to be run not in check mode and fix up some test descriptions
Fail-Json$result"No msg_file, msg, start_sound_path, or end_sound_path parameters have been specified. Please specify at least one so the module has something to do"
}
$words=$null
if($msg_file){
if(Test-Path-Path$msg_file){
$words=Get-Content$msg_file|Out-String
}else{
Fail-Json$result"Message file $msg_file could not be found or opened. Ensure you have specified the full path to the file, and the ansible windows user has permission to read the file."
Fail-Json$result"Start sound file $start_sound_path could not be found or opened. Ensure you have specified the full path to the file, and the ansible windows user has permission to read the file."
if(-not(Test-Path-Path$msg_file)){
$module.FailJson("Message file $msg_file could not be found or opened. Ensure you have specified the full path to the file, and the ansible windows user has permission to read the file.")
}
$words=Get-Content$msg_file|Out-String
}
if($msg){
$words=$msg
}
if($start_sound_path){
if(-not(Test-Path-Path$start_sound_path)){
$module.FailJson("Start sound file $start_sound_path could not be found or opened. Ensure you have specified the full path to the file, and the ansible windows user has permission to read the file.")
Fail-Json$result"End sound file $start_sound_path could not be found or opened. Ensure you have specified the full path to the file, and the ansible windows user has permission to read the file."
if(-not(Test-Path-Path$end_sound_path)){
$module.FailJson("End sound file $start_sound_path could not be found or opened. Ensure you have specified the full path to the file, and the ansible windows user has permission to read the file.")