我有一个不断抛出此错误的 powershell 脚本
Get-ComputerRestorePoint : This functionality is not supported on this operating system.
At line:1 char:25
+ Get-ComputerRestorePoint <<<<
+ CategoryInfo : InvalidOperation: (:) [Get-ComputerRestorePoint], ArgumentException
+ FullyQualifiedErrorId : GetComputerRestorePointNotSupported,Microsoft.PowerShell.Commands.GetComputerRestorePoin
tCommand
是否有一种简单的方法可以在运行之前测试 cmdlet 是否受支持?我知道我可以在 cmdlet 周围抛出一个 try catch,但与简单的检查相比,这种方法似乎相当昂贵。
谢谢