Just some minor fixes, and the obvious API changes needed to be RC1 compatible. Source has been pushed the the MSH Community Extensions Workspace. For those of you who just want to play, you can get the latest binary at the bottom of this entry. Installation has changed slightly:
PS c:\temp> InstallUtil Nivot.PowerShell.SharePoint.dll...PS c:\temp> Add-PSSnapin Nivot.PowerShell.SharePointPS c:\temp> New-PSDrive wss SharePoint http://mywss/PS c:\temp> cd wss:PS wss:\>
Apart from some minor refactoring, I've added some more actions to allow copy/move/delete between users/roles/groups and webs. Here's an example of how easy it is to define the operations for adding and removing users to a SPWeb using my generics-based provider model:
// add SPUser and place in Reader role by defaultRegisterAdder<SPUser>( new Action<IStoreItem>( delegate(IStoreItem item) { SPUser user = (SPUser)item.NativeObject; NativeObject.Roles["Reader"].AddUser(user); } ));
// remove SPUserRegisterRemover<SPUser>( new Action<IStoreItem>( delegate(IStoreItem item) { SPUser user = (SPUser)item.NativeObject; NativeObject.Users.Remove(user.LoginName); } ));
The above code allows the following to work: PS wss:\subweb> copy ..\!roles\contributor\username .
where . represents wss:\subweb, an SPWeb object.Have fun!
Build RC1 Only, NOT RC1 Refresh -- for latest version see homepage Download: Nivot.PowerShell.SharePoint-0.51.zip (40.94 KB)
(edit: minor bug found -- v0.51 update)
Page rendered at Friday, September 05, 2008 9:42:04 PM (Eastern Standard Time, UTC-05:00)
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.