PowerTip: Use PowerShell to Generate Random File Name

Doctor Scripto

Summary: Use Windows PowerShell to generate a random file name.

Hey, Scripting Guy! Question How can I use Windows PowerShell to generate a random file name so I can ensure that
           a file I create does not have a naming conflict?

Hey, Scripting Guy! Answer Use the GetRandomFileName static method from the System.IO.Path .NET Framework
           class, for example:

[System.IO.Path]::GetRandomFileName()

0 comments

Discussion is closed.

Feedback usabilla icon