# Define the folder path you want to add
$profileBin = "$($env:UserProfile)\.bin"
# Exmaple: "C:\Users\\.bin"
# Check if the folder exists
if (-not (Test-Path -Path $profileBin)) {
# Create the folder if it does not exist
New-Item -ItemType Directory -Path $profileBin -Force
Write-Host "Folder '$profileBin' created."
} else {
Write-Host "Folder '$profileBin' already exists."
}
# Get the path to the PowerShell profile
$profileContent = Get-Content -Path $profile
$aliasCommand = "Set-Alias -Name intwin -Value `"$profileBin\IntuneWinAppUtil.exe`""
# Check if the alias command already exists in the profile, if not add it.
if ($profileContent -notcontains $aliasCommand) {
Add-Content -Path $profile -Value $aliasCommand
Write-Host "Alias added to the profile."
} else {
Write-Host "Alias already exists in the profile."
}
# Open the folder in File Explorer
write-host "Opening folder '$profileBin'..."
write-host "Copy the IntuneWinAppUtil.exe to this folder."
Invoke-Item $profileBin