OSDeploy / OSD

OSD Shared Functions
MIT License
132 stars 54 forks source link

Cleanup function #61

Closed skyblaster closed 3 months ago

skyblaster commented 1 year ago

Is your feature request related to a problem? Please describe. No particular problem, just looking to make it appear as though a more traditional ISO install was performed.

Describe the solution you'd like A cleanup function in the form of "Start-OSDCloudGUI -PostCleanup", which would remove all OSD related content.

C:\Drivers\<DriverPack.exe>  // Okay to keep the extracted contents, but we don't need the original large exe hanging around
C:\OSDCloud
C:\Program Files\WindowsPowerShell\Modules\AzureAD
C:\Program Files\WindowsPowerShell\Modules\MicroSoft.Graph.Intune
C:\Program Files\WindowsPowerShell\Modules\OSD
C:\Program Files\WindowsPowerShell\Modules\WindowsAutoPilotIntune
C:\Recovery
Any other files??
OSDeploy commented 1 year ago

I'm not open to adding parameters to OSDCloudGUI to keep it clean, so at best, this could be added to the GUI File Menu, but my big concern is your example doesn't clean everything. It doesn't remove the updated PackageManagement or PowerShellGet modules. It doesn't remove the added Get-WindowsAutopilotInfo. It doesn't remove the PPKG that's added to expand the Drivers and some transcripts that are in WinDir. There's also a Registry entry added for Autopilot to work properly. So, should there be an option to clean everything?

Finally, everyone's needs are going to be unique, and everyone may not want everything cleaned, so unless this is something that the majority of people want added, I'm not inclined to spend hours of time working on a solution that may have limited benefit

That said, I'm aware that everyone will never agree 100% on what should be added, and how it should be configured, and I don't want an infinite number of parameters, so I'd suggest adding a Post Script to do these actions that you want for your environment? I'll be presenting at MMSMOA on how to do this if you want to know how https://mmsmoa.com/mms2023moa

AkosBakos commented 1 year ago

@skyblaster you can extend my cleanup script --> cleanup.osdcloud.ch and or use SetupComplete.cmd for these functions.

But as @OSDeploy says, you need to define what you want to keep clean what you want to move etc. That's why I am just loving OSDCloud: it's for me a great framework, which can be used a really good baseline for having a good cloud based solution. --> it's hard do define limitations, because then other peeps would ask: "hey, but I want like this and this". So, the same play...

Simsi1986 commented 1 year ago

I think such cleanup should be covered by a custom script, which everyone can use individually based on own preferences. Maybe until a certain point, there are possibilties for a cleanup that contains mandatory steps, therefore properly part of OSD, but you will be soon reach a point with content that might not be cleaned up by everyone.

gwblok commented 3 months ago

Closing Request. This should be done via custom post script, which can be triggered using a "wrapper" script or leveraging SetupComplete. (You can add a custom SetupComplete into your Workspace / OSDCloudUSB which will get triggered during the setupcomplete phase of Windows Install.