WScript is ancient and can't properly deal with unicode, so we'll use the newer ShellLink interface. Since it can only modify existing lnk files, we'll create a temporary empty lnk with WScript first.
function Create-Lnk(
[Parameter(Mandatory=$true)]
[ValidateScript({Test-Path -IsValid -Literal $_})]
[string]$lnk,
[Parameter(Mandatory=$true)]
[ValidateScript({Test-Path -Literal $_})]
[string]$target,
[string]$arguments = '',
[string]$description = '',
[string]$workingDir = '',
[ValidateSet('normal', 'minimized', 'maximized')]
[string]$windowState
) {
$tmpName = [IO.Path]::GetRandomFileName() + '.lnk'
$tmpFolder = $env:TEMP
$tmpFullPath = Join-Path $tmpFolder $tmpName
$ws_shell = New-Object -com WScript.Shell
$shortcut = $ws_shell.CreateShortcut($tmpFullPath)
$shortcut.Save()
$shellApp = New-Object -com Shell.Application
$shellLink = $shellApp.NameSpace($tmpFolder).ParseName($tmpName).GetLink()
$shellLink.Path = $target
$shellLink.Arguments = $arguments
$shellLink.Description = $description
$shellLink.WorkingDirectory = $workingDir
$shellLink.ShowCommand = switch($windowState){'minimized'{2} 'maximized'{3} default{1}}
$shellLink.Save()
move -literal $tmpFullPath $lnk -force
}
Example:
Create-Lnk -lnk (Join-Path ([Environment]::GetFolderPath('Desktop')) 'пишижиши.lnk') `
-target 'D:\lost in translation\なんでやねん!.txt' `
-description '¿Por qué dices eso?'