Some of my laptops have a certain COM Port disabled by default and users have to remember to enable them every day when logging into their computers. I was trying to find a way to permanently enable the COM port so it wouldn't disable again after a reboot.
I have attempted to create a Scheduled Task at start up with the PowerShell script below:
Get-PnpDevice -FriendlyName “Communications Port (COM1)” | enable-PnpDevice
The issue is that this command needs confirmation after the script is ran. Is there a way to permanently enable a COM port without a PowerShell script, or is there a way to get the command above to run and confirm the action?
It would not let me include a screenshot of PowerShell, below is the command I am trying to schedule to run and automatically confirm as well:
Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Try the new cross-platform PowerShell https://aka.ms/pscore6 PS C:\Users\USER> Get-PnpDevice -FriendlyName "Communications Port (COM1)" | enable-PnpDevice
Confirm
Are you sure you want to perform this action? Performing the operation "Enable" on target "Win32_PnPEntity: Communications Port (COM1) (DeviceID = "ACPI\PNP0501\1")".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):