新規セットアップ時に必ず設定するリモート デスクトップ接続をPowerShellから一括設定するサンプルです。
Windows 7は一部PowerShell コマンドレットが使えないため、netsh advfirewall コマンドを使っています。
Windows 8.x/10の場合
#1,2は[システムのプロパティ]の[リモート]タブにある設定を変更します。

#3はFirewallの[受信の規則]にあるグループ[リモートデスクトップ]を有効にします。
サンプルでは有効にしたい対象ルールの内、ProfileにPrivateを含むルールを有効化し、又ProfileをPrivateに変更しています。

Windows 7の場合
Windows 7はGet-NetFirewallRule コマンドレットが使えません。そのため、netsh advfirewall コマンドを使います。複数の識別条件を指定したい場合は複数のコマンドを実行します。
netsh advfirewall firewall set rule name="リモート デスクトップ - シャドウ (TCP 受信)" profile=private new enable=yes
netsh advfirewall firewall set rule name="リモート デスクトップ - ユーザー モード (TCP 受信)" profile=private new enable=yes
netsh advfirewall firewall set rule name="リモート デスクトップ - ユーザー モード (UDP 受信)" profile=private new enable=yes

プロファイルに関係なくルールを有効にしたい場合はGroup指定すると便利です。
netsh advfirewall firewall set rule group="リモート デスクトップ" new enable=yes

ただし、識別条件を複数指定することができないようです。指定するとエラーが起きます。
