powershell 从日历中删除约会

DeleteAppointments.ps1
 Search-Mailbox -Identity thebunker@worksighted.com -SearchQuery 'kind:meetings AND from:austin@worksighted.com AND Subject:PM Project Status Updates - Every 2 weeks' -TargetFolder 'austin' -TargetMailbox 'matt.scott@worksighted.com' -DeleteContent

powershell 获取Azure AD中的所有来宾帐户

guestAccounts
Get-AzureADUser -All $True |where {$_.UserType -eq 'Guest'} |Select DisplayName, UserPrincipalName, AccountEnabled, mail, UserType |Export-csv "AzureGuestUsers.csv" -NoTypeInformation

powershell powershell:安装RSAT win10 1903

rsat.ps1
#Установка компонентов RSAT на windows 10 1903
Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability -Online

powershell 从PowerShell访问SQLite

access_sqlite_from_powershell.ps1
[Reflection.Assembly]::LoadFile("C:\Program Files\PackageManagement\NuGet\Packages\System.Data.SQLite.Core.1.0.111.0\lib\net46\System.Data.SQLite.dll")
$sqlite = New-Object System.Data.SQLite.SQLiteConnection
$sqlite.ConnectionString = "Data Source = C:\Users\shskw\OneDrive\ドキュメント\test.db"
$sqlcmd = New-Object System.Data.SQLite.SQLiteCommand
$sqlcmd.Connection = $sqlite
$sqlite.Open()

# SQLiteのバージョン表示
$sql = "SELECT sqlite_version()"
$sqlcmd.CommandText = $sql
$rs =  $sqlcmd.ExecuteReader()
while ($rs.Read()){
  $rs[0]
}

# SQLiteCommandの破棄
# これをしないと、以下のSQL発行で以下の例外メッセージが表示され中断される
# "DataReader already active on this command"
$sqlcmd.Dispose()
$sql = "CREATE TABLE t1 (name, ostype)"
$sqlcmd.CommandText = $sql
$ret = $sqlcmd.ExecuteNonQuery()

# INSERT実行
$ins_data = @(@("Windows10","Windows"),@("Ubuntu","Linux"),@("FreeBSD","BSD"))
$ins_data | % {
  $name  =$_[0];
  $ostype=$_[1];
  $sql="INSERT INTO t1 VALUES('${name}','${ostype}')"
  $sqlcmd.CommandText = $sql
  $ret = $sqlcmd.ExecuteNonQuery()
}

# SELECT実行および表示
$sql = "SELECT * FROM t1"
$sqlcmd.CommandText = $sql
$rs =  $sqlcmd.ExecuteReader()
while ($rs.Read()){
  Write-Host ("|{0,-12}|{1,-12}|" -f $rs[0], $rs[1])
}

# SQLiteの切断
$sqlcmd.Dispose()
$sqlite.Close()

powershell install_chocolatey.ps1

install_chocolatey.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

powershell instalar_chocolatey.ps1

instalar_chocolatey.ps1
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

powershell Demo.ps1

用于简单查看PowerShell中的颜色和热键

ColorDemo.ps1

function ColorDemo {
    [CmdletBinding(DefaultParameterSetName = 'Demo')]
    param(
        [Parameter(Mandatory = $false, ParameterSetName = 'Demo')]
        [switch]$Demo
    )

    if ($PSCmdlet.ParameterSetName -eq 'Demo') {
        $Count = 1
        @(
            'Black', 'White ', 'Magenta ', 'DarkMagenta',
            'Gray ', 'Yellow', 'DarkCyan', 'DarkRed    ',
            'Cyan ', 'Green ', 'DarkBlue', 'DarkGreen  ',
            'Blue ', 'Red   ', 'DarkGray', 'DarkYellow '
        ) | ForEach-Object {
            Write-Host "  $_ : " -ForegroundColor 'White' -NoNewline;
            Write-Host '█' -ForegroundColor $_ -NoNewline;
            if (($Count % 4) -eq 0 ) { '' }; $Count++
        }
    }
}

ColorDemo

powershell Azure CDN

general note.md
It can be hosted in Azure or any other location.

# Origins

With Azure CDN, you can cache static objects loaded from Azure Blob storage, a web application, or any publicly accessible web server, 
by using the closest point of presence (POP) server. 

Azure CDN can also accelerate dynamic content, which cannot be cached, by leveraging various network and routing optimizations.

# Profiles

You need to create at least one CDN profile, which is a collection of CDN endpoints.
Every CDN endpoint represents a specific configuration of content delivery behavior and access.

# Optimisation

CDN can optimize the delivery experience based on the type of content you have.
The content can be a website, a live stream, a video, or a large file for download.
When you create a CDN endpoint, you specify a scenario in the Optimized for option.

- General web delivery: Most common optimization option.
Designed for general web content optimization, such as webpages and web applications. 
Can be used for file and video downloads.
- General media streaming: If you need to use the endpoint for live streaming and video-on-demand streaming.
- Video-on-demand media streaming: Video-on-demand media streaming optimization improves video-on-demand streaming content.
- Large file download: Optimized for content larger than 10 MB.
- Dynamic site acceleration: Involves an additional fee.

Also offered via Azure Front Door Service.

Benefits the latency and performance of dynamic content.
Techniques include route and network optimization, TCP optimization, and more.
create static website.md
Create and upload the app to a new app service web app:

