change data type powershell

C++
[int]$var = (Get-DefaultAudioDeviceVolume).Replace("%","")

Source

Also in C++: