Skip to content

Commit

Permalink
main
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpchen committed Nov 28, 2024
1 parent 1189143 commit 116b668
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
17 changes: 17 additions & 0 deletions docs/document/Powershell/docs/Language/Control Flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,20 @@
>```ps1
>[bool]@() # False
>```
## Newline Indicator
## Command Chaining
### Multi-Command in Single Line
Use `;` to separate commands in the same line.
All commands are executed in order.
```ps1
cd ..; gci -rec -file; echo hello
```
### Chaining And & Or <Badge type="info" text="PowerShell 7+" />

In PowerShell 7, `&&` and `||` were introduced to do the same command chaining as bash does.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ And lastly the target type can be arbitrary since we don't need it, all we need

```ts twoslash
const foo = {
bar = 123,
baz = '123',
goo = [1, 2, 3],
foo = { foo = {} }
bar: 123,
baz: '123',
goo: [1, 2, 3],
foo: { foo: {} }
}

type KeyOfSingularTypedProperty<T> = keyof {
Expand Down

0 comments on commit 116b668

Please sign in to comment.