Created
June 13, 2021 14:41
-
-
Save TakamiChie/c42c452ba8b1328d2dab65dda7111bcd to your computer and use it in GitHub Desktop.
choco list --localonlyから一括処理用のXMLファイルを作る
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
print("""<?xml version="1.0" encoding="utf-8"?> | |
<packages>""") | |
for line in sys.stdin: | |
l = line.strip().split(" ") | |
if l[1] != "packages": | |
print(f' <package id="{l[0]}" version="{l[1]}" />') | |
print("</packages>") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ファイルをパスの通ったフォルダに置き、
choco list --localonly | chocolateyxml.py > PC.config
のような感じで呼び出すと良い。