ansible/lib/ansible/executor/powershell/powershell_expand_user.ps1
Jordan Borean 75f7b2267d
Add support for Windows App Control/WDAC (#84898)
* Add support for Windows App Control/WDAC

Adds preview support for Windows App Control, formerly known as WDAC.
This is a tech preview feature and is designed to test out improvements
needed in future versions of Ansible.

* Use psd1 and parse it through the Ast to avoid any unexpected execution results

* Add tests for various manifest permutations

* Ignore test shebang failure

* Apply suggestions from code review

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

* Use more flexible test expectations

* Add type annotations for shell functions

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2025-05-21 12:28:58 +10:00

21 lines
446 B
PowerShell

# (c) 2025 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]
$Path
)
$userProfile = [Environment]::GetFolderPath([Environment+SpecialFolder]::UserProfile)
if ($Path -eq '~') {
$userProfile
}
elseif ($Path.StartsWith(('~\'))) {
Join-Path -Path $userProfile -ChildPath $Path.Substring(2)
}
else {
$Path
}