[{"data":1,"prerenderedAt":68},["ShallowReactive",2],{"/2025/10/09-supressing-output-in-powershell":3},{"id":4,"title":5,"body":6,"date":59,"description":44,"extension":60,"meta":61,"navigation":62,"path":63,"robots":64,"seo":65,"stem":66,"__hash__":67},"posts/2025/10/09 supressing-output-in-PowerShell.md","09 Supressing Output In PowerShell",{"type":7,"value":8,"toc":56},"minimark",[9,18,25,28,31,45,48],[10,11,13],"post-title",{":date":12},"date",[14,15,17],"h1",{"id":16},"supressing-output-in-powershell","Supressing Output in PowerShell",[19,20,21],"notes",{},[22,23,24],"p",{},"This is a repost from my old blog. First posted in 11/1/2018.",[26,27],"br",{},[22,29,30],{},"I was working with DiskPart, PowerShell, and Amazon SSM. Whenever I run DiskPart from PowerShell, the output was reflected in the console and it was recorded as Amazon SSM run command output, thus my run command was not completely clean. Such as the following:",[32,33,34],"code-block",{},[35,36,41],"pre",{"className":37,"code":39,"language":40},[38],"language-text","Microsoft DiskPart version 6.3.9600\nCopyright (C) 1999-2013 Microsoft Corporation.\nOn computer: MyComputer\nDISKPART>\nDisk 1 is now the selected disk.\nDISKPART>\nDiskPart successfully converted the selected disk to dynamic format.\n","text",[42,43,39],"code",{"__ignoreMap":44},"",[22,46,47],{},"Reading Q&A and documentation online, seems like no straightforward way to suppress output from DiskPart. I then tested something, how about if I assign the output to a variable and ignore it. It works and the command is still executed. For example, listing volume will be like the following in PowerShell:",[32,49,50],{},[35,51,54],{"className":52,"code":53,"language":40},[38],"$DiskPartOutput = 'list volume' | diskpart\n",[42,55,53],{"__ignoreMap":44},{"title":44,"searchDepth":57,"depth":57,"links":58},2,[],"2025-10-09T00:00:00.000Z","md",{},true,"/2025/10/09-supressing-output-in-powershell",null,{"title":5,"description":44},"2025/10/09 supressing-output-in-PowerShell","xtfUVOp9FYU5gXXZdoG7aADLdu2lDCs3JjlM5A4EOLM",1785167452931]