Add-Type -AssemblyName PresentationFramework
[xml]$XML = @"
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Title="windows update" Height="480" Width="640">
<Grid Background="#FFC1C3CB">
<Button Name="WU" Content="lancer la MAJ" HorizontalAlignment="Left" Margin="327,10,0,0" VerticalAlignment="Top" Width="100" Height="54"/>
<TextBox Name="PCWU" HorizontalAlignment="Left" Height="23" Margin="145,10,0,0" TextWrapping="Wrap" Text="D23-0494" VerticalAlignment="Top" Width="160"/>
<Button Name="Close" Content="Fermer la fenêtre" HorizontalAlignment="Right" Margin="10,10,0,0" VerticalAlignment="Top" Width="100" Height="54"/>
</Grid>
</Window>
"@
$FormXML = (New-Object System.Xml.XmlNodeReader $XML)
$Window = [Windows.Markup.XamlReader]::Load($FormXML)
$Window.FindName("WU").add_click({
$computer = $Window.FindName('PCWU').Text
Invoke-Command -ComputerName $computer -ScriptBlock {.Windows11InstallationAssistant.exe /QuietInstall /SkipEULA /NoRestartUI}
})
$Window.FindName("Close").add_click({
$Window.Close()
})
$Window.ShowDialog()
i have this code to install windows11 with the assistant but when I click to update the shell say objectnotFound
I tried to move the file to the root of the PC but it doesn’t work either
New contributor
promo 69 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.