Last active
November 8, 2015 13:05
-
-
Save MattHodge/4a16275707261e81b36c to your computer and use it in GitHub Desktop.
Description for 07_Blog_PSStringFormating_HashTables_WebSite.ps1
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
$webData = @{ | |
name = 'Matt' | |
fontcolor = 'red' | |
type = 'beer' | |
price = '6.00' | |
age = 29 | |
} | |
$htmlPage = " | |
<html> | |
<head> | |
<title>$($name.title)'s Web Page!</title> | |
</head> | |
<body> | |
<{0}>Welcome to $($webData.name)'s Web Page!</{0}> | |
<p> | |
<font color=""$($webData.fontcolor)"">$($webData.name)'s Age is ""$($webData.age)"".</font> | |
<p> | |
This means he can buy a $($webData.type) for `$$($webData.price)! | |
</body> | |
</html> | |
" -f 'h1' | |
Set-Content -Path C:\Temp\MyPage.html -Value $htmlPage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From Blog Post: https://www.hodgkins.net.au/powershell/the-ultimate-guide-to-powershell-string-formatting/