Rado Rafiringa commented on
Understanding PowerShell Begin, Process, and End blocks 12 hours, 41 minutes ago
If cleanup is necessary regardless of whether an exception is thrown or not, what is the advantage of using begin, process and end blocks instead of try, catch and finally blocks?
First, create VM Hyper-V using a ISO Windows 2016. Then, How-to Install-WindowsFeature and apps (chocolatey) using Remote Powershell, against Virtual Machine (Windows 2016) in Hyper-V (in Windows 10) ?
Baki Dayi posted an update in the group
PowerShell 1 day, 12 hours ago
So youre already working with the latest PowerShell version and wondering how to automate your PowerShell 7 scripts with the task scheduler? Yes? Ok, then stay tuned I will show you two waysDavid Johnson replied to the topic PowerShell Python command-line arguments in
PowerShell Forum 2 days, 1 hour ago
I’m pursuing a python course and trying to run a Python script in PowerShell.
Why are you doing this? Python is Python, PowerShell is PowerShell run python scripts in python and PowerShell scripts in powershell
from datetime import datetime
now = datetime.now() # current date and time
strdate = now.strftime(“%dd/%mm/%Y”)
print(“date and time:”,strdate)Yes, we were told by the software vendor not to do that. So this is a bit of a work-around.
Whenever I have a need for something to be read only like this though, I’ll set set the permissions to read-only.
Yes, exactly. It makes even more sense when you understand the files we are overwriting are a mixture of executables, reports, dlls, and database edits.
Sponsor posted an update in the group
PowerShell 2 days, 19 hours ago
PowerShell is a great technology to speed up the management of Azure services, Office 365 tenants, and many more. However, many users find it too complex and only suitable for experts.
ScriptRunner makes PowerShell a real solution for everyone by simplifying the development, management and delegation of PowerShell scripts.
Register for freeI think I see what you’re saying. If someone alters the destination file, it would be replaced by the source to restore the ‘corruption’.
Baki Dayi posted an update in the group
PowerShell 3 days, 11 hours ago
Get familiar with executing a DNS backup and restore procedure to avoid outage that can cause downtime for users across your organization.Joe Stutter commented on
How to create an open file/folder dialog box with PowerShell 3 days, 13 hours ago
I got the code you mentioned here “I also found a better folder browser dialog – Sapien Forums but I could not get it to run. to work. The issue is on line 122. The original looks like this:
for (int i = 1; i < names.Length; ++i) { type = type.GetNestedType(names, BindingFlags.NonPublic); }
it should be:
for (int i = 1; i < names.Length; ++i) { type = type.GetNestedType(names[i], BindingFlags.NonPublic); }
names is an array and it is missing the counter [i] in the code.
The MIR function at a minimum compares timestamps. Unless there is a way to change a file without altering the timestamp (there maybe, I am unsure) then robocopy /MIR will ensure the source files overwrite the destination files if there is a change recorded in the OS.
It probably wouldn’t repair hardware or driver level corruption, but it is great at fixing the corruption introduced by users.Can’t wait to read about Cobian–seems like it’s pretty neat!
Thats the beauty of Cobian – it produce flat files copy or a simple zip archives that can be extracted by anything. Im preparing a post about Cobian, you will be able to read it soon if you like.
Great post as usual. Thank you for sharing the useful trick Mr. Wolfgang.
It’s pretty simple actually. If your source is T:SUBDIR and destinations are 10.10.10.1VOLUME, 10.10.10.2VOLUME, 10.10.10.2VOLUME, then something like:[code]FOR %F IN (10.10.10.1VOLUME 10.10.10.2VOLUME 10.10.10.2VOLUME) DO START ROBOCOPY T:SUBDIR %FSUBDIR /MIR /COPY:ALL /R:3 /W:3[code]I would also recommend testing to make sure your command is correct by using echo:
[code]FOR %F IN (10.10.10.1VOLUME 10.10.10.2VOLUME 10.10.10.2VOLUME) DO ECHO START ROBOCOPY T:SUBDIR %FSUBDIR /MIR /COPY:ALL /R:3 /W:3[code]Backup programs can also add their own additional point of failure though if a restore has to be done through the backup program. This is why I’ve stuck with straight file copies for backups.
you need to import the webadministration module first
run this command
import-module webadministrationYou are welcome to share such tricks with specific commands, readers would appriciate that.
- Load More