我试图写一个简单的PowerShell读取的OneNote记事本和排序选项卡/字母顺序页面的XML。我已经可以用XML对它们进行排序,但是当我运行UpdateHierarchy时,命令会运行,但是文件最后没有更新。我想念什么?
下面是一个试验只是为了交换摘录两页左右。这是下面的交换前后脚本的输出...
== BEFORE ==
Notebook: Test Notebook
# Section A
### My Page
### Another Page
### Third Page in Section A
### B Page
### 123 Page
# Section B
### This has no title
### Untitled page
== AFTER ==
Notebook: Test Notebook
# Section A
### My Page
### Another Page
### Third Page in Section A
### B Page
### 123 Page
# Section B
### Untitled page
### This has no title
#Trial Code
$Page0 = $NoteBook.Section[1].Page[0]
$Page1 = $NoteBook.Section[1].Page[1]
$NoteBook.Section[1].InsertAfter($Page0,$Page1)
([XML]$Hierarchy).Notebooks.Notebook[$NoteBookIndex].InnerXml = $NoteBook.InnerXml
$OneNote.UpdateHierarchy($Hierarchy)
然而,当我在OneNote中打开笔记本电脑,它仍然是在相同的顺序,因为它是前