查詢 Microsoft Graph Powershell Command Permission Requirement
(Find-MgGraphCommand -Command Command-Let).permissions
查詢 Microsoft Graph Powershell Command Permission Requirement
(Find-MgGraphCommand -Command Command-Let).permissions
將 Hyper-V VM 的 GUID 寫到 Notes 裡方便查詢:
$VMs = (Get-VM | Select-Object VMName,VMId);
foreach ($VM in $VMs) {
Set-VM -Name $VM.VMName -Notes ('GUID: ' + $VM.VMId)
};
[string]$StringToEncode="編碼的字串"
$EncodedString=[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($StringToEncode))
write-host "Encoded String:" $EncodedString
$DecodedString=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($EncodedString))
write-host "Decoded String:" $DecodedString
PowerShell 將字串單字第一個字母轉換為大寫,其他小寫
$String = ('this is a book');
(Get-Culture).TextInfo.ToTitleCase( $String.ToLower() )