我试图执行下面的脚本:使用与powershell交易?
Start-Transaction
Remove-Item D:\sandbox\temp.txt -UseTransaction
Undo-Transaction
我不断收到以下错误:
The provider does not support transactions. Perform the operation again without the -UseTransaction parameter.
At line:3 char:1
+ Remove-Item D:\sandbox\temp.txt -UseTransaction
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotImplemented: (:) [], PSNotSupportedException
+ FullyQualifiedErrorId : NotSupported
任何人都知道为什么吗?我在Powershell 4中使用Windows 7 Professional x64。D:\是本地驱动器。
根据https://technet.microsoft.com/en-us/library/hh849765.aspx Remove-Item支持事务。 – coding4fun 2015-01-26 19:17:40
Remove-Item支持事务***当与支持事务***的提供者一起使用时。因此,例如,您应该能够将remove-item用作注册表提供程序的事务。 – EBGreen 2015-01-26 19:19:46
感谢您的澄清。我知道Vista +向操作系统添加了基于文件的事务,我错误地认为微软自己的cmdlet会支持该功能。呃,祝你好运。他们会很有用。 – coding4fun 2015-01-26 19:23:34