powershell : changing the culture of current session

Have a look here: http://blogs.msdn.com/b/powershell/archive/2006/04/25/583235.aspx and here: http://poshcode.org/2226: function Set-Culture([System.Globalization.CultureInfo] $culture) { [System.Threading.Thread]::CurrentThread.CurrentUICulture = $culture [System.Threading.Thread]::CurrentThread.CurrentCulture = $culture } Additional Info To find which values can be used for $culture: This will give you a list of Culture Types: [Enum]::GetValues([System.Globalization.CultureTypes]) Selecting one of the above types (e.g. AllCultures) you can then list the available values … Read more

List hidden sub-directories and sizes

The -Force argument for Get-ChildItem will cause it to include hidden files and directories. Get-ChildItem -Force | Where-Object { $_.PSIsContainer } | ForEach-Object { $_.Name + “: ” + “{0:N2}” -f ((Get-ChildItem $_ -Recurse -Force | Measure-Object Length -Sum -ErrorAction SilentlyContinue).Sum / 1MB) + ” MB” }

What security setting is preventing Remote PowerShell 2.0 from accessing UNC paths

To get this to work, you must configure both your local and remote computers. On the remote server, run the following command: Enable-WSManCredSSP -Role server You’ll know things are confgured correctly if you run the Get-WSManCredSSP cmdlet and get the following output: The machine is not configured to allow delegating fresh credentials. This computer is … Read more

PowerShell The term is not recognized as cmdlet function script file or operable program

You first have to ‘dot’ source the script, so for you : . .\Get-NetworkStatistics.ps1 The first ‘dot’ asks PowerShell to load the script file into your PowerShell environment, not to start it. You should also use set-ExecutionPolicy Unrestricted or set-ExecutionPolicy AllSigned see(the Execution Policy instructions).

Can’t install nuget package because of “Failed to initialize the PowerShell host”

Setting an execution policy to RemoteSigned or Unrestricted should work. It must be changed under an administrator mode via a PowerShell console. Be aware that changes will be applied according to the bit version of the PowerShell console, so 32bit or 64 bit. So if you want to install a package in Visual Studio (32 … Read more