Once you have drives mapped, you need to manage them.
net use Z: /delete
For example:
Remove-PSDrive -Name "Z"