PowerShell set literalpath as parameter path

0_o

Trying execute that command: new-item -Path (Resolve-Path -LiteralPath "C:\Users\hittm\Downloads\openhardwaremonitor-v0.9.6\OpenHardwareMonitor\OpenHardwareMonitor.exe") -Name "OHW" -ItemType SymbolicLink

But getting error: enter image description here

In Microsoft docs they said that path is already "LiteralPath" but it not work. If i truing execute string in path param all works fine.

UPD: Problem is in wrong parameter here's correct code:

New-Item -Target 'C:\Users\hittm\Downloads\openhardwaremonitor-v0.9.6\OpenHardwareMonitor\OpenHardwareMonitor.exe' -Path .\OHW.lnk -ItemType SymbolicLink

0_o

Problem is in wrong parameter here's correct code:

New-Item -Target 'C:\Users\hittm\Downloads\openhardwaremonitor-v0.9.6\OpenHardwareMonitor\OpenHardwareMonitor.exe' -Path .\OHW.lnk -ItemType SymbolicLink

Parameter '-Path' in 'New-Item' command is parameter for result, for setting parameter to work with i need to use '-Target' instead

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

TOP Ranking

HotTag

Archive