このエラーをスローし続ける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
コマンドレットを実行する前に、コマンドレットがサポートされているかどうかをテストする簡単な方法はありますか?コマンドレットの周りにtrycatchをスローできることは知っていますが、このアプローチは単純なチェックに比べてかなりコストがかかるようです。
ありがとう