I already used Microsoft.SqlServer.Management.Smo.Login in Powershell to create SQL-login with no problem.
Just for the new SQL-login created, how could I use Powershell to set its permissions as image show below? (I want to set "View any database" to be "Deny").
Thanks heaps!

GRANTandDENYstatements instead of messing around with management objects.