PowerShell
Restart-MsSqlServer
Start-Process -Wait -Verb RunAs `
-FilePath powershell `
-ArgumentList @('-Command', 'Restart-Service -Name MSSQLSERVER')
Get-MonthNames
function Set-CurrentCulture([System.Globalization.CultureInfo] $culture) {
[System.Threading.Thread]::CurrentThread.CurrentUICulture = $culture
[System.Threading.Thread]::CurrentThread.CurrentCulture = $culture
}
function Get-MonthNames() {
$currentCulture = Get-Culture
Set-CurrentCulture 'pl-PL'
Write-Host 'Polski'
(1..12) | ForEach-Object { Get-Date -Month $_ -Format "MM MMMM" } | Out-Host
Set-CurrentCulture 'en-US'
Write-Host 'English'
(1..12) | ForEach-Object { Get-Date -Month $_ -Format "MM MMMM" } | Out-Host
Set-CurrentCulture $currentCulture
}