When creating a PowerShell function, you can only use the return statement once. However, you can specify multiple values to return from the function by…
Category: Daily Picks
You can use the following basic syntax in PowerShell to check if a string is empty: if ($my_string) { echo “String is not empty” }…
You can use the following basic syntax in PowerShell to check if a file has been modified in the last 24 hours: if ((Get-Date) -…
You can use the following basic syntax in PowerShell to check if a file is empty: if ([String]::IsNullOrWhiteSpace((Get-content c:\users\bobbi\my_data.csv))) { echo “File is Empty” }…
You can use the following basic syntax in PowerShell to check if a file contains a specific string: if (Select-String -Path c:\docs\my_data.csv -Pattern “this” -SimpleMatch…
Often you may want to use the Export-Csv cmdlet in PowerShell to export data to a CSV file with a specific column order. Fortunately this…
Often you may want to use the Export-Csv cmdlet in PowerShell to export data to a CSV file with no quotes. Fortunately this is easy…
Often you may want to use the Export-Csv cmdlet in PowerShell to export data to a CSV file with no headers. Unfortunately, there is no…
You can use the following syntax in PowerShell to get the size (in GB) of each folder in a particular directory: $path = “c:\users\bobbi\onedrive\documents\collecting_wisdom” $folders…
You can use the following methods in PowerShell to get the folder size and file count for a specific directory: Method 1: Get Folder Size…
You can use the following syntax in PowerShell to list all files in a directory to a CSV file: ls | % Name > file_names.csv…
