> For the complete documentation index, see [llms.txt](https://documentation.2pintsoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.2pintsoftware.com/osd-toolkit/4.0/reference/command-line.md).

# Command line

Configuration Manager calls OSD Toolkit for downloads; there is nothing to run by hand for those. The other modes are run from task sequence steps or on the admin workstation.

| Command                                                                               | Where                                          | What it does                                                                        |
| ------------------------------------------------------------------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------- |
| `OSDToolkit.exe <SMSTSDownload.ini> <PackageID> <folder>`                             | Called by the task sequence engine             | Downloads one package into the folder                                               |
| `OSDToolkit.exe Prep <drive>:`                                                        | Windows PE, after **Apply Operating System**   | Stages OSD Toolkit and the StifleR client into the new OS                           |
| `OSDToolkit.exe Cache`                                                                | Full OS, after **Setup Windows and ConfigMgr** | Enables BranchCache and adds the content downloaded in Windows PE to the cache      |
| `Update-CustomBootImage.ps1 -Unattended -WimPath <boot.wim> -OptionalComponents None` | Admin workstation, elevated                    | Adds OSD Toolkit and, with `-StifleRSourcePath`, the StifleR client to a boot image |

## Download

```
OSDToolkit.exe <SMSTSDownload.ini> <PackageID> <folder>
```

The task sequence engine supplies all three arguments. If the INI file names a destination, it is used in place of `<folder>`. A download started outside a task sequence returns 1010, because the license variable cannot be read.

## Prep

```
OSDToolkit.exe Prep C:
```

The argument is the drive of the new OS as seen from Windows PE. Prep copies `OSDToolkit.exe` and `OSDToolkit-EnableBranchCache.ps1` into its `System32`, stages the StifleR client and carries the download records over. If it cannot load the registry of the new OS, for example because the drive letter is wrong, it returns the Windows error code.

## Cache

```
OSDToolkit.exe Cache
```

Runs `OSDToolkit-EnableBranchCache.ps1`, then adds the content under `C:\_SMSTaskSequence` to the BranchCache cache. The script sets BranchCache to distributed mode on port 1337 with a cache lifetime of 180 days, and adds the firewall rules.

## Update-CustomBootImage.ps1

The Boot Image Customizer. See [Unattended builds](https://documentation.2pintsoftware.com/osd-toolkit/4.0/installation/adding-osd-toolkit-to-the-boot-image/unattended-builds.md) for the parameters and exit codes.


---

# 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://documentation.2pintsoftware.com/osd-toolkit/4.0/reference/command-line.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.
