Since you already have PowerShell logic that works as you confirmed and you just need to know how to get it to work from the login script, just append the logic example I provide below with your logic as needed. Just be sure that your logic to map the drives is run before this logic runs.
I provided the Setting up a Logon Script through Active Directory Users and Computers that you can review for more indepth detail of setting up a login script which is a relatively simple task.
If you're using a batch script, just append the logic to the end of the process as shown below. If you're using a VB Script, then see Run a VBScript file here to see the
objShell.Run "c:\batch\test.cmd" example but you'd create and point it to
Example Batch Login Script
I tested and confirmed that this works as expected in a domain environment on a Windows PC with a login script from a domain user account.
<your existing batch login script logic up here>
<you will ensure the logic to map the drives has already been run>
IF EXIST "%TmpPSScript%" DEL /Q /F "%TmpPSScript%"
ECHO $a = New-Object -ComObject shell.application >>"%TmpPSScript%"
ECHO $a.NameSpace( "H:\" ).self.name = "Homes" >>"%TmpPSScript%"
CD /D "%PowerShellDir%"
Powershell -ExecutionPolicy Bypass -Command "& '%TmpPSScript%'"