# Http Server
$http = [System.Net.HttpListener]::new()
# Hostname and port to listen on
$http.Prefixes.Add("http://localhost:8080/")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding the URL | |
[System.Web.HTTPUtility]::UrlEncode("https://RidiCurious.com") | |
# decoding the URL | |
[System.Web.HTTPUtility]::UrlDecode("https%3a%2f%2fRidiCurious.com") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Debug-Error { | |
[OutputType([void])] | |
[CmdletBinding()] | |
param | |
() | |
$action = { | |
if ($_ -and ($stacktrace -notmatch '^\s*at System\.Management\.Automation\.ExceptionHandlingOps\.CheckActionPreference') -and ($stacktrace -notmatch '^\s*at System\.Management\.Automation\.MshCommandRuntime\.ThrowTerminatingError\(ErrorRecord errorRecord\)\s*$')) { | |
break | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# installation | |
Install-Module PSCognitiveService -Force -Scope CurrentUser -Verbose | |
Import-Module PSCognitiveService -Force -Verbose | |
# create AzureRM Cognitive Service subscription | |
New-CognitiveServiceAccount -AccountType Face -ResourceGroupName RG1 -Location southeastasia -SKUName F0 -Verbose | Out-Null | |
New-CognitiveServiceAccount -AccountType ComputerVision -ResourceGroupName RG1 -Location southeastasia -SKUName F0 -Verbose | Out-Null | |
# create AzureRM Cognitive Service subscription when you're unsure of resource groups, price tier and location | |
New-CognitiveServiceAccount -AccountType Bing.Search.v7 -Verbose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See youtube below for easy install instruction (just copy and paste oneliner in Powershell) and demo tour of Text-to-speech with Cortana: | |
https://www.youtube.com/watch?v=u3rIyxtpEFY |
NewerOlder