```
git clone https://github.com/Azure-Samples/html-docs-hello-world.git
cd html-docs-hello-world
az webapp up --location westeurope --name ric01-static
```

Returns:
```json
Creating Resource group 'richard.cowin_rg_Windows_westeurope' ...
Creating App service plan 'richard.cowin_asp_Windows_westeurope_0' ...
Creating app 'ric01-static' ...
Starting zip deployment.
{
  ...
  "name": "ric01-static",
  "os": "Windows",
  "resourcegroup": "richard.cowin_rg_Windows_westeurope"
  ...
}
```

This will also update the app after changes:
```
az webapp up --location westeurope --name ric01-static
```
create cdn endpoint.md
Use Networking blade to add CDN profile:

Assets will be available at, e.g.:

- http://`<appname>`.azurewebsites.net/css/bootstrap.css
- http://`<endpointname>`.azureedge.net/css/bootstrap.css

The default TTL is seven days.

To trigger a refresh, manually purge the CDN resources using the Azure Portal.

Caching behavior options:
- Ignore query strings (default)
- Bypass caching for query strings
- Cache every unique URL
Web apps.cs
// Authenticate via the SDK, assuming AZURE_AUTH_LOCATION is path to auth file
// This is common for all SDKs
var credentials = SdkContext.AzureCredentialsFactory.FromFile(Environment.GetEnvironmentVariable("AZURE_AUTH_LOCATION"));
var azure = Azure
      .Configure()
      .WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic)
      .Authenticate(credentials)
      .WithDefaultSubscription();

// Create resource group
azure.ResourceGroups.Define(rgName)
      .WithRegion(Region.USCentral)
      .Create();

// create a few web apps in several regions, each one be like:
var app = azure.WebApps
      .Define(appName)
      .WithRegion(Region.EuropeNorth)
      .WithExistingResourceGroup(rgName)
      .WithNewWindowsPlan(PricingTier.StandardS1)
      .WithJavaVersion(JavaVersion.V8Newest)
      .WithWebContainer(WebContainer.Tomcat8_0Newest)
      .DefineSourceControl()
          .WithPublicGitRepository("https://github.com/jianghaolu/azure-site-test")
          .WithBranch("master")
          .Attach()
      .Create();

// Create CDN profile using Standard Verizon SKU with endpoints in each region of Web apps
var profileDefinition = azure.CdnProfiles.Define(cdnProfileName)
      .WithRegion(Region.USSouthCentral)
      .WithExistingResourceGroup(rgName)
      .WithStandardVerizonSku();

// define all the endpoints - do this for each webapp
ICreatable<ICdnProfile> cdnCreatable =
    cdnCreatable = profileDefinition
        .DefineNewEndpoint()
            .WithOrigin(appName + ".azurewebsites.net")
            .WithHostHeader(appName + ".azurewebsites.net")
            .WithCompressionEnabled(true)
            .WithContentTypeToCompress("application/javascript")
            .WithQueryStringCachingBehavior(QueryStringCachingBehavior.IgnoreQueryString)
        .Attach();

// create profile and then all the defined endpoints in parallel
ICdnProfile profile = cdnCreatable.Create();

// Load some content (referenced by Web Apps) to the CDN endpoints.
var contentToLoad = new HashSet<string>();
contentToLoad.Add("/server.js");
contentToLoad.Add("/pictures/microsoft_logo.png");
foreach (ICdnEndpoint endpoint in profile.Endpoints.Values)
{
    endpoint.LoadContent(contentToLoad);
}
manage.ps1
# Output the name of all profiles on this subscription.
Get-AzCdnProfile | ForEach-Object { Write-Host $_.Name }

# Get a single endpoint.
$endpoint = Get-AzCdnEndpoint -ProfileName CdnDemo -ResourceGroupName CdnDemoRG -EndpointName cdndocdemo

# Create a new profile
New-AzCdnProfile -ProfileName CdnPoshDemo `
  -ResourceGroupName CdnDemoRG `
  -Sku Standard_Akamai `
  -Location "Central US"

# Create a new endpoint
New-AzCdnEndpoint -ProfileName CdnPoshDemo `
  -ResourceGroupName CdnDemoRG `
  -Location "Central US" `
  -EndpointName cdnposhdoc `
  -OriginName "Contoso" `
  -OriginHostName "www.contoso.com"

# Retrieve availability
$availability = Get-AzCdnEndpointNameAvailability -EndpointName "cdnposhdoc"
$availability.NameAvailable

# Modify
$endpoint.IsCompressionEnabled = $true
$endpoint.ContentTypesToCompress = "text/javascript","text/css","application/json"
Set-AzCdnEndpoint -CdnEndpoint $endpoint

# Purge some assets
Unpublish-AzCdnEndpointContent -ProfileName CdnDemo `
  -ResourceGroupName CdnDemoRG `
  -EndpointName cdndocdemo `
  -PurgeContent "/images/kitten.png","/video/rickroll.mp4"

# Pre-load some assets
Publish-AzCdnEndpointContent -ProfileName CdnDemo `
  -ResourceGroupName CdnDemoRG `
  -EndpointName cdndocdemo `
  -LoadContent "/images/kitten.png","/video/rickroll.mp4"

