Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements!
Windows PowerShell update message FAQ - PowerShell | Microsoft Learn
PS C:\WINDOWS\system32> New-Item -ItemType Directory -Force "$env:USERPROFILE\Desktop\RollbackLogsSmall"
Directory: C:\Users\Ron\Desktop
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 06/25/2026 10:18 RollbackLogsSmall
PS C:\WINDOWS\system32> Copy-Item "$env:USERPROFILE\Desktop\RollbackLogs\*.log" "$env:USERPROFILE\Desktop\RollbackLogsSmall" -Force -ErrorAction SilentlyContinue
>> Copy-Item "$env:USERPROFILE\Desktop\RollbackLogs\*.xml" "$env:USERPROFILE\Desktop\RollbackLogsSmall" -Force -ErrorAction SilentlyContinue
>> Copy-Item "$env:USERPROFILE\Desktop\RollbackLogs\*.txt" "$env:USERPROFILE\Desktop\RollbackLogsSmall" -Force -ErrorAction SilentlyContinue
PS C:\WINDOWS\system32> Code:
>> $src='C:\$Windows.~BT\Sources\Rollback'
>> $dest="$env:USERPROFILE\Downloads\WU-Rollback-Small"
>>
>> New-Item -ItemType Directory -Force $dest | Out-Null
>>
>> $files = @( >> 'setuperr.log', >> 'diagerr.xml', >> 'diagwrn.xml', >> 'rollbackinfo.ini', >> 'rollbackstate.dat',
>> 'SetupPlatform.ini',
>> 'SetupPlatform.Drivers.ini',
>> 'WinSetupMon.log',
>> 'MigLog.xml',
>> 'LogRestore.TXT',
>> 'FolderMoveLog.TXT'
>> )
>>
>> foreach ($f in $files) {
>> Copy-Item (Join-Path $src $f) $dest -Force -ErrorAction SilentlyContinue
>> }
>>
>> Compress-Archive -Path "$dest\*" -DestinationPath "$env:USERPROFILE\Downloads\WU-Rollback-Small.zip" -Force
Code: : The term 'Code:' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Code:
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (Code::String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundExceptio