PowerShell的:能够确定文件的MIME类型? [英] PowerShell: Possible to Determine a File's MIME Type?
问题描述
是否有可能在PowerShell来确定某个文件的类型是?举例来说,如果我将它传递的C路径:\ Foo.zip
,我可以把它确定,在该路径下的文件,其实是一个zip文件,不是别的东西?
Is it possible for PowerShell to determine what a given file's type is? For example, if I pass it a path of C:\Foo.zip
, can I have it determine that the file at that path is, in fact, a zip file and not something else?
推荐答案
PowerShell中,如Windows操作系统的其他部分,仅仅是猜测基础上的扩展名的文件类型。
PowerShell, like rest of the Windows operating system, merely guesses the file type based on the extension.
然而,也有第三方的文件类型猜测者计划在那里,那些实际上看文件的内容。
However, there are third-party file type guesser programs out there, ones that actually look at the contents of the file.
有一个<一个href="http://superuser.com/questions/274734/is-there-a-tool-that-can-determine-the-file-type-from-containing-data">truly出色的回答这个问题在超级用户。顶级的建议包括文件为Windows 和的论坛报。
There is a truly excellent answer to this question over on SuperUser. Top recommendations include File for Windows and TrID.
这篇关于PowerShell的:能够确定文件的MIME类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!