I was just playing around with some PowerShell and thought of writing a post on Start-SPAssignment cmdlet. This cmdlet is very useful if you work with memory intensive object as SPSite, SPWeb or SPSiteAdminstration. The default procedure is, with the use of a Get cmdlet it will automatically dispose these objects immediately and release the memory after the pipeline finishes.
But with Start-Assignment you can assign the list of objects to a variable or a global assignment store and dispose when no longer needed.
There are three assignment levels.
Technet Samples
But with Start-Assignment you can assign the list of objects to a variable or a global assignment store and dispose when no longer needed.
There are three assignment levels.
- No assignment - where the object is not assigned to a object and is disposed after each iteration of the command.
- Simple assignment - This is done by using the global parameter. All objects are assigned to a global assignment store and released by calling the Stop-SPAssignment cmdlet.
- Advanced assignment - Objects are assigned to a named store and released by using the StopAssignment with -identity parameter.
Technet Samples
1 comment:
Interesting breakdown of how memory management evolved. I’ve noticed that even with modern memory-hungry apps, sticking to lean, low-overhead tools can make a real difference—especially on older systems. I use lightweight utilities to keep RAM usage tight, which helps avoid the kind of slowdowns that heap-heavy apps often cause over time. ( https://memoryreduct.com/mem-reduct-download/)
Post a Comment