In most cases, your server's backup policy is fire and forget. You create and set the backup policy, and from then on backup just happens at the time you specify in the backup schedule. In other cases, perhaps before and after a major system change, you may want to initiate a one-off backup and not wait for WSB to create a scheduled backup. Additionally, you may just want to create a backup of key files. In those cases, you can run a backup based on a one-off policy.
To perform this recipe, you may find it helpful to remove the existing backup policy. This ensures the one-off policy you create in this recipe does not overlap with earlier/later recipes. If you perform this recipe on a live production server, make sure reinstate the backup policy after you have completed your testing.
Removing the policy is straightforward:
If (Get-WBPolicy) { Remove-WBPolicy -All -Force }
This recipe also uses a folder C:\Foo
. If this does not exist on your system, create...