check for files that have offline attribute and set it them to archive Check if .txt file is empty Check if a process is running check if a process or service is hanging/not responding? Check if a text file is
/bin/bash - #=== # # FILE: conv.sh # #
Find and Replace Text in a File Find bridge head server Find certificates issued by specific CA? Find Computer Name of the PC that a user is currently logged from their AD Username Find Computers AD Group memberships - How to? Find device id of NIC through powershell Find disabled users in...
This command copies the folder C:\temp\test1 to the new folder C:\temp\DeleteMe recursively:PowerShell Copy Copy-Item C:\temp\test1 -Recurse C:\temp\DeleteMe You can also copy a selection of items. The following command copies all .txt files contained anywhere in C:\data to C:\temp...
The TSQLfromDTSX.ps1 script takes 2 parameters: the path to the files and an option to recursively look at sub-folders. powershell.exe .TSQLfromDTSX.ps1 -RootFolder <folder path> -Recurse <0 or 1> Important: if the folder path has embedded spaces, you need to surround the path with...
Note that the function calls itself recursively. Each time it does so, it creates yet another nested scope, each with its own variables$xand$y. Here is a more complex example, which also shows nested scopes and reuse of names: PowerShell ...
This example also demonstrates that you can change the form's background color. This function will not work in PowerShell Core.New-WPFMessageBoxThis function creates a Windows Presentation Foundation (WPF) based message box. This is intended to replace the legacy MsgBox function from VBScript and...
Update-Content Data Wrangling\Update-Content.ps1 Insert text on a new line after the line matching the StartPattern or replace text between start- and end Pattern within a file Link Compare-File Extend Builtin\Compare-File.ps1 A wrapper and extension for the built-in Compare-Object cmdlet to...
CommandTextwill be the property where the text of the select command will be stored: $cmd.CommandText=”Select ‘Hello world!’ Greeting from dual” Here we just produce a greeting message, which can run on any schema because it uses the build in table “dual”. There is just one piece ...
Find and Replace Text in a File Find bridge head server Find certificates issued by specific CA? Find Computer Name of the PC that a user is currently logged from their AD Username Find Computers AD Group memberships - How to? Find device id of NIC through powershell Find disabled users in...