Add to Technorati Favorites
Welcome to ThePowerShellGuy.com Sign in | Join | Help

Hey PowerShellGuy !, How Can I Determine the Currency Symbol in Use on a Computer?

From the Scripting Son article  : How Can I Determine the Currency Symbol in Use on a Computer? 

3 ways to do the same in PowerShell : 

(gp 'hkcu:\Control panel\International').sCurrency

(get-culture).NumberFormat.CurrencySymbol

 '{0:c}' -f 1

And yes we can do it remote also :

$Computer = 'Mow2008' 

[Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('CurrentUser',$computer).OpenSubKey('Control panel\International').GetValue('sCurrency')

Or of course use the registry provider as I show below, only problem in all cases, when you are in the Euro region, as I am,  in Asci there is no euro symbol so you get only a question mark instead (as in the original ;-) )  :

PS HKCU:\Control panel\International> gp . sCurrency

sCurrency
---------
?

Enjoy,

Greetings /\/\o\/\/

Published Friday, April 04, 2008 7:33 PM by MoW
Filed under: , ,

Comments

# re: Hey PowerShellGuy !, How Can I Determine the Currency Symbol in Use on a Computer?

Hi Mow

This should not be an ASCII issue, as PowerShell and .Net are UNICODE-based. Try changing the font of your PowerShell from Raster Fonts to Lucida Console, and voilà, the Euro-sign is displayed.

Per

Saturday, April 05, 2008 8:32 AM by perost
Anonymous comments are disabled