# Stop an endpoint
Stop-AzCdnEndpoint -ProfileName CdnDemo `
  -ResourceGroupName CdnDemoRG `
  -EndpointName cdndocdemo

powershell PowerShell的命令大全

保存自https://www.cnblogs.com/nightnine/p/5119653.html#top

power
Name                              Category  Synopsis                          
   
Get-WinEvent                      Cmdlet    从本地和远程计算机上的事件日志和事件跟踪日志文件中获取事件。     
Get-Counter                       Cmdlet    从本地和远程计算机上获取性能计数器数据。               
Import-Counter                    Cmdlet    导入性能计数器日志文件(.blg、.csv、.tsv)并创建表示...
Export-Counter                    Cmdlet    Export-Counter cmdlet 获取 Perform...
Disable-WSManCredSSP              Cmdlet    在客户端计算机上禁用凭据安全服务提供程序 (CredSSP) 身...
Enable-WSManCredSSP               Cmdlet    在客户端计算机上启用凭据安全服务提供程序 (CredSSP) 身...
Get-WSManCredSSP                  Cmdlet    获取客户端的与凭据安全服务提供程序相关的配置。            
Set-WSManQuickConfig              Cmdlet    配置本地计算机的远程管理。                      
Test-WSMan                        Cmdlet    测试 WinRM 服务是否正在本地或远程计算机上运行。        
Invoke-WSManAction                Cmdlet    对资源 URI 和选择器指定的对象调用操作。             
Connect-WSMan                     Cmdlet    连接到远程计算机上的 WinRM 服务。               
Disconnect-WSMan                  Cmdlet    断开客户端与远程计算机上的 WinRM 服务的连接。         
Get-WSManInstance                 Cmdlet    显示由资源 URI 指定的资源实例的管理信息。            
Set-WSManInstance                 Cmdlet    修改与资源相关的管理信息。                      
Remove-WSManInstance              Cmdlet    删除管理资源实例。                          
New-WSManInstance                 Cmdlet    创建管理资源的新实例。                        
New-WSManSessionOption            Cmdlet    创建 WS-Management 会话选项哈希表以用作以下 WS...
Get-Command                       Cmdlet    获取有关 cmdlet 以及有关 Windows PowerSh...
Get-Help                          Cmdlet    显示有关 Windows PowerShell 命令和概念的信息。  
Get-History                       Cmdlet    获取在当前会话中输入的命令的列表。                  
Invoke-History                    Cmdlet    从会话历史记录中运行命令。                      
Add-History                       Cmdlet    向会话历史记录追加条目。                       
Clear-History                     Cmdlet    删除命令历史记录中的条目。                      
Register-PSSessionConfiguration   Cmdlet    创建并注册新的会话配置。                       
Unregister-PSSessionConfiguration Cmdlet    从计算机上删除已注册的会话配置。                   
Get-PSSessionConfiguration        Cmdlet    获取计算机上已注册的会话配置。                    
Set-PSSessionConfiguration        Cmdlet    更改已注册会话配置的属性。                      
Enable-PSSessionConfiguration     Cmdlet    启用本地计算机上的会话配置。                     
Disable-PSSessionConfiguration    Cmdlet    拒绝访问本地计算机上的会话配置。                   
Enable-PSRemoting                 Cmdlet    将计算机配置为接收远程命令。                     
Invoke-Command                    Cmdlet    在本地和远程计算机上运行命令。                    
New-PSSession                     Cmdlet    建立与本地或远程计算机的持续性连接。                 
Get-PSSession                     Cmdlet    获取当前会话中的 Windows PowerShell 会话 (...
Remove-PSSession                  Cmdlet    关闭一个或多个 Windows PowerShell 会话 (P...
Start-Job                         Cmdlet    启动 Windows PowerShell 后台作业。        
Get-Job                           Cmdlet    获取在当前会话中运行的 Windows PowerShell 后...
Receive-Job                       Cmdlet    获取当前会话中 Windows PowerShell 后台作业的结果。
Stop-Job                          Cmdlet    停止 Windows PowerShell 后台作业。        
Wait-Job                          Cmdlet    禁止显示命令提示符,直至在会话中运行的一个或全部 Windows...
Remove-Job                        Cmdlet    删除 Windows PowerShell 后台作业。        
Enter-PSSession                   Cmdlet    启动与远程计算机间的交互式会话。                   
Exit-PSSession                    Cmdlet    结束与远程计算机的交互式会话。                    
New-PSSessionOption               Cmdlet    创建包含 PSSession 高级选项的对象。            
ForEach-Object                    Cmdlet    针对每一组输入对象执行操作。                     
Where-Object                      Cmdlet    创建控制哪些对象沿着命令管道传递的筛选器。              
Set-PSDebug                       Cmdlet    打开和关闭脚本调试功能,设置跟踪级别并切换 strict 模式。   
Set-StrictMode                    Cmdlet    建立和强制执行表达式、脚本和脚本块中的编码规则。           
New-Module                        Cmdlet    创建一个仅存在于内存中的新动态模块。                 
Import-Module                     Cmdlet    向当前会话中添加模块。                        
Export-ModuleMember               Cmdlet    指定要导出的模块成员。                        
Get-Module                        Cmdlet    获取已导入或可以导入到当前会话中的模块。               
Remove-Module                     Cmdlet    删除当前会话中的模块。                        
New-ModuleManifest                Cmdlet    创建一个新的模块清单。                        
Test-ModuleManifest               Cmdlet    验证模块清单文件是否准确描述了模块的内容。              
Add-PSSnapin                      Cmdlet    将一个或多个 Windows PowerShell 管理单元添加...
Remove-PSSnapin                   Cmdlet    将 Windows PowerShell 管理单元从当前会话中删除。 
Get-PSSnapin                      Cmdlet    获取计算机上的 Windows PowerShell 管理单元。   
Export-Console                    Cmdlet    将当前会话中管理单元的名称导出到一个控制台文件。           
Format-List                       Cmdlet    将输出的格式设置为属性列表,其中每个属性均各占一行显示。       
Format-Custom                     Cmdlet    使用自定义视图来设置输出的格式。                   
Format-Table                      Cmdlet    将输出的格式设置为表。                        
Format-Wide                       Cmdlet    将对象的格式设置为只能显示每个对象的一个属性的宽表。         
Out-Null                          Cmdlet    删除输出,不将其发送到控制台。                    
Out-Default                       Cmdlet    将输出发送到默认的格式化程序和默认的输出 cmdlet。       
Out-Host                          Cmdlet    将输出发送到命令行。                         
Out-File                          Cmdlet    将输出发送到文件。                          
Out-Printer                       Cmdlet    将输出发送到打印机。                         
Out-String                        Cmdlet    将对象作为一列字符串发送到主机。                   
Out-GridView                      Cmdlet    将输出发送到单独窗口中的交互表。                   
Get-FormatData                    Cmdlet    获取当前会话中的格式数据。                      
Export-FormatData                 Cmdlet    将当前会话中的格式数据保存在一个格式文件中。             
Register-ObjectEvent              Cmdlet    订阅由 Microsoft .NET Framework 对象生...
Register-EngineEvent              Cmdlet    订阅由 Windows PowerShell 引擎以及由 New...
Wait-Event                        Cmdlet    等到引发特定事件后再继续运行。                    
Get-Event                         Cmdlet    获取事件队列中的事件。                        
Remove-Event                      Cmdlet    删除事件队列中的事件。                        
Get-EventSubscriber               Cmdlet    获取当前会话中的事件订阅者。                     
Unregister-Event                  Cmdlet    取消事件订阅。                            
New-Event                         Cmdlet    创建新事件。                             
Add-Member                        Cmdlet    向 Windows PowerShell 对象的实例中添加用户定...
Add-Type                          Cmdlet    向 Windows PowerShell 会话中添加 Micro...
Compare-Object                    Cmdlet    比较两组对象。                            
ConvertTo-Html                    Cmdlet    将 Microsoft .NET Framework 对象转换为...
ConvertFrom-StringData            Cmdlet    将包含一个或多个键-值对的字符串转换为哈希表。            
Export-CSV                        Cmdlet    将 Microsoft .NET Framework 对象转换为...
Import-CSV                        Cmdlet    将逗号分隔值 (CSV) 文件中的对象属性转换为原始对象的 CS...
ConvertTo-CSV                     Cmdlet    将 Microsoft .NET Framework 对象转换为...
ConvertFrom-CSV                   Cmdlet    将逗号分隔值 (CSV) 格式的对象属性转换为原始对象的 CSV...
Export-Alias                      Cmdlet    将当前定义的别名相关信息导出到文件中。                
Invoke-Expression                 Cmdlet    在本地计算机上运行命令或表达式。                   
Get-Alias                         Cmdlet    获取当前会话的别名。                         
Get-Culture                       Cmdlet    获取操作系统中设置的当前区域性。                   
Get-Date                          Cmdlet    获取当前日期和时间。                         
Get-Host                          Cmdlet    获取表示当前主机程序的对象。默认情况下,还显示 Windows ...
Get-Member                        Cmdlet    获取对象的属性和方法。                        
Get-Random                        Cmdlet    从集合中获取随机数或随机选择对象。                  
Get-UICulture                     Cmdlet    获取操作系统中当前用户界面 (UI) 区域性设置。          
Get-Unique                        Cmdlet    从排序列表返回唯一项目。                       
Export-PSSession                  Cmdlet    导入来自其他会话的命令,并将它们保存到 Windows Powe...
Import-PSSession                  Cmdlet    将来自其他会话的命令导入到当前会话中。                
Import-Alias                      Cmdlet    从文件导入别名列表。                         
Import-LocalizedData              Cmdlet    根据为操作系统选择的 UI 区域性,将语言特定的数据导入脚本和函数。 
Select-String                     Cmdlet    查找字符串和文件中的文本。                      
Measure-Object                    Cmdlet    计算对象的数字属性以及字符串对象(如文本文件)中的字符数、单词数...
New-Alias                         Cmdlet    创建新别名。                             
New-TimeSpan                      Cmdlet    创建 TimeSpan 对象。                    
Read-Host                         Cmdlet    从控制台读取一行输入。                        
Set-Alias                         Cmdlet    在当前 Windows PowerShell 会话中为 cmdl...
Set-Date                          Cmdlet    将计算机上的系统时间更改为指定的时间。                
Start-Sleep                       Cmdlet    将脚本或会话中的活动挂起指定的一段时间。               
Tee-Object                        Cmdlet    将命令输出保存在文件或变量中,并将其显示在控制台中。         
Measure-Command                   Cmdlet    度量运行脚本块和 cmdlet 所用的时间。             
Update-List                       Cmdlet    在包含对象集合的属性值中添加和删除项。                
Update-TypeData                   Cmdlet    通过将 *.types.ps1xml 文件重新加载到内存中来更新...
Update-FormatData                 Cmdlet    更新当前会话中的格式数据。                      
Write-Host                        Cmdlet    将自定义的输出内容写入主机。                     
Write-Progress                    Cmdlet    在 Windows PowerShell 命令窗口内显示进度栏。   
New-Object                        Cmdlet    创建 Microsoft .NET Framework 或 CO...
Select-Object                     Cmdlet    选择一个对象或一组对象的指定属性。它还可以从对象的数组中选择唯一...
Group-Object                      Cmdlet    指定的属性包含相同值的组对象。                    
Sort-Object                       Cmdlet    按属性值对对象进行排序。                       
Get-Variable                      Cmdlet    获取当前控制台中的变量。                       
New-Variable                      Cmdlet    创建新变量                              
Set-Variable                      Cmdlet    设置变量的值。如果不存在具有所请求名称的变量,则创建该变量。     
Remove-Variable                   Cmdlet    删除变量及其值。                           
Clear-Variable                    Cmdlet    删除变量的值。                            
Export-Clixml                     Cmdlet    创建对象的基于 XML 的表示形式并将其存储在文件中。        
Import-Clixml                     Cmdlet    导入 CLIXML 文件,并在 Windows PowerShe...
ConvertTo-XML                     Cmdlet    创建对象的基于 XML 的表示形式。                 
Select-XML                        Cmdlet    在 XML 字符串或文档中查找文本。                 
Write-Debug                       Cmdlet    将调试消息写入控制台。                        
Write-Verbose                     Cmdlet    将文本写入详细消息流。                        
Write-Warning                     Cmdlet    写入警告消息。                            
Write-Error                       Cmdlet    将对象写入错误流。                          
Write-Output                      Cmdlet    将指定对象发送到管道中的下一个命令。如果该命令是管道中的最后一个...
Set-PSBreakpoint                  Cmdlet    在行、命令或变量上设置断点。                     
Get-PSBreakpoint                  Cmdlet    获取当前会话中设置的断点。                      
Remove-PSBreakpoint               Cmdlet    删除当前控制台中的断点。                       
Enable-PSBreakpoint               Cmdlet    启用当前控制台中的断点。                       
Disable-PSBreakpoint              Cmdlet    禁用当前控制台中的断点。                       
Get-PSCallStack                   Cmdlet    显示当前调用堆栈。                          
Send-MailMessage                  Cmdlet    发送电子邮件。                            
Get-TraceSource                   Cmdlet    获取用于跟踪的 Windows PowerShell 组件。     
Set-TraceSource                   Cmdlet    配置、启动和停止对 Windows PowerShell 组件的跟踪。
Trace-Command                     Cmdlet    配置并启动对指定表达式或命令的跟踪。                 
Start-Transcript                  Cmdlet    在文本文件中创建全部或部分 Windows PowerShell...
Stop-Transcript                   Cmdlet    停止脚本。                              
Add-Content                       Cmdlet    向指定的项中添加内容,如向文件中添加字词。              
Clear-Content                     Cmdlet    删除项的内容(例如从文件中删除文本),但不删除该项。         
Clear-ItemProperty                Cmdlet    删除属性的值,但不删除该属性。                    
Join-Path                         Cmdlet    将路径和子路径合并到单个路径中。提供程序将提供路径分隔符。      
Convert-Path                      Cmdlet    将路径从 Windows PowerShell 路径转换为 Wi...
Copy-ItemProperty                 Cmdlet    将属性和值从指定的位置复制到另一个位置。               
Get-EventLog                      Cmdlet    获取本地或远程计算机上的事件日志或事件日志列表中的事件。       
Clear-EventLog                    Cmdlet    删除本地或远程计算机上的指定事件日志中的所有条目。          
Write-EventLog                    Cmdlet    将事件写入事件日志。                         
Limit-EventLog                    Cmdlet    设置限制事件日志大小及其条目存在时间的事件日志属性。         
Show-EventLog                     Cmdlet    在事件查看器中显示本地或远程计算机的事件日志。            
New-EventLog                      Cmdlet    在本地或远程计算机上创建新事件日志和新事件源。            
Remove-EventLog                   Cmdlet    删除事件日志或注销事件源。                      
Get-ChildItem                     Cmdlet    获取一个或多个指定位置中的项和子项。                 
Get-Content                       Cmdlet    获取位于指定位置的项的内容。                     
Get-ItemProperty                  Cmdlet    获取指定项的属性。                          
Get-WmiObject                     Cmdlet    获取 Windows Management Instrument...
Invoke-WmiMethod                  Cmdlet    调用 Windows Management Instrument...
Move-ItemProperty                 Cmdlet    将属性从一个位置移动到另一个位置。                  
Get-Location                      Cmdlet    获取当前工作位置的相关信息。                     
Set-Location                      Cmdlet    将当前工作位置设置为指定的位置。                   
Push-Location                     Cmdlet    将当前位置添加到位置列表(“堆栈”)的顶部。             
Pop-Location                      Cmdlet    将当前位置更改为最近推入到堆栈中的位置。您可以从默认堆栈中或从您...
New-PSDrive                       Cmdlet    在当前会话中创建 Windows PowerShell 驱动器。   
Remove-PSDrive                    Cmdlet    从所在位置删除 Windows PowerShell 驱动器。    
Get-PSDrive                       Cmdlet    获取当前会话中的 Windows PowerShell 驱动器。   
Get-Item                          Cmdlet    获取位于指定位置的项。                        
New-Item                          Cmdlet    创建新项。                              
Set-Item                          Cmdlet    将项的值更改为命令中指定的值。                    
Remove-Item                       Cmdlet    删除指定项。                             
Move-Item                         Cmdlet    将项从一个位置移动到另一个位置。                   
Rename-Item                       Cmdlet    重命名 Windows PowerShell 提供程序命名空间中...
Copy-Item                         Cmdlet    将项从一个位置复制到命名空间内的另一个位置。             
Clear-Item                        Cmdlet    删除项的内容,但不删除该项。                     
Invoke-Item                       Cmdlet    对指定项执行默认操作。                        
Get-PSProvider                    Cmdlet    获取有关指定的 Windows PowerShell 提供程序的信息。
New-ItemProperty                  Cmdlet    为项创建新属性并设置该属性的值。例如,可以使用 New-Item...
Split-Path                        Cmdlet    返回指定的路径部分。                         
Test-Path                         Cmdlet    确定路径的所有元素是否存在。                     
Get-Process                       Cmdlet    获取在本地计算机或远程计算机上运行的进程。              
Stop-Process                      Cmdlet    停止一个或多个正在运行的进程。                    
Wait-Process                      Cmdlet    等到进程停止后再接受更多输入。                    
Debug-Process                     Cmdlet    调试在本地计算机上运行的一个或多个进程。               
Start-Process                     Cmdlet    启动本地计算机上的一个或多个进程。                  
Remove-ItemProperty               Cmdlet    从注册表项中删除属性及其值。                     
Remove-WmiObject                  Cmdlet    删除现有 Windows Management Instrume...
Rename-ItemProperty               Cmdlet    重命名项的属性。                           
Register-WmiEvent                 Cmdlet    订阅 Windows Management Instrument...
Resolve-Path                      Cmdlet    解析路径中的通配符并显示路径内容。                  
Get-Service                       Cmdlet    获取本地或远程计算机上的服务。                    
Stop-Service                      Cmdlet    停止一个或多个正在运行的服务。                    
Start-Service                     Cmdlet    启动一个或多个已停止的服务。                     
Suspend-Service                   Cmdlet    挂起(暂停)一个或多个正在运行的服务。                
Resume-Service                    Cmdlet    恢复一项或多项挂起(暂停的)服务。                  
Restart-Service                   Cmdlet    停止并接着启动一个或更多服务。                    
Set-Service                       Cmdlet    启动、停止和挂起服务并更改服务的属性。                
New-Service                       Cmdlet    创建新的 Windows 服务。                   
Set-Content                       Cmdlet    在项中写入内容或用新内容替换其中的内容。               
Set-ItemProperty                  Cmdlet    创建或更改某一项的属性值。                      
Set-WmiInstance                   Cmdlet    创建或更新现有 Windows Management Instr...
Get-Transaction                   Cmdlet    获取当前(活动)事务。                        
Start-Transaction                 Cmdlet    启动事务。                              
Complete-Transaction              Cmdlet    提交活动事务。                            
Undo-Transaction                  Cmdlet    回滚活动事务。                            
Use-Transaction                   Cmdlet    将脚本块添加到活动事务中。                      
New-WebServiceProxy               Cmdlet    创建一个 Web 服务代理对象,用于在 Windows Powe...
Get-HotFix                        Cmdlet    获取已应用于本地和远程计算机的修补程序。               
Test-Connection                   Cmdlet    将 ICMP 回显请求数据包(“ping”)发送给一台或多台计算机。 
Enable-ComputerRestore            Cmdlet    在指定的文件系统驱动器上启用系统还原功能。              
Disable-ComputerRestore           Cmdlet    在指定的文件系统驱动器上禁用系统还原功能。              
Checkpoint-Computer               Cmdlet    在本地计算机上创建系统还原点。                    
Get-ComputerRestorePoint          Cmdlet    获取本地计算机上的还原点。                      
Restart-Computer                  Cmdlet    重新启动(“重新引导”)本地和远程计算机上的操作系统。        
Stop-Computer                     Cmdlet    停止(关闭)本地和远程计算机。                    
Restore-Computer                  Cmdlet    在本地计算机上启动系统还原。                     
Add-Computer                      Cmdlet    将本地计算机添加到域或工作组中。                   
Remove-Computer                   Cmdlet    从工作组或域中删除本地计算机。                    
Test-ComputerSecureChannel        Cmdlet    测试并修复本地计算机与其域之间的安全通道。              
Reset-ComputerMachinePassword     Cmdlet    重置计算机的计算机帐户密码。                     
Get-Acl                           Cmdlet    获取资源(例如文件或注册表项)的安全描述符。             
Set-Acl                           Cmdlet    更改指定资源(例如文件或注册表项)的安全描述符。           
Get-PfxCertificate                Cmdlet    获取计算机上 .pfx 证书文件的相关信息。             
Get-Credential                    Cmdlet    获取基于用户名和密码的凭据对象。                   
Get-ExecutionPolicy               Cmdlet    获取当前会话中的执行策略。                      
Set-ExecutionPolicy               Cmdlet    更改 Windows PowerShell 执行策略的用户首选项。  
Get-AuthenticodeSignature         Cmdlet    获取文件中有关 Authenticode 签名的信息。        
Set-AuthenticodeSignature         Cmdlet    为 Windows PowerShell 脚本或其他文件添加 A...
ConvertFrom-SecureString          Cmdlet    将安全字符串转换为加密的标准字符串。                 
ConvertTo-SecureString            Cmdlet    将加密的标准字符串转换为安全字符串。它还可以将纯文本转换为安全字...
WSMan                             Provider  提供对 Web Services for Management ...
Alias                             Provider  提供对 Windows PowerShell 别名以及它们所表示...
Environment                       Provider  提供对 Windows 环境变量的访问。               
FileSystem                        Provider  提供对文件和目录的访问。                       
Function                          Provider  提供对 Windows PowerShell 中所定义函数的访问。  
Registry                          Provider  提供从 Windows PowerShell 对系统注册表项和注...
Variable                          Provider  提供对 Windows PowerShell 变量及其值的访问。   
Certificate                       Provider  提供对 X.509 证书存储和对 Windows PowerSh...
about_aliases                     HelpFile  说明如何在 Windows PowerShell 中使用 cmd...
about_Arithmetic_Operators        HelpFile  说明在 Windows PowerShell 中执行算术运算的运算符。
about_arrays                      HelpFile  描述用于存储数据元素的紧凑型数据结构                 
about_Assignment_Operators        HelpFile  说明如何使用运算符向变量赋值。                    
about_Automatic_Variables         HelpFile  说明存储 Windows PowerShell 状态信息的变量。   
about_Break                       HelpFile  描述一个可用于立即退出 Foreach、For、While、Do...
about_command_precedence          HelpFile  描述 Windows PowerShell 如何确定要运行哪个命令。 
about_Command_Syntax              HelpFile  描述帮助中的 Windows PowerShell 语法表示法。   
about_Comment_Based_Help          HelpFile  描述如何为函数和脚本编写基于注释的帮助主题。             
about_CommonParameters            HelpFile  描述可用于任何 cmdlet 的参数。                
about_Comparison_Operators        HelpFile  说明在 Windows PowerShell 中用于比较值的运算符。 
about_Continue                    HelpFile  说明 Continue 语句如何使程序流立即返回到程序循环的顶部。  
about_Core_Commands               HelpFile  列出用于 Windows PowerShell 提供程序的 cm...
about_data_sections               HelpFile  说明 Data 节,这些节将文本字符串和其他只读数据与脚本逻辑隔离。 
about_debuggers                   HelpFile  说明 Windows PowerShell 调试程序。        
about_do                          HelpFile  根据 While 或 Until 条件,运行一个语句列表一次或多次。 
about_environment_variables       HelpFile  说明如何在 Windows PowerShell 中访问 Win...
about_escape_characters           HelpFile  介绍 Windows PowerShell 中的转义字符并解释其作用。
about_eventlogs                   HelpFile  Windows PowerShell 将创建一个名为"Windo...
about_execution_policies          HelpFile  说明 Windows PowerShell 执行策略,并介绍如何...
about_For                         HelpFile  说明可用于基于条件测试来运行语句的一种语言命令。           
about_Foreach                     HelpFile  说明可用于遍历项集合中的所有项的一种语言命令。            
about_format.ps1xml               HelpFile  Windows PowerShell 中的 Format.ps1...
about_functions                   HelpFile  说明如何在 Windows PowerShell 中创建和使用函数。 
about_functions_advanced          HelpFile  介绍与 cmdlet 行为类似的高级函数。              
about_functions_advanced_methods  HelpFile  说明指定了 CmdletBinding 属性 (attribut...
about_functions_advanced_param... HelpFile  说明如何向声明了 CmdletBinding 属性的函数添加静态...
about_functions_cmdletbindinga... HelpFile  说明一个声明函数的属性,这种函数与已编译 cmdlet 有类似的功能。
about_hash_tables                 HelpFile  说明如何在 Windows PowerShell 中创建、使用和...
about_History                     HelpFile  说明如何检索和运行命令历史记录中的命令。               
about_If                          HelpFile  说明一个语言命令,该语言命令可用于根据一个或多个条件测试的结果运...
about_jobs                        HelpFile  提供有关 Windows PowerShell 后台作业如何在后...
about_job_details                 HelpFile  提供有关本地和远程计算机上的后台作业的详细信息。           
about_join                        HelpFile  说明联接运算符 (-join) 如何将多个字符串合并为单个字符串。  
about_Language_Keywords           HelpFile  说明 Windows PowerShell 脚本语言中的关键字。   
about_Line_Editing                HelpFile  说明如何在 Windows PowerShell 命令提示符下编...
about_locations                   HelpFile  说明如何在 Windows PowerShell 中从工作位置访...
about_logical_operators           HelpFile  说明在 Windows PowerShell 中用于连接语句的运算符。
about_methods                     HelpFile  说明如何在 Windows PowerShell 中使用方法对对...
about_modules                     HelpFile  说明如何安装、导入和使用 Windows PowerShell 模块。
about_objects                     HelpFile  提供有关 Windows PowerShell 中的对象的基本信息。 
about_operators                   HelpFile  说明 Windows PowerShell 支持的运算符       
about_parameters                  HelpFile  说明如何在 Windows PowerShell 中使用 cmd...
about_Parsing                     HelpFile  说明 Windows PowerShell 如何分析命令。      
about_Path_Syntax                 HelpFile  说明 Windows PowerShell 中的完整和相对路径名...
about_pipelines                   HelpFile  在 Windows PowerShell 中将命令合并到管道中    
about_preference_variables        HelpFile  用于自定义 Windows PowerShell 行为的变量     
about_profiles                    HelpFile  描述如何创建和使用 Windows PowerShell 配置文件。 
about_prompts                     HelpFile  描述 Prompt 函数并演示如何创建自定义 Prompt 函数。  
about_properties                  HelpFile  描述如何在 Windows PowerShell 中使用对象属性。  
about_providers                   HelpFile  描述 Windows PowerShell 提供程序如何使用户能...
about_pssessions                  HelpFile  介绍 Winodos PowerShell 会话 (PSSess...
about_pssession_details           HelpFile  介绍有关 Windows PowerShell 会话及其在远程命...
about_PSSnapins                   HelpFile  介绍 Windows PowerShell 管理单元,并说明如何...
about_Quoting_Rules               HelpFile  介绍单引号和双引号在 Windows PowerShell 中的...
about_Redirection                 HelpFile  介绍如何将 Windows PowerShell 输出重定向到文...
about_Ref                         HelpFile  介绍如何创建和使用引用变量类型。                   
about_regular_expressions         HelpFile  介绍 Windows PowerShell 中的正则表达式。     
about_remote                      HelpFile  说明如何在 Windows PowerShell 中运行远程命令。  
about_remote_FAQ                  HelpFile  包括有关在 Windows PowerShell 中运行远程命令...
about_remote_jobs                 HelpFile  说明如何在远程计算机上运行后台作业。                 
about_remote_output               HelpFile  说明如何对远程命令的输出进行解释和格式设置。             
about_remote_requirements         HelpFile  介绍在 Windows PowerShell 中运行远程命令的系...
about_remote_troubleshooting      HelpFile  说明如何解决 Windows PowerShell 中的远程操作...
about_requires                    HelpFile  通过要求使用指定的管理单元和版本来阻止脚本运行。           
about_Reserved_Words              HelpFile  列出 Windows PowerShell 中因具有特殊含义而不...
about_Return                      HelpFile  退出当前作用域(可能是函数、脚本或脚本块)。             
about_scopes                      HelpFile  介绍 Windows PowerShell 中的作用域的概念,并...
about_scripts                     HelpFile  说明如何在 Windows PowerShell 中编写和运行脚本。 
about_script_blocks               HelpFile  定义什么是脚本块,并说明在 Windows PowerShell...
about_script_internationalization HelpFile  介绍 Windows PowerShell 2.0 的脚本国际化...
about_Session_Configurations      HelpFile  描述确定可远程连接到计算机的用户及其可运行的命令的会话配置。     
about_Signing                     HelpFile  说明如何对脚本进行签名以使其符合 Windows PowerSh...
about_Special_Characters          HelpFile  说明可用于控制 Windows PowerShell 对命令或参...
about_split                       HelpFile  说明如何使用拆分运算符将一个或多个字符串拆分为多个子字符串。     
about_Switch                      HelpFile  说明如何使用 switch 来处理多个 IF 语句。         
about_Throw                       HelpFile  介绍用于生成终止错误 Throw 关键字。              
about_transactions                HelpFile  介绍如何管理 Windows PowerShell 中的事务处理操作。
about_trap                        HelpFile  介绍用于处理终止错误的关键字。                    
about_try_catch_finally           HelpFile  说明如何使用 Try、Catch 和 Finally 块处理终止错误。
about_types.ps1xml                HelpFile  说明如何通过 Types.ps1xml 文件扩展 Windows...
about_type_operators              HelpFile  说明运算符如何与 Microsoft .NET Framewor...
about_Variables                   HelpFile  说明变量如何存储可用于 Windows PowerShell 的值。 
about_While                       HelpFile  说明一条语句,该语句可用于根据条件测试的结果运行命令块。       
about_wildcards                   HelpFile  说明如何在 Windows PowerShell 中使用通配符。   
about_Windows_PowerShell_2.0      HelpFile  说明 Windows PowerShell 2.0 提供的新功能。  
about_Windows_PowerShell_ISE      HelpFile  说明 Windows PowerShell 集成脚本环境 (IS...
about_WMI_Cmdlets                 HelpFile  提供有关 Windows Management Instrume...
about_WS-Management_Cmdlets       HelpFile  提供 Web Services for Management (...
default                           HelpFile  显示有关 Windows PowerShell cmdlet 和...

powershell 获取已删除用户的OneDrive

SpoSite.ps1
Get-SPOsite -Identity https://sagov-my.sharepoint.com/personal/peter_marshall2_sa_gov_au
Set-SPOsite -Identity https://sagov-my.sharepoint.com/personal/peter_marshall2_sa_gov_au -Owner yatesa01c@sagov.onmicrosoft.com