10 октября 2023
В 2018 г. появилось программное обеспечение PowerShell Core 6.0 как кроссплатформенный инструмент автоматизации для операционных систем Windows, Linux и MacOS. PowerShell Core имеет открытый исходный код и работает на платформе .NET Core 2.x, в отличии от предыдущих версий, работающих на .NET Framework.
В статье представлен обзор, как изменилось использование PowerShell с версии 6 до последнего обновления 7.x.
Вступление
Переход на PowerShell Core требовался для обеспечения кроссплатформенности продукта, но при этом привел к снижению функциональности, стабильности и надежности. Кроме того, пользователи столкнулись с проблемами совместимости с существующими модулями Windows PowerShell.
- Не поддерживаются уже привычные решения:
- Возможность параллельного выполнения команд с помощью workflows.
- Нет поддержки WMI v1 и соответственно не работают командлеты Get-WmiObject, Invoke-WmiMethod, Register-WmiEvent и т.д.
- Исчезли командлеты связанные с графическим отображением такие, как Out-GridView, Show-Command и параметр -ShowWindow
- Не работают модули ActiveDirectory и DnsClient.
It’s being used in every PowerShell session, the PowerShell Profile. In this blog post, I will show you what it does, what you can use it for, and how I use it.
I have multiple Hyper-V Vms on my laptop for testing purposes. Sometimes, you need to update those or check things, and you can do this using PowerShell Direct. In this blog post, I will show you how to use PowerShell Direct with a few examples.
I need a VM connected to the customer’s tenant for Endpoint Manager testing. This involves deploying a Windows 10 or 11 VM, changing hardware settings (Secure Boot/TPM/Checkpoint settings), and registering it for Autopilot. This blog post will show you how to automate the process as much as possible.
I used VMware Workstation for a while, which can automatically compact the virtual hard disk after shutting down the VM, an excellent way of freeing up space on my laptop hard drive. But I switched to using only Hyper-V now. Compacting virtual hard disks is not something you can enable in Hyper-V to run automatically. In this blog post, I will show you how to do this using a script that you can use to do that easily. 🙂
AlexHeylin
- Veeam Legend
- Posts: 563
- Liked:
- Joined: Nov 15, 2019 4:09 pm
- Full Name: Alex Heylin
- Contact:
PowerShell Direct won’t work on Win Svr 2022?
On case #07111205 I just got told v2.0 exactly is required. Please can the source of this info be hunted down and corrected.
Three days so far and still no PowerShell Direct on Win Svr 2022. I didn’t need to lose another day to incorrect information from support team.
If anyone has time to take a look at this case I’d be grateful because so far it looks like either the non-persistent agent executables are corrupted (and didn’t get replaced by a v12.0 -> v12.1.1.56 upgrade), or they don’t work on Win Svr 2022 VMs as it keeps insisting it can’t find the VeeamVssSupport service which is installed and running (or at least is left installed and running after PowerShell Direct “fails” according to VBR)
Code: Select all
01/02/2024 03:31:22 5564 INFO ================================================================================================
01/02/2024 03:31:22 5564 INFO User: WIN-NEJ8D3EUCL6\Administrator
01/02/2024 03:31:22 5564 INFO VeeamVixProxy started.
01/02/2024 03:31:22 5564 Command line: ["C:\Users\administrator\AppData\Local\Temp\VeeamVixProxy_tmpDB3F.exe" -func UnregisterService -out C:\Users\administrator\AppData\Local\Temp\tmpEB42.tmp -svcname VeeamVssSupport -scmoptimeout 600000 ]
01/02/2024 03:31:22 5564 Unregistring service [VeeamVssSupport]
01/02/2024 03:31:22 5564 ERR Error:
01/02/2024 03:31:22 5564 ERR Cannot open service. Machine: []. Service name: [VeeamVssSupport].
01/02/2024 03:31:22 5564 ERR Cannot open service.
01/02/2024 03:31:22 5564 ERR Win32 error:The specified service does not exist as an installed service.
01/02/2024 03:31:22 5564 ERR Code: 1060
01/02/2024 03:31:22 5476 INFO ================================================================================================
I find this very suspicious. Why is the machine field empty? Why not the name of the guest machine, or at least ‘.’ to indicate “this machine”?
AlexHeylin
- Veeam Legend
- Posts: 563
- Liked:
- Joined: Nov 15, 2019 4:09 pm
- Full Name: Alex Heylin
- Contact:
Re: PowerShell Direct won’t work on Win Svr 2022?
by AlexHeylin »
For clarity – PowerShell Direct itself works perfectly. VBR uses it to access the VMs, installs the VeeamVssSupport service (which it leaves there) then says PowerShell Direct is not working.
AlexHeylin
- Veeam Legend
- Posts: 563
- Liked:
- Joined: Nov 15, 2019 4:09 pm
- Full Name: Alex Heylin
- Contact:
Re: PowerShell Direct won’t work on Win Svr 2022?
by AlexHeylin »
The multiple VMs we have in our own infrastructure which are being backed up using PowerShell Direct are all 2019 or earlier. The one 2022 VM we have being backed up appears to be injecting over the network but the log is not explicit (which is suboptimal).
Who is online
The guest interaction proxy functionality is included in the Veeam Universal License. When using a legacy socket-based license, Enterprise or higher edition is required. |
The guest interaction proxy allows you to communicate with the VM guest OS even if the backup server and processed VM run in different networks.
The guest interaction proxy deploys the non-persistent runtime components or persistent agent components only in Microsoft Windows VMs. In VMs with another guest OS, the non-persistent runtime components or persistent agent components are deployed by the backup server. |
- Guest file system indexing
- Transaction logs processing
Guest Interaction Proxy Deployment
You can use multiple guest interaction proxies to improve performance. Multiple guest interaction proxies will deploy non-persistent runtime components or persistent agent components in VMs faster compared to the same operation performed by one guest interaction proxy.
In a backup infrastructure with multiple remote sites, you can deploy a guest interaction proxy in each site. This can reduce load on the backup server and produce less traffic between the backup server and remote site.
Requirements for Guest Interaction Proxy
- The role of a guest interaction proxy can be assigned to a Microsoft Windows server (physical or virtual).
- You must add the machine to the console as a managed server.
- Guest interaction proxy must have a LAN connection to the VM that will be backed up or replicated.
- If you plan to use PowerShell Direct connection to back up VMs that reside on Server 2016 (or later) and run Microsoft Windows 10 (or later) or Microsoft Windows Server 2016 (or later), the guest interaction proxy must have Microsoft PowerShell 2.0 (or later) installed.
The guest interaction proxy role can be performed by any machine that meets the requirements, including backup proxy, backup repository, WAN accelerator, Microsoft Hyper-V host or backup server.
Guest Interaction Proxy Selection
When you add a Microsoft Windows machine to the backup infrastructure, Veeam Backup & Replication deploys Veeam Data Mover on it. Veeam Data Mover includes the components responsible for deployment of non-persistent runtime components or persistent agent components during guest OS interaction.
- A machine in the same network as the protected VM that does not perform the backup server role.
- A machine in the same network as the protected VM that performs the backup server role.
- A machine in another network that does not perform the backup server role.
- A machine in another network that performs the backup server role.
If Veeam Backup & Replication finds several available machines of equal priority, it selects the less loaded machine. The load is defined by the number of tasks that the machine already performs.
Failover from Guest Interaction Proxy to Backup Server
If the guest interaction proxy fails to connect to a Microsoft Windows VM, the guest interaction proxy will not be able to access the VM and deploy non-persistent runtime components or persistent agent components in it. In this case, the backup server will take over the role of guest interaction proxy and deploy the non-persistent runtime components or persistent agent components in the VM.
Хотите преподавать в АйТи Клауд?
Если вы имеете компетенции и хотите работать тренером курсов в АйТи Клауд – оставьте ваши данные, мы свяжемся с вами!
2
PowerShell 7.2 — это следующий выпуск Long Term Servicing (LTS) на основе .NET 6.0.
Новые возможности, обновления и критические изменения:
- Добавлены новые универсальные пакеты установщика для большинства поддерживаемых дистрибутивов Linux.
- Включена поддержка Центра обновления Майкрософт в Windows.
- Добавлены две новые экспериментальные возможности.
– Улучшена поддержка передачи аргументов собственных команд.
– Включена поддержка цвета в ANSI для FileInfo.
- Улучшены варианты заполнения нажатием клавиши TAB.
- Семь экспериментальных функций стали основными, одна удалена.
- Платформа DSC отделена от PowerShell 7, чтобы обеспечить возможность внесения будущих улучшений.
- Несколько критических изменений для повышения удобства использования.
Курсы к статье
Будьте в курсе всех событий
Затрудняетесь
с выбором курса?
Оставьте заявку на консультацию
1
Осенью 2020 г. вышла общедоступная версия PowerShell 7.1, основанная на .NET 5.0.
В этой версии появился ряд новых функций и обновлений:
- PSReadLine 2.1.0 с прогнозной технологией IntelliSense
- Версия PowerShell 7.1 опубликована в Microsoft Store.
- Пакеты установщика обновлены для новых версий ОС с поддержкой ARM64.
- 2 экспериментальные функции PSNullConditionalOperators и PSUnixFileStat стали основными.
- Добавлены 4 экспериментальные функции Microsoft.PowerShell.Utility.PSManageBreakpointsInRunspace, PSNativePSPathResolution, PSCultureInvariantReplaceOperator и PSSubsystemPluginModel.
3
В начале 2023 г. появилась версия PowerShell 7.3, основанная на .NET 7.0.
Некоторые критические изменения в новой версии:
- PowerShell 7.3 не работает в Windows 7.
- PowerShell Direct для Hyper-V поддерживается только в Windows 10, версия 1809 и более поздних версиях.
- Test-Connection не работает из-за намеренного критического изменения в .NET 7
- Перемещение определения данных типа System.Security.AccessControl.ObjectSecurity в модуль Microsoft.PowerShell.Security.
- Дополнительные улучшения заполнения нажатием клавиши TAB.
- Улучшена обработка ошибок.
- Улучшены сеансы и удаленное взаимодействие.
- Обновлены ряд командлетов.
- Добавлены новые экспериментальные функции.
УЦ АйТи Клауд по направлению системное администрирование, сетевые технологии, безопасность сетей
0
В начале 2020 г. компания Microsoft выпустила PowerShell 7.0. В этом программном обеспечении удалось решить большую часть проблем 6-ой версии. 7-ая версия основана на .NET Core 3.x, где поддерживается множество API .NET Framework, обеспечивая обратную совместимость с более 90% существующих модулей Windows PowerShell. Теперь поддерживаются модули ActiveDirectory, DnsClient, DnsServer, BitLocker, BranchCache, Defender, Hyper-V и многие другие, полный список которых приводится на сайте Microsoft.
Вернулись командлеты требующие графическую функциональность, такие как Out-GridView и Show-Command. Повысилась стабильность и производительность.
В PowerShell 7.0 появились новые функции, в том числе:
- параллелизация конвейера с помощью ForEach-Object -Parallel;
- новые операторы:
- упрощенное динамическое представление ошибок и командлет Get-Error для более легкого анализа ошибок;
- автоматические уведомления о новых версиях;
- возможность вызывать ресурсы DSC непосредственно из PowerShell 7.
Жизненый цикл PowerShell 7.0 теперь соответствует политике жизненного цикла поддержки .NET Core и включает выпуски Long Term Service и non-Long Term Service.