Collecting Wisdom

Collecting Wisdom

Skip to content
Menu

Category: Daily Picks

Daily Picks

PowerShell: How to Return Multiple Values from Function

Posted on February 27, 2024 by Zach

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…

Daily Picks

How to Check if String is Empty in PowerShell (With Examples)

Posted on February 26, 2024 by Zach

You can use the following basic syntax in PowerShell to check if a string is empty: if ($my_string) { echo “String is not empty” }…

Daily Picks

PowerShell: Check if File Has Been Modified in last 24 Hours

Posted on February 26, 2024 by Zach

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) -…

Daily Picks

PowerShell: How to Check if File is Empty

Posted on February 26, 2024 by Zach

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” }…

Daily Picks

PowerShell: How to Check if File Contains Specific String

Posted on February 26, 2024 by Zach

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…

Daily Picks

PowerShell: How to Use Export-Csv and Specify Column Order

Posted on February 26, 2024 by Zach

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…

Daily Picks

PowerShell: How to Use Export-Csv with No Quotes

Posted on February 25, 2024March 12, 2024 by Zach

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…

Daily Picks

PowerShell: How to Use Export-Csv with No Headers

Posted on February 24, 2024March 12, 2024 by Zach

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…

Daily Picks

PowerShell: How to Get Folder Size in GB

Posted on February 24, 2024 by Zach

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…

Daily Picks

PowerShell: How to Get Folder Size and File Count

Posted on February 24, 2024 by Zach

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…

Daily Picks

PowerShell: How to List All Files in Directory to CSV File

Posted on February 24, 2024 by Zach

You can use the following syntax in PowerShell to list all files in a directory to a CSV file: ls | % Name > file_names.csv…

Posts pagination

Page 1 Page 2 Page 3 Next Page

Search

© 2024 Collecting Wisdom | Privacy Policy
Wisteria Theme by WPFriendship ⋅ Powered by WordPress