-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathDemoStrings.ps1
More file actions
39 lines (38 loc) · 1.55 KB
/
DemoStrings.ps1
File metadata and controls
39 lines (38 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function global:prompt { Write-host ""; return 'PowerShellHumanizer> ' }
function newline { Start-Sleep -Milliseconds 2000; Write-Host ''}
cls
Import-Module PowerShellHumanizer
Write-Host "`tPowerShell Humanizer Demo : String Extension Methods `t" -ForegroundColor White -BackgroundColor DarkBlue
newline
newline
Write-Host 'PowerShellHumanizer> ''then add nodes under it.''.Transform("UpperCase") '
'then add nodes under it.'.Transform("UpperCase")
newline
Write-Host 'PowerShellHumanizer> ''then add nodes under it.''.ToTitleCase()'
'then add nodes under it.'.ToTitleCase()
newline
Write-Host 'PowerShellHumanizer> ''FromTitleCase''.Underscore()'
'FromTitleCase'.Underscore()
newline
Write-Host 'PowerShellHumanizer> ''then add nodes under it.''.Truncate(3,"Words")'
'then add nodes under it.'.Truncate(3,"Words")
newline
Write-Host 'PowerShellHumanizer> ''then add nodes under it.''.Truncate(3,"Characters")'
'then add nodes under it.'.Truncate(3,"Characters")
newline
Write-Host 'PowerShellHumanizer> ''then add nodes under it.''.Truncate(7, "Characters", ''-'')'
'then add nodes under it.'.Truncate(7, "Characters", '-')
newline
Write-Host 'PowerShellHumanizer> ''then add nodes under it.''.Dehumanize() '
'then add nodes under it.'.Dehumanize()
newline
Write-Host 'PowerShellHumanizer> ''string''.ToQuantity(50)'
'string'.ToQuantity(50)
newline
Write-Host 'PowerShellHumanizer> ''string''.ToQuantity(50, "Words")'
'string'.ToQuantity(50, "Words")
newline
Write-Host 'PowerShellHumanizer> (Get-Date).Year.ToRoman()'
(Get-Date).Year.ToRoman()
newline
Start-Sleep -Milliseconds 900