Symbolic Link Resource
Synopsis
Manages symbolic links on the local filesystem. Works on Windows, Linux, and macOS.
Type
Capabilities
- Get
- Set
- Delete
Properties
path
Path where the symbolic link should be created.
target
Target path that the symbolic link points to.
type
Link target type. Accepts File or Directory. Auto-detected if not specified.
_exist
Whether the link should exist.
Examples
Example 1 — Get a symbolic link
Example 2 — Create a symbolic link
Example 3 — Create a directory symbolic link (Windows)
Example 4 — Configuration document
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: Application symlink
type: OpenDsc.FileSystem/SymbolicLink
properties:
path: /usr/local/bin/myapp
target: /opt/myapp/bin/myapp
- name: Log directory link
type: OpenDsc.FileSystem/SymbolicLink
properties:
path: /var/log/myapp
target: /mnt/storage/logs/myapp
type: Directory
Exit codes
| Code | Description |
|---|---|
| 0 | Success |
| 1 | Error |
| 2 | Invalid JSON |
| 3 | Access denied |
| 4 | Invalid argument |
| 5 | IO error |
| 6 | Insufficient privileges |