I'm hoping someone can help me figure this out. I am trying to get the Status column to only appear when I browse a directory where the <curpath> contains "OneDrive" somewhere in it. I have tried the following code in all three of the Custom Event Action - Changing Locations Events separately, but it seems that no matter what way I try, it either doesn't work at all, or the Status column shows up all the time. Any thoughts on how to only get this to show with "OneDrive" in the <curpath>?
Code: Select all
$path = <curpath>;
if ($path like "*OneDrive*") {
// Adjust the comma-separated list to match your preferred columns (including Status)
setcolumns("Name,Size,Modified,Status");
} else {
// Standard layout without Status
setcolumns("Name,Size,Modified");
}