From e47099866bee5e5f6d2852f4e4cbf92e4d4b0053 Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Wed, 6 Jan 2016 03:17:33 +0800 Subject: Fix formatting. --- powershell.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'powershell.html.markdown') diff --git a/powershell.html.markdown b/powershell.html.markdown index 4bc1ab39..8920d254 100644 --- a/powershell.html.markdown +++ b/powershell.html.markdown @@ -18,6 +18,7 @@ rather than plain text. [Read more here.](https://technet.microsoft.com/en-us/library/bb978526.aspx) If you are uncertain about your environment: + ``` Get-ExecutionPolicy -List Set-ExecutionPolicy AllSigned @@ -33,6 +34,7 @@ $PSVersionTable ``` Getting help: + ``` # Find commands Get-Command about_* # alias: gcm @@ -49,6 +51,7 @@ Update-Help # Run as admin ``` The tutorial starts here: + ``` # As you already figured, comments start with # @@ -292,6 +295,7 @@ $Shortcut.Save() Configuring your shell + ``` # $Profile is the full path for your `Microsoft.PowerShell_profile.ps1` # All code there will be executed when the PS session starts -- cgit v1.2.3 From e4e737c37125ed831b8f4d24d2d4953814ef9722 Mon Sep 17 00:00:00 2001 From: Laoujin Date: Fri, 8 Jan 2016 19:50:57 +0100 Subject: [PowerShell/en]: fixed typos/layout. Added some extra aliases/info. --- powershell.html.markdown | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'powershell.html.markdown') diff --git a/powershell.html.markdown b/powershell.html.markdown index 8920d254..fc944b85 100644 --- a/powershell.html.markdown +++ b/powershell.html.markdown @@ -247,10 +247,12 @@ function New-Website() { [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') # Note that .NET functions MUST be called with parentheses -# while PS functions CANNOT be called with parentheses +# while PS functions CANNOT be called with parentheses. +# If you do call a cmdlet/PS function with parentheses, +# it is the same as passing a single parameter list $writer = New-Object System.IO.StreamWriter($path, $true) $writer.Write([Environment]::NewLine) -$write.Dispose() +$writer.Dispose() ### IO # Reading a value from input: @@ -268,12 +270,14 @@ Get-Command ConvertTo-*,ConvertFrom-* # Refresh your PATH $env:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User") + # Find Python in path $env:PATH.Split(";") | Where-Object { $_ -like "*python*"} # Change working directory without having to remember previous path Push-Location c:\temp # change working directory to c:\temp Pop-Location # change back to previous working directory +# Aliases are: pushd and popd # Unblock a directory after download Get-ChildItem -Recurse | Unblock-File @@ -308,6 +312,7 @@ if (-not (Test-Path $Profile)) { ``` Interesting Projects + * [Channel9](https://channel9.msdn.com/Search?term=powershell%20pipeline#ch9Search&lang-en=en) PowerShell tutorials * [PSGet](https://github.com/psget/psget) NuGet for PowerShell * [PSReadLine](https://github.com/lzybkr/PSReadLine/) A bash inspired readline implementation for PowerShell (So good that it now ships with Windows10 by default!) @@ -318,6 +323,7 @@ Interesting Projects * [PowerShell Community Extensions](http://pscx.codeplex.com/) (Dead) Not covered + * WMI: Windows Management Intrumentation (Get-CimInstance) * Multitasking: Start-Job -scriptBlock {...}, * Code Signing -- cgit v1.2.3