Reading a MOF file with PowerShell

Welcome Forums General PowerShell Q&A Reading a MOF file with PowerShell

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
3 years, 7 months ago.

  • Author
    Posts
  • #24936

    Participant
    Points: 0
    Rank: Member

    Hello,

    I am new to PowerShell and I was wondering if I could use PowerShell to display the contents of server MOF files? If so, can you please point me in the right direction?

    Thanks in advance,

    J

  • #24952

    Participant
    Points: 0
    Rank: Member

    Hi,

    Not sure what you are aiming for.

    To list file contents in powershell console:

     Get-Content "C:\test.mof" 

    To load file contents line by line into variable:

     $temp = Get-content "C:\temp.mof" 

    Don't think it is possible to convert .mof file into powershell script.

The topic ‘Reading a MOF file with PowerShell’ is closed to new replies.