Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/PowerShell/PowerShell.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorxtqqczze <45661989+xtqqczze@users.noreply.github.com>2020-05-07 15:00:30 +0300
committerGitHub <noreply@github.com>2020-05-07 15:00:30 +0300
commitf4382202ae4622bf26795e29a7b39b9d7cdfb3fb (patch)
treec9b6f24a879fe0463de81dc7a335874843a73822 /demos
parent71d8876e6052f883e1831af4ed808a87a7a52161 (diff)
Use correct casing for cmdlet name and cmdlet parameter name in *.ps1 files (#12584)
Diffstat (limited to 'demos')
-rw-r--r--demos/Apache/apache-demo.ps16
-rw-r--r--demos/Docker-PowerShell/Docker-PowerShell.ps14
-rw-r--r--demos/SystemD/SystemD/SystemD.psm12
-rw-r--r--demos/SystemD/journalctl-demo.ps16
-rw-r--r--demos/python/class1.ps12
-rw-r--r--demos/python/demo_script.ps14
6 files changed, 12 insertions, 12 deletions
diff --git a/demos/Apache/apache-demo.ps1 b/demos/Apache/apache-demo.ps1
index 1168bc7a39..299ce0cc0d 100644
--- a/demos/Apache/apache-demo.ps1
+++ b/demos/Apache/apache-demo.ps1
@@ -8,12 +8,12 @@ Write-Host -Foreground Blue "Get installed Apache Modules like *proxy* and Sort
Get-ApacheModule | Where-Object {$_.ModuleName -like "*proxy*"} | Sort-Object ModuleName | Out-Host
#Graceful restart of Apache
-Write-host -Foreground Blue "Restart Apache Server gracefully"
+Write-Host -Foreground Blue "Restart Apache Server gracefully"
Restart-ApacheHTTPServer -Graceful | Out-Host
#Enumerate current virtual hosts (web sites)
Write-Host -Foreground Blue "Enumerate configured Apache Virtual Hosts"
-Get-ApacheVHost |out-host
+Get-ApacheVHost |Out-Host
#Add a new virtual host
Write-Host -Foreground Yellow "Create a new Apache Virtual Host"
@@ -21,7 +21,7 @@ New-ApacheVHost -ServerName "mytestserver" -DocumentRoot /var/www/html/mytestser
#Enumerate new set of virtual hosts
Write-Host -Foreground Blue "Enumerate Apache Virtual Hosts Again"
-Get-ApacheVHost |out-host
+Get-ApacheVHost |Out-Host
#Cleanup
Write-Host -Foreground Blue "Remove demo virtual host"
diff --git a/demos/Docker-PowerShell/Docker-PowerShell.ps1 b/demos/Docker-PowerShell/Docker-PowerShell.ps1
index 51b07f2d34..18eb844fd3 100644
--- a/demos/Docker-PowerShell/Docker-PowerShell.ps1
+++ b/demos/Docker-PowerShell/Docker-PowerShell.ps1
@@ -20,10 +20,10 @@ Run-ContainerImage hello-world # Linux
cls
# List all containers that have exited
-Get-Container | Where-Object State -eq "exited"
+Get-Container | Where-Object State -EQ "exited"
# That found the right one, so go ahead and remove it
-Get-Container | Where-Object State -eq "exited" | Remove-Container
+Get-Container | Where-Object State -EQ "exited" | Remove-Container
# Now remove the container image
Remove-ContainerImage hello-world
diff --git a/demos/SystemD/SystemD/SystemD.psm1 b/demos/SystemD/SystemD/SystemD.psm1
index 770451bdd0..d1bf0d8e89 100644
--- a/demos/SystemD/SystemD/SystemD.psm1
+++ b/demos/SystemD/SystemD/SystemD.psm1
@@ -11,7 +11,7 @@ Function Get-SystemDJournal {
$Result = & $sudocmd $cmd $journalctlParameters -o json --no-pager
Try
{
- $JSONResult = $Result|ConvertFrom-JSON
+ $JSONResult = $Result|ConvertFrom-Json
$JSONResult
}
Catch
diff --git a/demos/SystemD/journalctl-demo.ps1 b/demos/SystemD/journalctl-demo.ps1
index 1fe7198e4b..2597bdc3b6 100644
--- a/demos/SystemD/journalctl-demo.ps1
+++ b/demos/SystemD/journalctl-demo.ps1
@@ -4,9 +4,9 @@
Import-Module $PSScriptRoot/SystemD/SystemD.psm1
#list recent journal events
-Write-host -Foreground Blue "Get recent SystemD journal messages"
+Write-Host -Foreground Blue "Get recent SystemD journal messages"
Get-SystemDJournal -args "-xe" |Out-Host
#Drill into SystemD unit messages
-Write-host -Foreground Blue "Get recent SystemD journal messages for services and return Unit, Message"
-Get-SystemDJournal -args "-xe" | Where-Object {$_._SYSTEMD_UNIT -like "*.service"} | Format-Table _SYSTEMD_UNIT, MESSAGE | Select-Object -first 10 | Out-Host
+Write-Host -Foreground Blue "Get recent SystemD journal messages for services and return Unit, Message"
+Get-SystemDJournal -args "-xe" | Where-Object {$_._SYSTEMD_UNIT -like "*.service"} | Format-Table _SYSTEMD_UNIT, MESSAGE | Select-Object -First 10 | Out-Host
diff --git a/demos/python/class1.ps1 b/demos/python/class1.ps1
index d79e6c7ff2..b74c0c8d5d 100644
--- a/demos/python/class1.ps1
+++ b/demos/python/class1.ps1
@@ -10,5 +10,5 @@
# picking up the Python script from the same directory
#
-& $PSScriptRoot/class1.py | ConvertFrom-JSON
+& $PSScriptRoot/class1.py | ConvertFrom-Json
diff --git a/demos/python/demo_script.ps1 b/demos/python/demo_script.ps1
index dfa5bb5f6b..af2067642a 100644
--- a/demos/python/demo_script.ps1
+++ b/demos/python/demo_script.ps1
@@ -20,7 +20,7 @@ $data
@"
#!/usr/bin/python3
print('Hi!')
-"@ | out-file -encoding ascii hi
+"@ | Out-File -Encoding ascii hi
# Make it executable
chmod +x hi
@@ -35,7 +35,7 @@ cat class1.py
./class1.py
# Capture the data as structured objects (arrays and hashtables)
-$data = ./class1.py | ConvertFrom-JSON
+$data = ./class1.py | ConvertFrom-Json
# look at the first element of the returned array
$data[0]