> For the complete documentation index, see [llms.txt](https://krw.gitbook.io/cb19/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://krw.gitbook.io/cb19/novosti/vsyakie-prochie-zametki/powershell-notes.md).

# Powershell notes

Пометки на полях про Powershell - Powershell notes

**Конвертация Powershell CP1252 - CP1251**

Ситуация: Powershell получает строку в Win-1251, но воспринимает ее как Win-1252, и отображает некорректно. Например, строка Ïðèøëî - это "пришло"

Решение:

$Short01 = "Ïðèøëî"&#x20;

$Short02 = "пришло"&#x20;

$enc1251 = \[System.Text.Encoding]::GetEncoding("windows-1251")&#x20;

$enc1252 = \[System.Text.Encoding]::GetEncoding("windows-1252")

$Conv\_Short01 = $enc1252.GetBytes($Short01) $enc1251.GetString($Conv\_Short01)
