> For the complete documentation index, see [llms.txt](https://www.osdeploy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.osdeploy.com/archive/pscloudscript/osd-powershell-module.md).

# OSD PowerShell Module

The OSD PowerShell Module contains some functions that can be helpful in working with a PSCloudScript

```powershell
Install-Module OSD -Force
```

## Get-GithubRawUrl

This function makes it easy to get the proper GitHub Raw URL for using with `Invoke-RestMethod` which can then be passed to `Invoke-Expression`

![](https://3996045416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDKRxGiKLYjW1gana2O%2Fuploads%2FWL9JzDeO5UWcqtFgKgCy%2Fimage.png?alt=media\&token=35d79c83-b54b-4781-8a01-c7d89ba10f90)

## Get-GithubRawContent

This function will resolve a GitHub URL to the GitHub Raw Url if necessary and return the content which can easily be passed to `Invoke-Expression`

![](https://3996045416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDKRxGiKLYjW1gana2O%2Fuploads%2FTTsweiJSUNcmuxdnoZjP%2Fimage.png?alt=media\&token=0d29e930-f0c8-4a8c-8dd9-1a26395b2563)

## ConvertTo-PSKeyVaultSecret

{% hint style="info" %}
**Requires PowerShell Module OSD 22.1.18+**
{% endhint %}

This function should make it easier to create an Azure Key Vault Secret. Make sure your PowerShell session is authenticated to Azure AD using an account with proper Azure Key Vault RBAC access

### FromUriContent (ParameterSet)

In this example a provided URL content is saved as a Key Vault Secret. If the content is in a GutHub Repo or GitHub Gist, the Raw URL will be resolve automatically

```powershell
ConvertTo-PSKeyVaultSecret -VaultName $VaultName -Name $SecretName -Uri $GitHubUri
```

![](https://3996045416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDKRxGiKLYjW1gana2O%2Fuploads%2FEWfKYFcbHl6L0gQ4VKfs%2Fimage.png?alt=media\&token=4741f9a3-28d2-4913-a04f-dc24781c7610)

One thing to mention is that a GitHub Gist with multiple files will be combined automatically into a single Azure Key Vault Secret

![](https://3996045416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDKRxGiKLYjW1gana2O%2Fuploads%2FvyLfYsas3TXJdsCpqKmH%2Fimage.png?alt=media\&token=fa3c9535-3f00-407d-b092-78a7ba8efb65)

![](https://3996045416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDKRxGiKLYjW1gana2O%2Fuploads%2FgkVKE53RyrCfzuV8pOSI%2Fimage.png?alt=media\&token=3a7f2b65-22f4-4ac1-8150-c25b6e970c7a)

### FromClipboard (ParameterSet)

You can simply Copy some text with `Ctrl+C` (which sets this in your Clipboard to Paste) and use the `-Clipboard` switch to convert the last item in your Clipboard as an Azure Key Vault Secret

```powershell
ConvertTo-PSKeyVaultSecret -VaultName $VaultName -Name $SecretName -Clipboard
```

![](https://3996045416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDKRxGiKLYjW1gana2O%2Fuploads%2FzuIfoClMNf5JOCAKGte1%2Fimage.png?alt=media\&token=499d21bb-5158-431d-a270-79e7e27edc28)

## Sponsor

OSDeploy is sponsored by [Recast Software](https://www.recastsoftware.com/?utm_source=osdeploy\&utm_medium=ad\&utm_campaign=web) and their Systems Management Tools

{% embed url="<https://www.recastsoftware.com/?utm_source=osdeploy&utm_medium=ad&utm_campaign=web>" %}
Sponsored by Recast Software
{% endembed %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.osdeploy.com/archive/pscloudscript/osd-powershell-module.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
