Skip to content

Commit

Permalink
Merge pull request #412 from reubenmiller/docs-fix-session-examples
Browse files Browse the repository at this point in the history
docs(sessions): fix various powershell command errors
  • Loading branch information
reubenmiller authored Oct 23, 2024
2 parents aa45b6a + 0348791 commit 9c6da5e
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions docs/go-c8y-cli/docs/concepts/sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ You can also provide additional flags to set session, as these are passed direct

If you wish to manage your sessions manually, then you can set the `C8Y_SESSION` environment variable to an existing json session file.

<CodeExample>
<CodeExample transform="false">

```bash
export C8Y_SESSION=~/.cumulocity/my-settings01.json
Expand All @@ -104,6 +104,10 @@ export C8Y_SESSION=~/.cumulocity/my-settings01.json
$env:C8Y_SESSION = "~/.cumulocity/my-settings01.json"
```

```powershell
$env:C8Y_SESSION = "~/.cumulocity/my-settings01.json"
```

</CodeExample>

### Session file format
Expand Down Expand Up @@ -198,7 +202,7 @@ The following shows how the functions can be controlled via session settings:

When the commands are disabled in the session settings, they can be temporarily activated on the console by using the following command:

<CodeExample>
<CodeExample transform="false">

```bash
eval $( c8y settings update mode dev --shell auto )
Expand All @@ -208,14 +212,18 @@ eval $( c8y settings update mode dev --shell auto )
c8y settings update mode dev --shell auto | Out-String | Invoke-Expression
```

```powershell
c8y settings update mode dev --shell auto | Out-String | Invoke-Expression
```

</CodeExample>


The commands will remain enabled until the next time you call `set-session`.

Afterwards you can disable them again using:

<CodeExample>
<CodeExample transform="false">

```bash
eval $( c8y settings update mode prod --shell auto )
Expand All @@ -225,6 +233,10 @@ eval $( c8y settings update mode prod --shell auto )
c8y settings update mode prod --shell auto | Out-String | Invoke-Expression
```

```powershell
c8y settings update mode prod --shell auto | Out-String | Invoke-Expression
```

</CodeExample>

## Using encryption in Cumulocity session files
Expand Down Expand Up @@ -375,6 +387,13 @@ c8y settings list --select session.home
$myhome = c8y settings list --select session.home --output csv
```

```powershell
c8y settings list --select session.home
# or if you want to write it to a variable
$myhome = c8y settings list --select session.home --output csv
```

</CodeExample>

```bash title="Output"
Expand All @@ -393,7 +412,7 @@ vim ~/.cumulocity/my-manual-file.json
```

```powershell
# using VSCode
# Using VSCode
code ~/.cumulocity/my-manual-file.json
```

Expand Down

0 comments on commit 9c6da5e

Please sign in to comment.