I'm preparing laptops with Autopilot Intune Enrollment but we need to import hash in Endpoint automatically We got multiples command lines to enter in cmd, look like that
powershell
Set-Executionpolicy Bypass
Install-Script -Name Get-WindowsAutoPilotInfo
Get-WindowsAutopilotInfo.ps1 -Online -Assign
Issue here, the line with Install-Script
always ask for 3 differents prompts :
Twice "y" to enter and once "a" at the end
But we lose too much time doing this for each laptop.
So I tried implement echo
command and it's look like that :
powershell
Set-Executionpolicy Bypass
echo "y" | Install-Script -Name Get-WindowsAutoPilotInfo
echo "y" | Install-Script -Name Get-WindowsAutoPilotInfo
echo "a" | Install-Script -Name Get-WindowsAutoPilotInfo
Get-WindowsAutopilotInfo.ps1 -Online -Assign
But it's not working and I can't figured out why, even if I've tryed different type of configurations for this.
Anybody had ideas ? I'm not very confident in powershell unfortunately to solve it by myself
Thanks in advance !