はじめての WinGet Configuration

5.2K Views

June 17, 23

スライド概要

Windows Server & Cloud User Group Japan 第35回勉強会の資料です。
Microsoft Build 2023 で紹介されていた WinGet を構成マネージャーとして使用する方法・機能について紹介します。

profile-image

インフラエンジニア

シェア

またはPlayer版

埋め込む »CMSなどでJSが使えない場合

関連スライド

各ページのテキスト
1.

はじめての WinGet Configuration SCUGJ (wSCUGJ) 勉強会 #35 2023-06-17 Kazuki Takai Windows Server & Cloud User Group Japan

2.

自己紹介 • たかい (Kazuki Takai) • 会社員 (某ISP勤務) • サービス基盤開発、技術開発 • ライセンス関連 • wSCUGJ (Windows Server & System Center User Group Japan) • 興味分野:統合管理、ID、自動化、セキュリティ、監視・運用 • 趣味:カメラ(風景写真)、ビデオゲーム、旅行(温泉) • Microsoft MVP for Cloud and Datacenter Management

3.

Notice • 本セッションで説明する内容には、 リリース前の機能が含まれます • サービスのリリース、リリース後 のエンハンスにより仕様や動作が 変更となる場合があります

4.

おさらい Recap: PowerShell Desired State Configuration

5.

DSC とは • Desired State Configuration • 構成管理プラットフォーム • 構成(Configuration)を特定の状態に保ち続ける ための仕組み • あるべき状態を定義 • 定義に基づいて設定を変更 • 定期的に設定をチェックし正しい状態を維持

6.

細かいことは… • 細かいことは時間が無いのでお話ししません • 前回第34回の勉強会で、DSC と Automanage Machine Configuration の話をしています • そちらの資料をご覧ください https://www.docswell.com/s/takai/53883E-ManageArc-enabled-servers-OS-and-Apps-Configurationusing-Azure-Automanage-Machine-Configuration

7.

WinGet & WinGet Configuration

8.

WinGet とは • Windows (Client) 向けのパッケージマネージャー https://github.com/microsoft/ winget-cli

9.

WinGet Configuration とは コンピューターのセットアップと プロジェクトのオンボードを自動化

10.

WinGet Configuration とは • 構成ファイルに基づくセットアップ(設定) • winget configuration コマンド(コンテキスト) • WinGet が構成マネージャーとして動作 • PowerShell Desired State Configuration ベース

11.

PowerShell DSC と違うところ • 構成(Configuration)は YAML で記述 • PowerShell を知らなくても良い(使うだけなら) • 自分で MOF をコンパイルする必要が無い • リモート接続を構成しなくても動作する • PowerShell DSC はローカル適用の場合も PowerShell Remoting の構成が必須

12.

WinGet Configuration 構成ファイル • 構成は YAML で記述 • configuration.dsc.yaml • プロパティ • configurationVersion : 構成スキーマのバージョン • assertions : 前提条件 • resources : 適用する構成

13.

Sample configuration.dsc.yaml # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 properties: assertions: - resource: OsVersion directives: description: Verify minimum OS version requirement module: Microsoft.Windows.Developer allowPrerelease: true settings: MinVersion: "10.0.19041" resources: - resource: Microsoft.WinGet.DSC/WinGetPackage id: VSCode directives: description: Install Visual Studio Code allowPrerelease: true settings: id: Microsoft.VisualStudioCode source: winget configurationVersion: 0.2.0

14.

WinGet Configuration の適用 • Configuration の確認 winget configuration show .¥configuration.dsc.yaml • Configuration の適用 winget configuration .¥configuration.dsc.yaml

15.

WinGet Configuration を試す • WinGet の Preview をインストール(以下何れか) • GitHub から Preview Release パッケージをインストール • Windows Insider Dev Channel に参加 • Windows Package Manager Insider Preview に参加 • 試験機能を有効化 • configuration 機能を設定ファイルから有効化 • winget settings で設定ファイルを編集

16.

• デモで使用したコマンドのチートシートやサンプルは 以下で公開します • https://github.com/ktakai/Demo/tree/master/20230617-SCUGJ35 Demo

17.

まとめ • WinGet は Package Manager としてだけでなく、 Configuration Manager としても利用可能に • Configuration は YAML で書ける • PowerShell DSC ベースなので DSC Resource を 再利用可能