> For the complete documentation index, see [llms.txt](https://www.osdcloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.osdcloud.com/osdcloud-v1/osdcloud-azure/deep-dive/cloud-functions-and-scripts.md). Agents can also search and read this documentation through its [MCP server](https://www.osdcloud.com/~gitbook/mcp).

# Cloud Functions and Scripts

OSDCloud Functions are used to simplify the OSD Process in WinPE and OOBE.  Storing these functions online allows for easy updates without requiring downloading PowerShell Modules or constantly updating WinPE

To import OSDCloud Functions, use the following command

```powershell
iex (irm functions.osdcloud.com)
```

If the OSDCloud functions loaded successfully, you should see version information and the PowerShell Prompt will change to show `[OSDCloud]:`  These functions exist in the current PowerShell session and are unloaded by closing the current PowerShell session

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FyYyo8nxADhcfEw0kCV0m%2Fimage.png?alt=media\&token=7408b4ed-5361-48a3-9525-d9e6d85da2b3)

## Available Functions

Most OSDCloud Functions start with an osdcloud prefix.  You can view these in the current PowerShell session by running the following command

```powershell
Get-Command osdcloud*
```

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FxrcLnku2K2JcyzRuAq4t%2Fimage.png?alt=media\&token=5b526805-67b5-4e60-b627-edd0093f19b6)

## Why use OSDCloud Functions?

The best example that I can give is that it makes OSDCloud universal.  This allows you to use OSDCloud on any WinPE Boot Image that has PowerShell.  If you have an OSDCloud Boot Image that was created last December, well before OSDCloud Azure, there isn't a need to update the Boot Image since it will self update as part of the OSDCloud Azure deployment

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2Fb6sFY2IQa22gylCbiMWg%2Fimage.png?alt=media\&token=ebd23874-a0a8-41b0-b746-a652f81c151f)

Additionally, OSDCloud Functions allows for faster development, and it ensures you are always running the latest version.  To access Azure, you need to be online, so updating OSDCloud components works perfectly in this situation

## Sponsor

{% embed url="<https://www.recastsoftware.com/?utm_source=osdeploy&utm_medium=ad&utm_campaign=web>" %}
OSDeploy is 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.osdcloud.com/osdcloud-v1/osdcloud-azure/deep-dive/cloud-functions-and-scripts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
