Skip to content

Commit b9a35ce

Browse files
committed
grrr
1 parent ca573e2 commit b9a35ce

File tree

23 files changed

+292
-2
lines changed

23 files changed

+292
-2
lines changed

docs/document/Powershell/docs/1.Overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
- Dynamic typing
44
- Case insensitive
5+
- Everything is object, more than plain text in shell.

docs/document/Powershell/docs/Alias.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ Get-Alias | Where-Object { $_.Options -match 'ReadOnly|Constant' }
4646
> [!note]
4747
> Do not use custom aliases for public repository.
4848
49+
> [!CAUTION]
50+
> Not all builtin aliases are available in all system. See [removed aliases](https://learn.microsoft.com/en-us/powershell/scripting/whats-new/unix-support?view=powershell-7.4#aliases-not-available-on-linux-or-macos)
51+
4952
## Differ from Bash
5053

5154
Alias in powershell is only a name alias for a command, it can never take any predetermined parameters or flags like in bash.

docs/document/Powershell/docs/Powershell as a Language/Array.md renamed to docs/document/Powershell/docs/Environment/1.Overview.md

File renamed without changes.

docs/document/Powershell/docs/File System/2.Working Directory.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ Alias sl -> Set-Location
2222

2323
There's two ways to get current working directory in Powershell.
2424

25-
- `$PWD` builtin string variable. Refreshes on each time location changed.
25+
- `$PWD` builtin `PathInfo` variable. Refreshes on each time location changed.
2626
- `Get-Location` cmdlet. Returns a `PathInfo` object.
2727
- `pwd` is an builtin alias for `Get-Location`.
2828

2929
```ps1
30-
(Get-Location).Path # equivelant to $pwd
30+
(Get-Location).Path # equivalent to $pwd
3131
```
3232

3333
```console
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Special Folders
2+
3+
## Home Directory
4+
5+
- `$HOME`
6+
- `$env:USERPROFILE`
7+
8+
## Temp Folder
9+
10+
- `$env:TMP`
11+
- `$env:TEMP`
12+
13+
## APPDATA
14+
15+
- `$env:APPDATA`
16+
17+
## LOCALAPPDATA
18+
19+
- `$env:LOCALAPPDATA`

docs/document/Powershell/docs/File System/3.Create Item.md renamed to docs/document/Powershell/docs/File System/4.Create Item.md

File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Write to File
2+
3+
4+
5+
## Redirection Operator
6+
7+
Redirection operator in powershell is a shorthand for `Out-File`, to mimic the same thing in bash.
8+
9+
```ps1
10+
ls > foo.txt
11+
# equivalent to
12+
ls | Out-File foo.txt
13+
```
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Serialization
2+
3+
> [!TIP]
4+
> For deserialization, see `gcm -Verb Import`
5+
6+
## JSON
7+
8+
```ps1
9+
ls | ConverTo-JSON
10+
ls | ConverTo-JSON > foo.json
11+
```
12+
13+
## XML
14+
15+
Powershell has a special xml format for itself called `Clixml`, this is specific to powershell.
16+
17+
```ps1
18+
ls | Export-Clixml foo.xml
19+
```
20+
21+
22+
## CSV
23+
24+
```ps1
25+
ls | ConverTo-Csv > foo.csv
26+
ls | Export-Csv foo.csv
27+
```
28+
29+
## HTML
30+
31+
## TXT

docs/document/Powershell/docs/Powershell as a Language/Comment.md renamed to docs/document/Powershell/docs/Language/Array.md

File renamed without changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Comment
2+
3+
## Single Line
4+
5+
## Multiple Lines
6+

0 commit comments

Comments
 (0)