我下面的函数将创建一个HTML表,但是我希望表中的值具有超链接。
Function MyFunction{
clear-host
$item=$null
$hash = $null #hashTable
$hash =@{"Google.com" = "www.google.com"; "Yahoo" = "www.yahoo.com";"My Directory" ="C:\Users\Public\Favorites" ;"MSN" = "www.msn.com"}
ForEach($item in @($hash.KEYS.GetEnumerator())){
$hash | Sort-Object -Property name
}
$hash.GetEnumerator() | sort -Property Name |Select-Object Name, Value | ConvertTo-HTML | Out-File .\Test.html
}
MyFunction
Run Code Online (Sandbox Code Playgroud) powershell ×1