Please bear with me as I am a complete beginner. I am trying to create a phone list where in powershell it pulls data from xlsx. I have an example below, i have also tried Importxlsx but it keeps spitting an error.
The xlsx only has 2 columns Phone List and Department that i want to pull from. Basically Pull "x department" and spit "x phone number"
just need a simple effective command for this.
Function Get-PhoneNumber{
PARAM($Department)
$Array = ImportExcel 'C:\Outputs\Internal Phone List 01.01.213 test'
$Array.Where({_.Department -eq $Department}) | Select-Object -Expandproperty
PhoneNumber
}
get-phonenumber -department "ICU"